Merge settings window to main #23

Merged
Zacharias-Brohn merged 48 commits from settingsWindow into main 2026-03-18 16:27:50 +01:00
6 changed files with 97 additions and 18 deletions
Showing only changes of commit 8bc7826f26 - Show all commits
+1 -1
View File
@@ -7,7 +7,7 @@ ShapePath {
id: root id: root
readonly property bool flatten: wrapper.height < rounding * 2 readonly property bool flatten: wrapper.height < rounding * 2
readonly property real rounding: 8 readonly property real rounding: Appearance.rounding.large
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
required property Wrapper wrapper required property Wrapper wrapper
+2 -2
View File
@@ -86,10 +86,10 @@ Item {
} }
} }
CustomRect { CustomClippingRect {
anchors.fill: parent anchors.fill: parent
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: 4 radius: Appearance.rounding.normal
CustomListView { CustomListView {
id: clayout id: clayout
+4 -3
View File
@@ -20,10 +20,11 @@ CustomFlickable {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
CustomRect { CustomClippingRect {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: colorLayout.implicitHeight + Appearance.padding.normal * 2 Layout.preferredHeight: colorLayout.implicitHeight + Appearance.padding.normal * 2
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: Appearance.rounding.normal - Appearance.padding.smaller
ColumnLayout { ColumnLayout {
id: colorLayout id: colorLayout
@@ -106,10 +107,11 @@ CustomFlickable {
} }
} }
CustomRect { CustomClippingRect {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: idleLayout.implicitHeight + Appearance.padding.normal * 2 Layout.preferredHeight: idleLayout.implicitHeight + Appearance.padding.normal * 2
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: Appearance.rounding.normal - Appearance.padding.smaller
Idle { Idle {
id: idleLayout id: idleLayout
@@ -129,7 +131,6 @@ CustomFlickable {
Layout.preferredHeight: 60 Layout.preferredHeight: 60
Layout.preferredWidth: 200 Layout.preferredWidth: 200
radius: 4
CustomText { CustomText {
id: text id: text
@@ -1,3 +1,5 @@
pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import qs.Components import qs.Components
@@ -35,7 +37,7 @@ ColumnLayout {
spacing: Appearance.spacing.smaller spacing: Appearance.spacing.smaller
Repeater { Repeater {
model: Config.general.idle.timeouts model: [...Config.general.idle.timeouts]
SettingList { SettingList {
Layout.fillWidth: true Layout.fillWidth: true
@@ -49,8 +51,9 @@ ColumnLayout {
} }
} }
CustomButton { IconButton {
text: qsTr("Add timeout entry") font.pointSize: Appearance.font.size.large
icon: "add"
onClicked: root.addTimeoutEntry() onClicked: root.addTimeoutEntry()
} }
+5 -5
View File
@@ -12,8 +12,8 @@ Item {
id: root id: root
property string currentCategory: "general" property string currentCategory: "general"
readonly property real nonAnimHeight: (screen.height - 400) + viewWrapper.anchors.margins * 2 readonly property real nonAnimHeight: Math.floor(screen.height / 1.5) + viewWrapper.anchors.margins * 2
readonly property real nonAnimWidth: view.implicitWidth + (screen.width - 400 * 2) + viewWrapper.anchors.margins * 2 readonly property real nonAnimWidth: view.implicitWidth + Math.floor(screen.width / 2) + viewWrapper.anchors.margins * 2
required property ShellScreen screen required property ShellScreen screen
required property PersistentProperties visibilities required property PersistentProperties visibilities
@@ -35,12 +35,12 @@ Item {
target: root target: root
} }
ClippingRectangle { CustomClippingRect {
id: viewWrapper id: viewWrapper
anchors.fill: parent anchors.fill: parent
anchors.margins: Appearance.padding.smaller anchors.margins: Appearance.padding.smaller
color: "transparent" radius: Appearance.rounding.large - Appearance.padding.smaller
Item { Item {
id: view id: view
@@ -68,7 +68,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: 4 radius: Appearance.rounding.normal
StackView { StackView {
id: stack id: stack
+77 -2
View File
@@ -34,11 +34,86 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: Appearance.spacing.large spacing: Appearance.spacing.large
CustomText { Item {
Layout.alignment: Qt.AlignLeft id: nameCell
property string draftName: ""
property bool editing: false
function beginEdit() {
draftName = root.modelData.name ?? "";
editing = true;
nameEditor.forceActiveFocus();
}
function cancelEdit() {
draftName = root.modelData.name ?? "";
editing = false;
}
function commitEdit() {
editing = false;
if (draftName !== (root.modelData.name ?? "")) {
root.fieldEdited("name", draftName);
}
}
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillHeight: true
Layout.preferredWidth: root.width / 2 Layout.preferredWidth: root.width / 2
HoverHandler {
id: nameHover
}
CustomText {
anchors.left: parent.left
anchors.right: editButton.left
anchors.rightMargin: Appearance.spacing.small
anchors.verticalCenter: parent.verticalCenter
elide: Text.ElideRight // enable if CustomText supports it
font.pointSize: Appearance.font.size.larger font.pointSize: Appearance.font.size.larger
text: root.modelData.name text: root.modelData.name
visible: !nameCell.editing
}
IconButton {
id: editButton
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
font.pointSize: Appearance.font.size.large
icon: "edit"
visible: nameHover.hovered && !nameCell.editing
onClicked: nameCell.beginEdit()
}
CustomRect {
anchors.fill: parent
color: DynamicColors.tPalette.m3surface
radius: Appearance.rounding.small
visible: nameCell.editing
CustomTextField {
id: nameEditor
anchors.fill: parent
text: nameCell.draftName
Keys.onEscapePressed: {
nameCell.cancelEdit();
}
onEditingFinished: {
nameCell.commitEdit();
}
onTextEdited: {
nameCell.draftName = nameEditor.text;
}
}
}
} }
VSeparator { VSeparator {