test
This commit is contained in:
@@ -131,6 +131,14 @@ CustomListView {
|
||||
model.values: [0]
|
||||
root.delegate: calcItem
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "variant"
|
||||
|
||||
PropertyChanges {
|
||||
model.values: SchemeVariants.query(search.text)
|
||||
root.delegate: variantItem
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: Transition {
|
||||
@@ -211,4 +219,12 @@ CustomListView {
|
||||
list: root
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: variantItem
|
||||
|
||||
VariantItem {
|
||||
list: root
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,11 +123,6 @@ Item {
|
||||
search.text = "";
|
||||
}
|
||||
|
||||
function onSessionChanged(): void {
|
||||
if (!root.visibilities.session)
|
||||
search.forceActiveFocus();
|
||||
}
|
||||
|
||||
target: root.visibilities
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
import QtQuick
|
||||
import qs.Components
|
||||
import qs.Modules.Launcher.Services
|
||||
import qs.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property var list
|
||||
required property SchemeVariants.Variant modelData
|
||||
|
||||
anchors.left: parent?.left
|
||||
anchors.right: parent?.right
|
||||
implicitHeight: Config.launcher.sizes.itemHeight
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.modelData?.onClicked(root.list);
|
||||
}
|
||||
|
||||
radius: Appearance.rounding.normal
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Appearance.padding.larger
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
anchors.rightMargin: Appearance.padding.larger
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pointSize: Appearance.font.size.extraLarge
|
||||
text: root.modelData?.icon ?? ""
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.left: icon.right
|
||||
anchors.leftMargin: Appearance.spacing.larger
|
||||
anchors.verticalCenter: icon.verticalCenter
|
||||
spacing: 0
|
||||
width: parent.width - icon.width - anchors.leftMargin - (current.active ? current.width + Appearance.spacing.normal : 0)
|
||||
|
||||
CustomText {
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
text: root.modelData?.name ?? ""
|
||||
}
|
||||
|
||||
CustomText {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: DynamicColors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Appearance.font.size.small
|
||||
text: root.modelData?.description ?? ""
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: current
|
||||
|
||||
active: root.modelData?.variant === Config.colors.schemeType
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
color: DynamicColors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Appearance.font.size.large
|
||||
text: "check"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.Modules.Launcher
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
Searcher {
|
||||
id: root
|
||||
|
||||
function transformSearch(search: string): string {
|
||||
return search.slice(`${Config.launcher.actionPrefix}variant `.length);
|
||||
}
|
||||
|
||||
useFuzzy: Config.launcher.useFuzzy.variants
|
||||
|
||||
list: [
|
||||
Variant {
|
||||
description: qsTr("Maximum chroma at each tone.")
|
||||
icon: "sentiment_very_dissatisfied"
|
||||
name: qsTr("Vibrant")
|
||||
variant: "vibrant"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Pastel palette with a low chroma.")
|
||||
icon: "android"
|
||||
name: qsTr("Tonal Spot")
|
||||
variant: "tonalspot"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Hue-shifted, artistic or playful colors.")
|
||||
icon: "compare_arrows"
|
||||
name: qsTr("Expressive")
|
||||
variant: "expressive"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Preserve source color exactly.")
|
||||
icon: "compare"
|
||||
name: qsTr("Fidelity")
|
||||
variant: "fidelity"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Almost identical to fidelity.")
|
||||
icon: "sentiment_calm"
|
||||
name: qsTr("Content")
|
||||
variant: "content"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("The seed colour's hue does not appear in the theme.")
|
||||
icon: "nutrition"
|
||||
name: qsTr("Fruit Salad")
|
||||
variant: "fruit-salad"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Like Fruit Salad but different hues.")
|
||||
icon: "looks"
|
||||
name: qsTr("Rainbow")
|
||||
variant: "rainbow"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("Close to grayscale, a hint of chroma.")
|
||||
icon: "contrast"
|
||||
name: qsTr("Neutral")
|
||||
variant: "neutral"
|
||||
},
|
||||
Variant {
|
||||
description: qsTr("All colours are grayscale, no chroma.")
|
||||
icon: "filter_b_and_w"
|
||||
name: qsTr("Monochrome")
|
||||
variant: "monochrome"
|
||||
}
|
||||
]
|
||||
|
||||
component Variant: QtObject {
|
||||
required property string description
|
||||
required property string icon
|
||||
required property string name
|
||||
required property string variant
|
||||
|
||||
function onClicked(list: AppList): void {
|
||||
list.visibilities.launcher = false;
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--scheme", variant]);
|
||||
Config.colors.schemeType = variant;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user