Settings UI for color scheme presets
This commit is contained in:
@@ -8,20 +8,34 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property alias active: splitButton.active
|
property alias active: splitButton.active
|
||||||
|
property alias buttonAlias: splitButton
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
property alias expanded: splitButton.expanded
|
property alias expanded: splitButton.expanded
|
||||||
property int expandedZ: 100
|
property int expandedZ: 100
|
||||||
required property string label
|
required property string label
|
||||||
property alias menuItems: splitButton.menuItems
|
property alias menuItems: splitButton.menuItems
|
||||||
|
property bool shouldBeActive: true
|
||||||
property alias type: splitButton.type
|
property alias type: splitButton.type
|
||||||
|
|
||||||
signal selected(item: MenuItem)
|
signal selected(item: MenuItem)
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
clip: false
|
clip: false
|
||||||
|
implicitHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
z: root.expanded ? expandedZ : -1
|
z: root.expanded ? expandedZ : -1
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
|
property Presets presets: Presets {
|
||||||
|
}
|
||||||
property string schemeType: "vibrant"
|
property string schemeType: "vibrant"
|
||||||
|
|
||||||
|
component Presets: JsonObject {
|
||||||
|
property string accent: ""
|
||||||
|
property string name: ""
|
||||||
|
property string variant: ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -115,7 +115,12 @@ Singleton {
|
|||||||
|
|
||||||
function serializeColors(): var {
|
function serializeColors(): var {
|
||||||
return {
|
return {
|
||||||
schemeType: colors.schemeType
|
schemeType: colors.schemeType,
|
||||||
|
presets: {
|
||||||
|
name: colors.presets.name,
|
||||||
|
variant: colors.presets.variant,
|
||||||
|
accent: colors.presets.accent
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
// FetchPresets.qml
|
||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property var parsedPresets: ({})
|
||||||
|
readonly property var presets: parsedPresets
|
||||||
|
property bool ready: false
|
||||||
|
|
||||||
|
function accents(presetName, variantName) {
|
||||||
|
const variant = parsedPresets[presetName]?.variants?.[variantName];
|
||||||
|
|
||||||
|
return variant?.accents ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function defaultAccent(presetName, variantName) {
|
||||||
|
const variant = parsedPresets[presetName]?.variants?.[variantName];
|
||||||
|
|
||||||
|
return variant?.default_accent ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function modes(presetName, variantName) {
|
||||||
|
const variant = parsedPresets[presetName]?.variants?.[variantName];
|
||||||
|
|
||||||
|
return variant?.modes ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function presetNames() {
|
||||||
|
return Object.keys(parsedPresets);
|
||||||
|
}
|
||||||
|
|
||||||
|
function variantNames(presetName) {
|
||||||
|
const preset = parsedPresets[presetName];
|
||||||
|
|
||||||
|
if (!preset || !preset.variants)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
return Object.keys(preset.variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
command: ["zshell-cli", "scheme", "list-presets", "--json"]
|
||||||
|
running: true
|
||||||
|
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(text);
|
||||||
|
|
||||||
|
root.parsedPresets = parsed.presets ?? {};
|
||||||
|
root.ready = true;
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to parse presets JSON:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ Singleton {
|
|||||||
|
|
||||||
readonly property int darkEnd: Config.general.color.scheduleDarkEnd
|
readonly property int darkEnd: Config.general.color.scheduleDarkEnd
|
||||||
readonly property int darkStart: Config.general.color.scheduleDarkStart
|
readonly property int darkStart: Config.general.color.scheduleDarkStart
|
||||||
readonly property bool enabled: Config.general.color.scheduleDark
|
readonly property bool enabled: Config.general.color.scheduleDark && Config.general.color.schemeGeneration
|
||||||
|
|
||||||
function applyDarkMode() {
|
function applyDarkMode() {
|
||||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--mode", "dark"]);
|
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--mode", "dark"]);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import QtQuick
|
||||||
import qs.Modules.Settings.Controls
|
import qs.Modules.Settings.Controls
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
|
||||||
@@ -80,6 +81,7 @@ SettingsPage {
|
|||||||
name: "Sans family"
|
name: "Sans family"
|
||||||
object: Config.appearance.font.family
|
object: Config.appearance.font.family
|
||||||
setting: "sans"
|
setting: "sans"
|
||||||
|
stringList: Qt.fontFamilies()
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
@@ -89,6 +91,7 @@ SettingsPage {
|
|||||||
name: "Monospace family"
|
name: "Monospace family"
|
||||||
object: Config.appearance.font.family
|
object: Config.appearance.font.family
|
||||||
setting: "mono"
|
setting: "mono"
|
||||||
|
stringList: Qt.fontFamilies()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ SettingsPage {
|
|||||||
sectionId: "Wallpapers"
|
sectionId: "Wallpapers"
|
||||||
|
|
||||||
WallpaperGrid {
|
WallpaperGrid {
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
import qs.Modules.Settings.Controls
|
import qs.Modules.Settings.Controls
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Components
|
import qs.Components
|
||||||
@@ -67,6 +69,7 @@ SettingsPage {
|
|||||||
|
|
||||||
CustomSplitButtonRow {
|
CustomSplitButtonRow {
|
||||||
active: Config.general.color.mode === "light" ? menuItems[0] : menuItems[1]
|
active: Config.general.color.mode === "light" ? menuItems[0] : menuItems[1]
|
||||||
|
buttonAlias.disabled: !Config.general.color.schemeGeneration
|
||||||
label: qsTr("Scheme mode")
|
label: qsTr("Scheme mode")
|
||||||
|
|
||||||
menuItems: [
|
menuItems: [
|
||||||
@@ -100,6 +103,7 @@ SettingsPage {
|
|||||||
id: schemeType
|
id: schemeType
|
||||||
|
|
||||||
active: root.schemeTypeItem(menuItems, Config.colors.schemeType)
|
active: root.schemeTypeItem(menuItems, Config.colors.schemeType)
|
||||||
|
buttonAlias.disabled: !Config.general.color.schemeGeneration
|
||||||
label: qsTr("Scheme type")
|
label: qsTr("Scheme type")
|
||||||
z: 2
|
z: 2
|
||||||
|
|
||||||
@@ -169,21 +173,69 @@ SettingsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 0 : 1
|
||||||
|
}
|
||||||
|
|
||||||
|
SchemesListView {
|
||||||
|
name: "Color scheme presets"
|
||||||
|
object: Config.colors.presets
|
||||||
|
setting: "name"
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 0 : 1
|
||||||
|
stringList: FetchPresets.presetNames()
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
shouldBeActive: Config.colors.presets.name !== "" && !Config.general.color.schemeGeneration
|
||||||
|
}
|
||||||
|
|
||||||
|
SchemesListView {
|
||||||
|
name: "Preset variant"
|
||||||
|
object: Config.colors.presets
|
||||||
|
setting: "variant"
|
||||||
|
shouldBeActive: Config.colors.presets.name !== "" && !Config.general.color.schemeGeneration
|
||||||
|
stringList: FetchPresets.variantNames(Config.colors.presets.name)
|
||||||
|
|
||||||
|
onOptionSet: item => {
|
||||||
|
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--preset", `${Config.colors.presets.name.toLowerCase()}:${item}`]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
shouldBeActive: Config.colors.presets.variant !== "" && FetchPresets.accents(Config.colors.presets.name, Config.colors.presets.variant).length > 0 && !Config.general.color.schemeGeneration
|
||||||
|
}
|
||||||
|
|
||||||
|
SchemesListView {
|
||||||
|
name: "Preset accent"
|
||||||
|
object: Config.colors.presets
|
||||||
|
setting: "accent"
|
||||||
|
shouldBeActive: Config.colors.presets.variant !== "" && FetchPresets.accents(Config.colors.presets.name, Config.colors.presets.variant).length > 0 && !Config.general.color.schemeGeneration
|
||||||
|
stringList: FetchPresets.accents(Config.colors.presets.name, Config.colors.presets.variant)
|
||||||
|
|
||||||
|
onOptionSet: item => {
|
||||||
|
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--preset", `${Config.colors.presets.name.toLowerCase()}:${Config.colors.presets.variant}`, "--accent", `${item}`]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Separator {
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 1 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSwitch {
|
SettingSwitch {
|
||||||
name: "Smart color scheme"
|
name: "Smart color scheme"
|
||||||
object: Config.general.color
|
object: Config.general.color
|
||||||
setting: "smart"
|
setting: "smart"
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 1 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 1 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingSpinner {
|
SettingSpinner {
|
||||||
name: "Schedule dark mode"
|
name: "Schedule dark mode"
|
||||||
object: Config.general.color
|
object: Config.general.color
|
||||||
settings: ["scheduleDarkStart", "scheduleDarkEnd", "scheduleDark"]
|
settings: ["scheduleDarkStart", "scheduleDarkEnd", "scheduleDark"]
|
||||||
|
shouldBeActive: Config.general.color.schemeGeneration ? 1 : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator {
|
Separator {
|
||||||
|
|||||||
@@ -0,0 +1,161 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import qs.Config
|
||||||
|
import qs.Components
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property string name
|
||||||
|
required property var object
|
||||||
|
property alias row: row
|
||||||
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
required property list<var> stringList
|
||||||
|
|
||||||
|
signal optionSet(option: string)
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.height : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: row
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: Appearance.padding.small
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
id: text
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.pointSize: Appearance.font.size.larger
|
||||||
|
text: root.name
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomClippingRect {
|
||||||
|
Layout.preferredHeight: 42 * 6 + Appearance.padding.normal * 2 + Appearance.spacing.small * 5
|
||||||
|
Layout.preferredWidth: 500
|
||||||
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
|
radius: (21 + Appearance.padding.normal) * Appearance.rounding.scale
|
||||||
|
|
||||||
|
CustomRect {
|
||||||
|
id: searchBox
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: Appearance.padding.normal
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
|
implicitHeight: 42
|
||||||
|
radius: Appearance.rounding.full
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
id: searchIcon
|
||||||
|
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Appearance.padding.large
|
||||||
|
anchors.top: parent.top
|
||||||
|
font.pointSize: Appearance.font.size.large
|
||||||
|
text: "search"
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomTextField {
|
||||||
|
id: textSearch
|
||||||
|
|
||||||
|
anchors.left: searchIcon.right
|
||||||
|
anchors.leftMargin: Appearance.spacing.small
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Appearance.spacing.normal
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
placeholderText: "Search..."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomClippingRect {
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.margins: Appearance.padding.normal
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: searchBox.bottom
|
||||||
|
bottomLeftRadius: 21
|
||||||
|
bottomRightRadius: 21
|
||||||
|
|
||||||
|
CustomListView {
|
||||||
|
anchors.fill: parent
|
||||||
|
clip: true
|
||||||
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
|
delegate: CustomRect {
|
||||||
|
id: delegate
|
||||||
|
|
||||||
|
required property string modelData
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
implicitHeight: 42
|
||||||
|
radius: Appearance.rounding.smallest
|
||||||
|
|
||||||
|
CustomText {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: Appearance.padding.normal
|
||||||
|
text: modelData
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialIcon {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: Appearance.padding.normal
|
||||||
|
color: DynamicColors.palette.m3primary
|
||||||
|
font.pointSize: Appearance.font.size.large
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
text: "check_circle"
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
visible: root.object[root.setting] === delegate.modelData
|
||||||
|
}
|
||||||
|
|
||||||
|
StateLayer {
|
||||||
|
onClicked: {
|
||||||
|
root.object[root.setting] = delegate.modelData;
|
||||||
|
root.optionSet(delegate.modelData);
|
||||||
|
Config.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model: ScriptModel {
|
||||||
|
values: {
|
||||||
|
const values = root.stringList;
|
||||||
|
const search = textSearch.text;
|
||||||
|
var regex = new RegExp(search, "i");
|
||||||
|
|
||||||
|
return values.filter(n => regex.test(n));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,26 @@ import qs.Config
|
|||||||
CustomRect {
|
CustomRect {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
Layout.fillWidth: true
|
property bool shouldBeActive: true
|
||||||
Layout.preferredHeight: 1
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
color: DynamicColors.tPalette.m3outlineVariant
|
color: DynamicColors.tPalette.m3outlineVariant
|
||||||
|
implicitHeight: shouldBeActive ? 1 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ ColumnLayout {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
function addAction() {
|
function addAction() {
|
||||||
const list = [...root.object[root.setting]];
|
const list = [...root.object[root.setting]];
|
||||||
@@ -44,8 +45,26 @@ ColumnLayout {
|
|||||||
Config.save();
|
Config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: shouldBeActive ? implicitHeight : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ ColumnLayout {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
function addAlias() {
|
function addAlias() {
|
||||||
const list = [...root.object[root.setting]];
|
const list = [...root.object[root.setting]];
|
||||||
@@ -40,8 +41,26 @@ ColumnLayout {
|
|||||||
Config.save();
|
Config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: shouldBeActive ? implicitHeight : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Item {
|
|||||||
required property var object
|
required property var object
|
||||||
property var pendingCommitEntries: []
|
property var pendingCommitEntries: []
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
property int uidCounter: 0
|
property int uidCounter: 0
|
||||||
property var visualEntries: []
|
property var visualEntries: []
|
||||||
|
|
||||||
@@ -146,8 +147,25 @@ Item {
|
|||||||
Config.save();
|
Config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
implicitHeight: layout.implicitHeight
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? layout.implicitHeight : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: root.rebuildVisualEntries()
|
Component.onCompleted: root.rebuildVisualEntries()
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property list<string> settings
|
required property list<string> settings
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
function commitChoice(choice: int, setting: string): void {
|
function commitChoice(choice: int, setting: string): void {
|
||||||
root.object[setting] = choice;
|
root.object[setting] = choice;
|
||||||
@@ -32,8 +33,25 @@ Item {
|
|||||||
return Qt.formatTime(d, "h AP");
|
return Qt.formatTime(d, "h AP");
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
function formattedValue(): string {
|
function formattedValue(): string {
|
||||||
const value = root.object[root.setting];
|
const value = root.object[root.setting];
|
||||||
@@ -21,8 +22,25 @@ Item {
|
|||||||
return String(value);
|
return String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -8,13 +8,31 @@ Item {
|
|||||||
|
|
||||||
required property int index
|
required property int index
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
signal addActiveActionRequested
|
signal addActiveActionRequested
|
||||||
signal deleteRequested(int index)
|
signal deleteRequested(int index)
|
||||||
signal fieldEdited(string key, var value)
|
signal fieldEdited(string key, var value)
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CustomRect {
|
CustomRect {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -11,10 +11,32 @@ Item {
|
|||||||
|
|
||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
|
property alias row: row
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
required property list<var> stringList
|
||||||
|
|
||||||
Layout.fillWidth: true
|
signal optionSet
|
||||||
Layout.preferredHeight: row.height
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.height : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: row
|
id: row
|
||||||
@@ -120,17 +142,18 @@ Item {
|
|||||||
StateLayer {
|
StateLayer {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.object[root.setting] = fontDelegate.modelData;
|
root.object[root.setting] = fontDelegate.modelData;
|
||||||
|
root.optionSet();
|
||||||
Config.save();
|
Config.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: {
|
values: {
|
||||||
const fonts = Qt.fontFamilies();
|
const values = root.stringList;
|
||||||
const search = fontSearch.text;
|
const search = fontSearch.text;
|
||||||
var regex = new RegExp(search, "i");
|
var regex = new RegExp(search, "i");
|
||||||
|
|
||||||
return fonts.filter(n => regex.test(n));
|
return values.filter(n => regex.test(n));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,28 @@ Item {
|
|||||||
|
|
||||||
readonly property bool highlighted: SettingsHighlight.highlightedSetting === name
|
readonly property bool highlighted: SettingsHighlight.highlightedSetting === name
|
||||||
required property string name
|
required property string name
|
||||||
|
property bool shouldBeActive: true
|
||||||
required property string value
|
required property string value
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -13,10 +13,28 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
property real step: 1
|
property real step: 1
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property list<string> settings
|
required property list<string> settings
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
function commitChoice(choice: int, setting: string): void {
|
function commitChoice(choice: int, setting: string): void {
|
||||||
root.object[setting] = choice;
|
root.object[setting] = choice;
|
||||||
@@ -32,8 +33,25 @@ Item {
|
|||||||
return Qt.formatTime(d, "h AP");
|
return Qt.formatTime(d, "h AP");
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -12,9 +12,27 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: layout.implicitHeight
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? layout.implicitHeight : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -46,6 +64,9 @@ Item {
|
|||||||
StringListEditor {
|
StringListEditor {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
addLabel: root.addLabel
|
addLabel: root.addLabel
|
||||||
|
anchors.left: undefined
|
||||||
|
anchors.right: undefined
|
||||||
|
anchors.verticalCenter: undefined
|
||||||
values: [...(root.object[root.setting] ?? [])]
|
values: [...(root.object[root.setting] ?? [])]
|
||||||
|
|
||||||
onListEdited: function (values) {
|
onListEdited: function (values) {
|
||||||
|
|||||||
@@ -11,9 +11,27 @@ Item {
|
|||||||
required property string name
|
required property string name
|
||||||
required property var object
|
required property var object
|
||||||
required property string setting
|
required property string setting
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? row.implicitHeight + Appearance.padding.smaller * 2 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -7,9 +7,13 @@ CustomRect {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property string name
|
required property string name
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
Layout.preferredHeight: 60
|
implicitHeight: 60
|
||||||
Layout.preferredWidth: 200
|
implicitWidth: 200
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -60,12 +60,18 @@ CustomClippingRect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
Column {
|
||||||
id: clayout
|
id: clayout
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
|
// move: Transition {
|
||||||
|
// Anim {
|
||||||
|
// properties: "y"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,39 @@ CustomRect {
|
|||||||
property real contentPadding: Appearance.padding.large
|
property real contentPadding: Appearance.padding.large
|
||||||
property string sectionId: ""
|
property string sectionId: ""
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: layout.implicitHeight + contentPadding * 2
|
anchors.right: parent.right
|
||||||
color: DynamicColors.tPalette.m3surfaceContainer
|
color: DynamicColors.tPalette.m3surfaceContainer
|
||||||
|
implicitHeight: layout.height + contentPadding * 2
|
||||||
radius: Appearance.rounding.normal - Appearance.padding.smaller
|
radius: Appearance.rounding.normal - Appearance.padding.smaller
|
||||||
|
|
||||||
ColumnLayout {
|
Behavior on implicitHeight {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.margins: root.contentPadding
|
anchors.margins: root.contentPadding
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.top: parent.top
|
||||||
|
// anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Appearance.spacing.normal
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
|
Behavior on height {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
move: Transition {
|
||||||
|
Anim {
|
||||||
|
properties: "y"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,12 +12,29 @@ CustomRect {
|
|||||||
property alias expanded: menu.expanded
|
property alias expanded: menu.expanded
|
||||||
property alias label: label
|
property alias label: label
|
||||||
property alias menu: menu
|
property alias menu: menu
|
||||||
|
property bool shouldBeActive: true
|
||||||
property alias text: label.text
|
property alias text: label.text
|
||||||
|
|
||||||
color: enabled ? DynamicColors.palette.m3primary : DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHigh, 2)
|
color: enabled ? DynamicColors.palette.m3primary : DynamicColors.layer(DynamicColors.palette.m3surfaceContainerHigh, 2)
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
z: expanded ? 100 : 0
|
z: expanded ? 100 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
id: label
|
id: label
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ ColumnLayout {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string addLabel: qsTr("Add entry")
|
property string addLabel: qsTr("Add entry")
|
||||||
|
property bool shouldBeActive: true
|
||||||
property var values: []
|
property var values: []
|
||||||
|
|
||||||
signal listEdited(var values)
|
signal listEdited(var values)
|
||||||
@@ -31,8 +32,26 @@ ColumnLayout {
|
|||||||
root.listEdited(list);
|
root.listEdited(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: shouldBeActive ? implicitHeight : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
spacing: Appearance.spacing.smaller
|
spacing: Appearance.spacing.smaller
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [...root.values]
|
model: [...root.values]
|
||||||
|
|||||||
@@ -13,11 +13,29 @@ Item {
|
|||||||
id: wrapper
|
id: wrapper
|
||||||
|
|
||||||
property bool changesMade: false
|
property bool changesMade: false
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
signal requestCrop
|
signal requestCrop
|
||||||
|
|
||||||
Layout.fillWidth: true
|
anchors.left: parent.left
|
||||||
Layout.preferredHeight: 400
|
anchors.right: parent.right
|
||||||
|
implicitHeight: shouldBeActive ? 400 : 0
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IconButton {
|
IconButton {
|
||||||
anchors.margins: Appearance.padding.normal
|
anchors.margins: Appearance.padding.normal
|
||||||
|
|||||||
@@ -12,13 +12,19 @@ GridView {
|
|||||||
|
|
||||||
readonly property int columnsCount: Math.max(1, Math.floor(width / minCellWidth))
|
readonly property int columnsCount: Math.max(1, Math.floor(width / minCellWidth))
|
||||||
readonly property int minCellWidth: 200 + Appearance.spacing.normal
|
readonly property int minCellWidth: 200 + Appearance.spacing.normal
|
||||||
|
property bool shouldBeActive: true
|
||||||
|
|
||||||
Layout.preferredHeight: contentHeight
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
cellHeight: 140 + Appearance.spacing.normal
|
cellHeight: 140 + Appearance.spacing.normal
|
||||||
cellWidth: width / columnsCount
|
cellWidth: width / columnsCount
|
||||||
clip: true
|
clip: true
|
||||||
|
implicitHeight: shouldBeActive ? contentHeight : 0
|
||||||
interactive: false
|
interactive: false
|
||||||
model: Wallpapers.list
|
model: Wallpapers.list
|
||||||
|
opacity: shouldBeActive ? 1 : 0
|
||||||
|
scale: shouldBeActive ? 1 : 0.8
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
required property int index
|
required property int index
|
||||||
@@ -137,4 +143,16 @@ GridView {
|
|||||||
radius: itemRadius
|
radius: itemRadius
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Behavior on opacity {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on scale {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on y {
|
||||||
|
Anim {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user