diff --git a/quickshell/Modals/Settings/SettingsSidebar.qml b/quickshell/Modals/Settings/SettingsSidebar.qml index bb469ca5..08a8de23 100644 --- a/quickshell/Modals/Settings/SettingsSidebar.qml +++ b/quickshell/Modals/Settings/SettingsSidebar.qml @@ -366,6 +366,12 @@ Rectangle { "icon": "security", "collapsedByDefault": true, "children": [ + { + "id": "battery", + "text": I18n.tr("Battery"), + "icon": "battery_charging_full", + "tabIndex": 42 + }, { "id": "lock_screen", "text": I18n.tr("Lock Screen"), @@ -383,12 +389,6 @@ Rectangle { "text": I18n.tr("Power & Sleep"), "icon": "power_settings_new", "tabIndex": 21 - }, - { - "id": "battery", - "text": I18n.tr("Battery"), - "icon": "battery_charging_full", - "tabIndex": 42 } ] }, diff --git a/quickshell/Modules/Settings/DankDashTab.qml b/quickshell/Modules/Settings/DankDashTab.qml index 3818ea1c..a82ba73e 100644 --- a/quickshell/Modules/Settings/DankDashTab.qml +++ b/quickshell/Modules/Settings/DankDashTab.qml @@ -59,7 +59,7 @@ Item { } readonly property real rowHeight: 70 - readonly property real rowSpacing: Theme.spacingM + readonly property real rowSpacing: Theme.spacingS readonly property real dividerGap: 40 property var enabledOrder: [] @@ -371,202 +371,203 @@ Item { readonly property bool highlighted: root.highlightedId === modelData readonly property bool canHide: root.canHide(modelData) - width: reorderArea.width - height: root.rowHeight - z: dragging ? 100 : (highlighted ? 3 : 1) + width: reorderArea.width + height: root.rowHeight + z: dragging ? 100 : (highlighted ? 3 : 1) - Binding { - target: rowItem - property: "y" - value: root.slotYForId(rowItem.modelData) - when: !rowItem.dragging - restoreMode: Binding.RestoreNone - } - - onYChanged: { - if (dragging) - root.updateDragTarget(y + height / 2); - } - - Behavior on y { - enabled: !rowItem.dragging - NumberAnimation { - duration: Theme.expressiveDurations.expressiveDefaultSpatial - easing.type: Easing.BezierSpline - easing.bezierCurve: Theme.expressiveCurves.expressiveFastSpatial + Binding { + target: rowItem + property: "y" + value: root.slotYForId(rowItem.modelData) + when: !rowItem.dragging + restoreMode: Binding.RestoreNone } - } - Item { - id: content - anchors.fill: parent - scale: rowItem.dragging ? 1.02 : 1.0 - transformOrigin: Item.Center + onYChanged: { + if (dragging) + root.updateDragTarget(y + height / 2); + } - Behavior on scale { + Behavior on y { + enabled: !rowItem.dragging NumberAnimation { - duration: Theme.shortDuration - easing.type: Easing.OutCubic + duration: Theme.expressiveDurations.expressiveDefaultSpatial + easing.type: Easing.BezierSpline + easing.bezierCurve: Theme.expressiveCurves.expressiveFastSpatial } } - Rectangle { - id: surface + Item { + id: content anchors.fill: parent - radius: rowItem.dragging ? Theme.cornerRadius + 6 : Theme.cornerRadius - color: { - if (rowItem.dragging) - return Theme.secondaryContainer; - const base = Theme.surfaceContainer; - return Qt.rgba(base.r, base.g, base.b, rowItem.isEnabled ? 0.7 : 0.4); - } - border.width: rowItem.dragging ? 2 : 1 - border.color: rowItem.dragging ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2) + scale: rowItem.dragging ? 1.02 : 1.0 + transformOrigin: Item.Center - Behavior on radius { + Behavior on scale { NumberAnimation { duration: Theme.shortDuration easing.type: Easing.OutCubic } } - Behavior on color { - ColorAnimation { - duration: Theme.shortDuration - } - } - Behavior on border.color { - ColorAnimation { - duration: Theme.shortDuration - } - } Rectangle { + id: surface anchors.fill: parent - radius: parent.radius - color: Theme.primary - opacity: (dragArea.containsMouse && !rowItem.dragging) ? 0.06 : 0 - Behavior on opacity { + radius: rowItem.dragging ? Theme.cornerRadius + 6 : Theme.cornerRadius + color: { + if (rowItem.dragging) + return Theme.secondaryContainer; + const base = Theme.surfaceContainer; + return Qt.rgba(base.r, base.g, base.b, rowItem.isEnabled ? 0.7 : 0.4); + } + border.width: rowItem.dragging ? 2 : 1 + border.color: rowItem.dragging ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2) + + Behavior on radius { NumberAnimation { duration: Theme.shortDuration + easing.type: Easing.OutCubic } } - } - - DankIcon { - id: dragHandle - name: "drag_indicator" - size: Theme.iconSize - 4 - color: rowItem.dragging ? Theme.primary : Theme.outline - anchors.left: parent.left - anchors.leftMargin: Theme.spacingM - anchors.verticalCenter: parent.verticalCenter - opacity: rowItem.isEnabled ? ((dragArea.containsMouse || rowItem.dragging || rowItem.highlighted) ? 1.0 : 0.45) : 0 - visible: opacity > 0.01 - - Behavior on opacity { - NumberAnimation { - duration: Theme.shortDuration - } - } - } - - DankIcon { - id: tabIcon - name: rowItem.present.icon - size: Theme.iconSize - color: rowItem.isEnabled ? Theme.primary : Theme.outline - anchors.left: parent.left - anchors.leftMargin: Theme.spacingM * 2 + Theme.iconSize - 4 - anchors.verticalCenter: parent.verticalCenter - Behavior on color { ColorAnimation { duration: Theme.shortDuration } } - } - - Column { - anchors.left: tabIcon.right - anchors.leftMargin: Theme.spacingM - anchors.right: visibilityButton.left - anchors.rightMargin: Theme.spacingM - anchors.verticalCenter: parent.verticalCenter - spacing: 2 - - StyledText { - text: rowItem.present.text - font.pixelSize: Theme.fontSizeMedium - font.weight: Font.Medium - color: rowItem.isEnabled ? Theme.surfaceText : Theme.outline - elide: Text.ElideRight - width: parent.width + Behavior on border.color { + ColorAnimation { + duration: Theme.shortDuration + } } - StyledText { - text: rowItem.present.description - font.pixelSize: Theme.fontSizeSmall - color: rowItem.isEnabled ? Theme.outline : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6) - elide: Text.ElideRight - width: parent.width - visible: text.length > 0 + Rectangle { + anchors.fill: parent + radius: parent.radius + color: Theme.primary + opacity: (dragArea.containsMouse && !rowItem.dragging) ? 0.06 : 0 + Behavior on opacity { + NumberAnimation { + duration: Theme.shortDuration + } + } } - } - DankActionButton { - id: visibilityButton - anchors.right: parent.right - anchors.rightMargin: Theme.spacingS - anchors.verticalCenter: parent.verticalCenter - buttonSize: 36 - iconName: rowItem.isEnabled ? "visibility" : "visibility_off" - iconSize: 18 - iconColor: rowItem.isEnabled ? Theme.primary : Theme.outline - enabled: rowItem.canHide - onClicked: { - root.forceActiveFocus(); - root.highlightedId = rowItem.modelData; - SettingsData.setDashTabEnabled(rowItem.modelData, !rowItem.isEnabled); + DankIcon { + id: dragHandle + name: "drag_indicator" + size: Theme.iconSize - 4 + color: rowItem.dragging ? Theme.primary : Theme.outline + anchors.left: parent.left + anchors.leftMargin: Theme.spacingM + anchors.verticalCenter: parent.verticalCenter + opacity: rowItem.isEnabled ? ((dragArea.containsMouse || rowItem.dragging || rowItem.highlighted) ? 1.0 : 0.45) : 0 + visible: opacity > 0.01 + + Behavior on opacity { + NumberAnimation { + duration: Theme.shortDuration + } + } + } + + DankIcon { + id: tabIcon + name: rowItem.present.icon + size: Theme.iconSize + color: rowItem.isEnabled ? Theme.primary : Theme.outline + anchors.left: parent.left + anchors.leftMargin: Theme.spacingM * 2 + Theme.iconSize - 4 + anchors.verticalCenter: parent.verticalCenter + + Behavior on color { + ColorAnimation { + duration: Theme.shortDuration + } + } + } + + Column { + anchors.left: tabIcon.right + anchors.leftMargin: Theme.spacingM + anchors.right: visibilityButton.left + anchors.rightMargin: Theme.spacingM + anchors.verticalCenter: parent.verticalCenter + spacing: 2 + + StyledText { + text: rowItem.present.text + font.pixelSize: Theme.fontSizeMedium + font.weight: Font.Medium + color: rowItem.isEnabled ? Theme.surfaceText : Theme.outline + elide: Text.ElideRight + width: parent.width + } + + StyledText { + text: rowItem.present.description + font.pixelSize: Theme.fontSizeSmall + color: rowItem.isEnabled ? Theme.outline : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6) + elide: Text.ElideRight + width: parent.width + visible: text.length > 0 + } + } + + DankActionButton { + id: visibilityButton + anchors.right: parent.right + anchors.rightMargin: Theme.spacingS + anchors.verticalCenter: parent.verticalCenter + buttonSize: 36 + iconName: rowItem.isEnabled ? "visibility" : "visibility_off" + iconSize: 18 + iconColor: rowItem.isEnabled ? Theme.primary : Theme.outline + enabled: rowItem.canHide + onClicked: { + root.forceActiveFocus(); + root.highlightedId = rowItem.modelData; + SettingsData.setDashTabEnabled(rowItem.modelData, !rowItem.isEnabled); + } } } } - } - Rectangle { - anchors.fill: parent - anchors.margins: -2 - radius: Theme.cornerRadius + 2 - color: "transparent" - border.width: 2 - border.color: Theme.primary - opacity: rowItem.highlighted && !rowItem.dragging ? 0.6 : 0 - visible: opacity > 0.01 + Rectangle { + anchors.fill: parent + anchors.margins: -2 + radius: Theme.cornerRadius + 2 + color: "transparent" + border.width: 2 + border.color: Theme.primary + opacity: rowItem.highlighted && !rowItem.dragging ? 0.6 : 0 + visible: opacity > 0.01 - Behavior on opacity { - NumberAnimation { - duration: Theme.shortDuration + Behavior on opacity { + NumberAnimation { + duration: Theme.shortDuration + } } } - } - MouseArea { - id: dragArea - anchors.fill: parent - anchors.rightMargin: 48 - hoverEnabled: true - enabled: rowItem.isEnabled - cursorShape: rowItem.dragging ? Qt.ClosedHandCursor : Qt.OpenHandCursor - drag.target: rowItem - drag.axis: Drag.YAxis - drag.minimumY: -rowItem.height - drag.maximumY: reorderArea.height - drag.smoothed: false - onPressed: { - root.forceActiveFocus(); - root.highlightedId = rowItem.modelData; - root.beginDrag(rowItem.modelData); + MouseArea { + id: dragArea + anchors.fill: parent + anchors.rightMargin: 48 + hoverEnabled: true + enabled: rowItem.isEnabled + cursorShape: rowItem.dragging ? Qt.ClosedHandCursor : Qt.OpenHandCursor + drag.target: rowItem + drag.axis: Drag.YAxis + drag.minimumY: -rowItem.height + drag.maximumY: reorderArea.height + drag.smoothed: false + onPressed: { + root.forceActiveFocus(); + root.highlightedId = rowItem.modelData; + root.beginDrag(rowItem.modelData); + } + onReleased: root.endDrag() } - onReleased: root.endDrag() } } } @@ -574,4 +575,3 @@ Item { } } } -} diff --git a/quickshell/translations/settings_search_index.json b/quickshell/translations/settings_search_index.json index 6e06b0e5..4cd501ff 100644 --- a/quickshell/translations/settings_search_index.json +++ b/quickshell/translations/settings_search_index.json @@ -4610,6 +4610,21 @@ "yubikey" ] }, + { + "section": "_tab_11", + "label": "Lock Screen", + "tabIndex": 11, + "category": "Lock Screen", + "keywords": [ + "lock", + "lockscreen", + "login", + "password", + "screen", + "security" + ], + "icon": "lock" + }, { "section": "lockDisplay", "label": "Lock Screen Display", @@ -4747,27 +4762,6 @@ ], "description": "Control what notification information is shown on the lock screen" }, - { - "section": "_tab_11", - "label": "Power & Security", - "tabIndex": 11, - "category": "Lock Screen", - "keywords": [ - "hibernate", - "lock", - "login", - "password", - "power", - "reboot", - "restart", - "screen", - "security", - "shutdown", - "sleep", - "suspend" - ], - "icon": "security" - }, { "section": "lockScreenPowerOffMonitorsOnLock", "label": "Power off monitors on lock", @@ -5584,6 +5578,22 @@ ], "description": "Play sound when volume is adjusted" }, + { + "section": "_tab_16", + "label": "Media Player", + "tabIndex": 16, + "category": "Media Player", + "keywords": [ + "audio", + "media", + "mpris", + "music", + "playback", + "player", + "spotify" + ], + "icon": "music_note" + }, { "section": "mediaPlayer", "label": "Media Player Settings", @@ -5629,28 +5639,6 @@ ], "description": "Scroll wheel behavior on media widget" }, - { - "section": "_tab_16", - "label": "Widgets & Notifications", - "tabIndex": 16, - "category": "Media Player", - "keywords": [ - "alert", - "alerts", - "components", - "media", - "modules", - "mpris", - "music", - "notif", - "notifications", - "notifs", - "player", - "spotify", - "widgets" - ], - "icon": "dashboard" - }, { "section": "notificationBodyFontSize", "label": "Body Font Size", @@ -9113,27 +9101,39 @@ }, { "section": "_tab_42", - "label": "Battery", + "label": "Power & Security", "tabIndex": 42, "category": "Settings", "keywords": [ - "battery", - "charge", - "charging", + "hibernate", "power", - "settings" + "reboot", + "restart", + "security", + "settings", + "shutdown", + "sleep", + "suspend" ], - "icon": "battery_charging_full" + "icon": "security" }, { "section": "_tab_43", - "label": "Dank Dash", + "label": "Widgets & Notifications", "tabIndex": 43, "category": "Dank Dash", "keywords": [ + "alert", + "alerts", + "components", "dank", - "dash" + "dash", + "modules", + "notif", + "notifications", + "notifs", + "widgets" ], - "icon": "space_dashboard" + "icon": "dashboard" } ]