settings
This commit is contained in:
@@ -5,7 +5,6 @@ import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Modules as Modules
|
||||
import qs.Modules.Settings.Controls
|
||||
import qs.Modules.Settings.Categories.Appearance
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
@@ -14,13 +13,33 @@ CustomFlickable {
|
||||
|
||||
contentHeight: clayout.implicitHeight
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onTapped: function (eventPoint) {
|
||||
const menu = SettingsDropdowns.activeMenu;
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
const p = eventPoint.scenePosition;
|
||||
|
||||
if (SettingsDropdowns.hit(SettingsDropdowns.activeTrigger, p))
|
||||
return;
|
||||
|
||||
if (SettingsDropdowns.hit(menu, p))
|
||||
return;
|
||||
|
||||
SettingsDropdowns.closeActive();
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: clayout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
CustomClippingRect {
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: colorLayout.implicitHeight + Appearance.padding.normal * 2
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
@@ -33,6 +52,7 @@ CustomFlickable {
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Appearance.spacing.normal
|
||||
|
||||
Settings {
|
||||
name: "Color"
|
||||
@@ -56,19 +76,11 @@ CustomFlickable {
|
||||
Separator {
|
||||
}
|
||||
|
||||
SettingInput {
|
||||
name: "Schedule dark mode start"
|
||||
SettingSpinner {
|
||||
name: "Schedule dark mode"
|
||||
object: Config.general.color
|
||||
setting: "scheduleDarkStart"
|
||||
}
|
||||
|
||||
Separator {
|
||||
}
|
||||
|
||||
SettingInput {
|
||||
name: "Schedule dark mode end"
|
||||
object: Config.general.color
|
||||
setting: "scheduleDarkEnd"
|
||||
settings: ["scheduleDarkStart", "scheduleDarkEnd"]
|
||||
z: 2
|
||||
}
|
||||
|
||||
Separator {
|
||||
@@ -106,22 +118,6 @@ CustomFlickable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CustomClippingRect {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: idleLayout.implicitHeight + Appearance.padding.normal * 2
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
radius: Appearance.rounding.normal - Appearance.padding.smaller
|
||||
|
||||
Idle {
|
||||
id: idleLayout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Settings: CustomRect {
|
||||
@@ -135,9 +131,7 @@ CustomFlickable {
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.fill: parent
|
||||
font.bold: true
|
||||
font.pointSize: Appearance.font.size.large * 2
|
||||
text: settingsItem.name
|
||||
|
||||
@@ -14,13 +14,6 @@ CustomRect {
|
||||
id: clayout
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
Settings {
|
||||
name: "apps"
|
||||
}
|
||||
|
||||
Item {
|
||||
}
|
||||
}
|
||||
|
||||
component Settings: CustomRect {
|
||||
@@ -28,28 +21,17 @@ CustomRect {
|
||||
|
||||
required property string name
|
||||
|
||||
implicitHeight: 42
|
||||
implicitWidth: 200
|
||||
radius: 4
|
||||
Layout.preferredHeight: 60
|
||||
Layout.preferredWidth: 200
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.smaller
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Appearance.spacing.normal
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
anchors.fill: parent
|
||||
font.bold: true
|
||||
font.pointSize: Appearance.font.size.large * 2
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Modules as Modules
|
||||
import qs.Modules.Settings.Categories.Lockscreen
|
||||
import qs.Config
|
||||
import qs.Helpers
|
||||
|
||||
CustomFlickable {
|
||||
id: root
|
||||
|
||||
contentHeight: clayout.implicitHeight
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
|
||||
onTapped: function (eventPoint) {
|
||||
const menu = SettingsDropdowns.activeMenu;
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
const p = eventPoint.scenePosition;
|
||||
|
||||
if (SettingsDropdowns.hit(SettingsDropdowns.activeTrigger, p))
|
||||
return;
|
||||
|
||||
if (SettingsDropdowns.hit(menu, p))
|
||||
return;
|
||||
|
||||
SettingsDropdowns.closeActive();
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: clayout
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: idleLayout.implicitHeight + Appearance.padding.normal * 2
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
radius: Appearance.rounding.normal - Appearance.padding.smaller
|
||||
z: -1
|
||||
|
||||
Idle {
|
||||
id: idleLayout
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Settings: CustomRect {
|
||||
id: settingsItem
|
||||
|
||||
required property string name
|
||||
|
||||
Layout.preferredHeight: 60
|
||||
Layout.preferredWidth: 200
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
anchors.fill: parent
|
||||
font.bold: true
|
||||
font.pointSize: Appearance.font.size.large * 2
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
@@ -36,6 +36,10 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Appearance.spacing.smaller
|
||||
|
||||
Settings {
|
||||
name: "Idle Monitors"
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: [...Config.general.idle.timeouts]
|
||||
|
||||
@@ -57,4 +61,23 @@ ColumnLayout {
|
||||
|
||||
onClicked: root.addTimeoutEntry()
|
||||
}
|
||||
|
||||
component Settings: CustomRect {
|
||||
id: settingsItem
|
||||
|
||||
required property string name
|
||||
|
||||
Layout.preferredHeight: 60
|
||||
Layout.preferredWidth: 200
|
||||
|
||||
CustomText {
|
||||
id: text
|
||||
|
||||
anchors.fill: parent
|
||||
font.bold: true
|
||||
font.pointSize: Appearance.font.size.large * 2
|
||||
text: settingsItem.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user