This commit is contained in:
Zacharias-Brohn
2026-03-14 17:29:24 +01:00
parent 8bc7826f26
commit f7b7260780
14 changed files with 635 additions and 77 deletions
+7 -5
View File
@@ -94,11 +94,13 @@ Item {
CustomListView {
id: clayout
anchors.centerIn: parent
contentHeight: contentItem.childrenRect.height
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: Appearance.padding.smaller
anchors.top: parent.top
boundsBehavior: Flickable.StopAtBounds
contentWidth: contentItem.childrenRect.width
highlightFollowsCurrentItem: false
implicitHeight: contentItem.childrenRect.height
implicitWidth: contentItem.childrenRect.width
model: listModel
spacing: 5
@@ -109,7 +111,7 @@ Item {
color: DynamicColors.palette.m3primary
implicitHeight: clayout.currentItem?.implicitHeight ?? 0
implicitWidth: clayout.width
radius: 4
radius: Appearance.rounding.normal - Appearance.padding.smaller
y: clayout.currentItem?.y ?? 0
Behavior on y {
@@ -131,7 +133,7 @@ Item {
implicitHeight: 42
implicitWidth: 200
radius: 4
radius: Appearance.rounding.normal - Appearance.padding.smaller
RowLayout {
id: layout
+27 -33
View File
@@ -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
+9 -27
View File
@@ -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
}
}
}
@@ -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
}
}
}
+12 -5
View File
@@ -23,13 +23,14 @@ Item {
Connections {
function onCurrentCategoryChanged() {
stack.pop();
if (currentCategory === "general") {
if (currentCategory === "general")
stack.push(general);
} else if (currentCategory === "wallpaper") {
else if (currentCategory === "wallpaper")
stack.push(background);
} else if (currentCategory === "appearance") {
else if (currentCategory === "appearance")
stack.push(appearance);
}
else if (currentCategory === "lockscreen")
stack.push(lockscreen);
}
target: root
@@ -48,7 +49,6 @@ Item {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
Categories {
@@ -100,4 +100,11 @@ Item {
Cat.Appearance {
}
}
Component {
id: lockscreen
Cat.Lockscreen {
}
}
}
+11 -5
View File
@@ -229,14 +229,20 @@ Item {
anchors.right: parent.right
visible: root.modelData.activeAction === undefined
Item {
Layout.fillWidth: true
IconButton {
id: button
Layout.alignment: Qt.AlignLeft
font.pointSize: Appearance.font.size.large
icon: "add"
onClicked: console.log(button.width)
// onClicked: root.addActiveActionRequested()
}
CustomButton {
CustomText {
Layout.alignment: Qt.AlignLeft
text: qsTr("Add active action")
onClicked: root.addActiveActionRequested()
}
}
}
@@ -0,0 +1,88 @@
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Config
Item {
id: root
required property string name
required property var object
required property list<string> settings
function commitChoice(choice: int, setting: string): void {
root.object[setting] = choice;
Config.save();
}
function formattedValue(setting: string): string {
const value = root.object[setting];
console.log(value);
if (value === null || value === undefined)
return "";
return String(value);
}
function hourToAmPm(hour) {
var h = Number(hour) % 24;
var d = new Date(2000, 0, 1, h, 0, 0);
return Qt.formatTime(d, "h AP");
}
Layout.fillWidth: true
Layout.preferredHeight: row.implicitHeight + Appearance.padding.smaller * 2
RowLayout {
id: row
anchors.left: parent.left
anchors.margins: Appearance.padding.small
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
CustomText {
id: text
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
font.pointSize: Appearance.font.size.larger
text: root.name
}
CustomText {
Layout.alignment: Qt.AlignLeft
color: DynamicColors.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.normal
text: qsTr("Dark mode will turn on at %1, and turn off at %2.").arg(root.hourToAmPm(root.object[root.settings[0]])).arg(root.hourToAmPm(root.object[root.settings[1]]))
}
}
SpinnerButton {
Layout.preferredHeight: Appearance.font.size.large + Appearance.padding.smaller * 2
Layout.preferredWidth: height * 2
currentIndex: root.object[root.settings[0]]
text: root.formattedValue(root.settings[0])
menu.onItemSelected: item => {
root.commitChoice(item, root.settings[0]);
}
}
SpinnerButton {
Layout.preferredHeight: Appearance.font.size.large + Appearance.padding.smaller * 2
Layout.preferredWidth: height * 2
currentIndex: root.object[root.settings[1]]
text: root.formattedValue(root.settings[1])
menu.onItemSelected: item => {
root.commitChoice(item, root.settings[1]);
}
}
}
}
@@ -0,0 +1,42 @@
import QtQuick
import QtQuick.Layouts
import qs.Components
import qs.Helpers
import qs.Config
CustomRect {
id: root
property alias currentIndex: menu.currentIndex
property alias expanded: menu.expanded
property alias label: label
property alias menu: menu
property alias text: label.text
color: DynamicColors.palette.m3primary
radius: Appearance.rounding.full
CustomText {
id: label
anchors.centerIn: parent
color: DynamicColors.palette.m3onPrimary
font.pointSize: Appearance.font.size.large
}
StateLayer {
function onClicked(): void {
SettingsDropdowns.toggle(menu, root);
}
}
PathViewMenu {
id: menu
anchors.centerIn: parent
from: 1
implicitWidth: root.width
itemHeight: root.height
to: 24
}
}