add loader to wallpicker to consume less ram
This commit is contained in:
parent
e0808edeb5
commit
d3b1789b99
32
Colors.qml
32
Colors.qml
@ -3,24 +3,24 @@ import QtQuick
|
||||
|
||||
QtObject {
|
||||
// --- The Backgrounds (Darkest to Lightest) ---
|
||||
readonly property string base00: "#181616" // Default Background
|
||||
readonly property string base01: "#282727" // Lighter Background (Status bars, panels)
|
||||
readonly property string base02: "#393836" // Selection Background
|
||||
readonly property string base03: "#625e5a" // Comments, Invisibles, line highlighting
|
||||
readonly property string base00: "#1d1f21" // Default Background
|
||||
readonly property string base01: "#282a2e" // Lighter Background (Status bars, panels)
|
||||
readonly property string base02: "#373b41" // Selection Background
|
||||
readonly property string base03: "#969896" // Comments, Invisibles, line highlighting
|
||||
|
||||
// --- The Foregrounds (Darkest to Lightest) ---
|
||||
readonly property string base04: "#737c73" // Dark Foreground (Used for status bars)
|
||||
readonly property string base05: "#c5c9c5" // Default Foreground, Caret
|
||||
readonly property string base06: "#c8c093" // Light Foreground (Rarely used)
|
||||
readonly property string base07: "#c5c9c5" // Lightest Foreground
|
||||
readonly property string base04: "#b4b7b4" // Dark Foreground (Used for status bars)
|
||||
readonly property string base05: "#c5c8c6" // Default Foreground, Caret
|
||||
readonly property string base06: "#e0e0e0" // Light Foreground (Rarely used)
|
||||
readonly property string base07: "#ffffff" // Lightest Foreground
|
||||
|
||||
// --- The Accent Colors ---
|
||||
readonly property string base08: "#c4746e" // Red (Variables, errors)
|
||||
readonly property string base09: "#b6927b" // Orange (Integers, booleans, constants)
|
||||
readonly property string base0A: "#c4b28a" // Yellow (Classes, search text bg, warnings)
|
||||
readonly property string base0B: "#8a9a7b" // Green (Strings, success states)
|
||||
readonly property string base0C: "#8ea4a2" // Cyan (Support, regex, escape chars)
|
||||
readonly property string base0D: "#8ba4b0" // Blue (Functions, methods, headings)
|
||||
readonly property string base0E: "#a292a3" // Purple/Mauve (Keywords, storage, selectors)
|
||||
readonly property string base0F: "#b98d7b" // Brown/Flamingo (Deprecated, embedded tags)
|
||||
readonly property string base08: "#cc6666" // Red (Variables, errors)
|
||||
readonly property string base09: "#de935f" // Orange (Integers, booleans, constants)
|
||||
readonly property string base0A: "#f0c674" // Yellow (Classes, search text bg, warnings)
|
||||
readonly property string base0B: "#b5bd68" // Green (Strings, success states)
|
||||
readonly property string base0C: "#8abeb7" // Cyan (Support, regex, escape chars)
|
||||
readonly property string base0D: "#81a2be" // Blue (Functions, methods, headings)
|
||||
readonly property string base0E: "#b294bb" // Purple/Mauve (Keywords, storage, selectors)
|
||||
readonly property string base0F: "#a3685a" // Brown/Flamingo (Deprecated, embedded tags)
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ Variants {
|
||||
color: Colors.base00
|
||||
RowLayout {
|
||||
id: left
|
||||
anchors.leftMargin: Settings.config.floating ? 3 : 10
|
||||
spacing: Settings.config.barSpacing
|
||||
anchors {
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -45,6 +45,7 @@ Variants {
|
||||
}
|
||||
RowLayout {
|
||||
id: center
|
||||
spacing: Settings.config.barSpacing
|
||||
anchors {
|
||||
centerIn: parent
|
||||
}
|
||||
@ -52,10 +53,11 @@ Variants {
|
||||
}
|
||||
RowLayout {
|
||||
id: right
|
||||
spacing: Settings.config.barSpacing
|
||||
anchors {
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
rightMargin: Settings.config.floating ? Settings.config.barmargins : 10
|
||||
rightMargin: Settings.config.floating ? Settings.config.barmargins : 10
|
||||
}
|
||||
StatusIcons {}
|
||||
Tray {}
|
||||
|
||||
@ -7,61 +7,67 @@ import Qt.labs.folderlistmodel 2.10
|
||||
import qs
|
||||
import qs.settings
|
||||
|
||||
FloatingWindow {
|
||||
id: root
|
||||
implicitWidth: 700
|
||||
title: "qs-wallpicker"
|
||||
implicitHeight: 600
|
||||
color: Colors.base00
|
||||
visible: Settings.config.wallswitchershown
|
||||
onClosed: Settings.config.wallswitchershown = false
|
||||
Loader {
|
||||
active: Settings.config.wallswitchershown
|
||||
sourceComponent: root
|
||||
Component {
|
||||
id: root
|
||||
FloatingWindow {
|
||||
implicitWidth: 700
|
||||
title: "qs-wallpicker"
|
||||
implicitHeight: 600
|
||||
color: Colors.base00
|
||||
visible: Settings.config.wallswitchershown
|
||||
onClosed: Settings.config.wallswitchershown = false
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
radius: Settings.config.rounding
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 8
|
||||
}
|
||||
color: Colors.base02
|
||||
FolderListModel {
|
||||
id: wpModel
|
||||
folder: "file:///home/lucy/.walls/"
|
||||
nameFilters: ["*.png"]
|
||||
}
|
||||
Component {
|
||||
id: wallDelegate
|
||||
Rectangle {
|
||||
id: wpPreview
|
||||
required property var filePath
|
||||
implicitWidth: 80
|
||||
implicitHeight: 60
|
||||
color: "transparent"
|
||||
Image {
|
||||
asynchronous: true
|
||||
anchors.fill: parent
|
||||
source: wpPreview.filePath ? wpPreview.filePath : null
|
||||
id: container
|
||||
radius: Settings.config.rounding
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 8
|
||||
}
|
||||
MouseArea {
|
||||
id: updater
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
Settings.config.currentWall = wpPreview.filePath;
|
||||
color: Colors.base02
|
||||
FolderListModel {
|
||||
id: wpModel
|
||||
folder: "file:///home/lucy/.walls/"
|
||||
nameFilters: ["*.png"]
|
||||
}
|
||||
Component {
|
||||
id: wallDelegate
|
||||
Rectangle {
|
||||
id: wpPreview
|
||||
required property var filePath
|
||||
implicitWidth: 80
|
||||
implicitHeight: 60
|
||||
color: "transparent"
|
||||
Image {
|
||||
asynchronous: true
|
||||
anchors.fill: parent
|
||||
source: wpPreview.filePath ? wpPreview.filePath : null
|
||||
}
|
||||
MouseArea {
|
||||
id: updater
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
Settings.config.currentWall = wpPreview.filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GridView {
|
||||
id: wallLayout
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 20
|
||||
anchors.leftMargin: 40
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
model: wpModel
|
||||
delegate: wallDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
GridView {
|
||||
id: wallLayout
|
||||
anchors.centerIn: parent
|
||||
anchors.margins: 20
|
||||
anchors.leftMargin: 40
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
model: wpModel
|
||||
delegate: wallDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ Singleton {
|
||||
property var currentWall
|
||||
property bool wallswitchershown
|
||||
property int barmargins
|
||||
property int barSpacing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
{
|
||||
"barHeight": 38,
|
||||
"currentWall": "/home/lucy/.walls/mooon.png",
|
||||
"barHeight": 32,
|
||||
"barSpacing": 10,
|
||||
"barmargins": 6,
|
||||
"currentWall": "/home/lucy/.walls/frierensuff.png",
|
||||
"floating": true,
|
||||
"font": "Maple Mono",
|
||||
"fontSize": 12,
|
||||
"font": "Lora",
|
||||
"fontSize": 14,
|
||||
"margins": 10,
|
||||
"rounding": 26,
|
||||
"wallswitchershown": false,
|
||||
"barmargins": 8
|
||||
"wallswitchershown": false
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user