settings: adjust window rules and clock options

This commit is contained in:
bbedward committed 2026-09-23 09:42:28 -04:00
1 parent 9d1884fb19
commit 4bdfcfc0cf
7 files changed
+88 -30

No files matched your search

Generated
+3 -3
View File
@@ -3,11 +3,11 @@
"dank-qml-common": {
"flake": false,
"locked": {
"lastModified": 1790108367,
"narHash": "sha256-eQv3ahrgVH6OAS8o9SGxFACNxMVOwHfRm8KGdJDWa4Y=",
"lastModified": 1790170755,
"narHash": "sha256-2KAqICiM0ftXh77+6BPO4wpXmv4BMhD5DAtC1zh5mt0=",
"owner": "AvengeMedia",
"repo": "dank-qml-common",
"rev": "928cc746e57e4e2a06a5ee40fe137e425fcd8cfe",
"rev": "12e45e5d6f9deac6893d0538ad2c2a0344b584c3",
"type": "github"
},
"original": {
@@ -60,7 +60,8 @@ var DEFAULTS = {
},
clock: {
clockCompactMode: false,
clockDateOrder: "timeFirst"
clockDateOrder: "timeFirst",
clockNotificationBadge: false
},
music: {
mediaSize: 1,
+24 -11
View File
@@ -536,6 +536,25 @@ DankFloatingWindow {
}
}
component TriCheckboxRow: DankButton {
property string label: ""
property int triState: 0
readonly property bool forcedOff: triState === 2
text: forcedOff ? label + ": " + I18n.tr("Off") : label
maximumWidth: parent.width
wrapText: true
iconName: triState === 1 ? "check_box" : forcedOff ? "disabled_by_default" : "check_box_outline_blank"
backgroundColor: triState === 0 ? "transparent" : forcedOff ? Theme.errorContainer : Theme.secondaryContainer
textColor: triState === 0 ? Theme.onSurface : forcedOff ? Theme.onErrorContainer : Theme.onSecondaryContainer
shape: triState === 0 ? "square" : "round"
checkable: true
checked: triState !== 0
Accessible.role: Accessible.CheckBox
Accessible.checked: triState === 1
onClicked: triState = (triState + 1) % 3
}
component MatchCond: StyledButton {
id: mc
property string label: ""
@@ -830,21 +849,15 @@ DankFloatingWindow {
title: I18n.tr("Window Opening")
}
Flow {
width: parent.width
spacing: Theme.spacingS
visible: isNiri
MatchCond {
id: floatingCond
label: I18n.tr("Float")
}
}
Flow {
width: parent.width
spacing: Theme.spacingL
TriCheckboxRow {
id: floatingCond
label: I18n.tr("Float")
visible: isNiri
}
CheckboxRow {
id: floatingToggle
label: I18n.tr("Float")
+40 -13
View File
@@ -10,32 +10,59 @@ BasePill {
property var widgetData: null
property var surfaceContext: null
property bool compactMode: false
readonly property bool showNotificationBadge: SettingsData.widgetOption("clock", widgetData, "clockNotificationBadge")
readonly property int notificationCount: surfaceContext?.notificationCount ?? 0
signal clockClicked
onClicked: clockClicked()
content: Component {
Item {
implicitWidth: root.isVerticalOrientation ? root.contentThickness : clock.implicitWidth
implicitHeight: root.isVerticalOrientation ? clock.implicitHeight : root.contentThickness
implicitWidth: root.isVerticalOrientation ? root.contentThickness : layout.implicitWidth
implicitHeight: root.isVerticalOrientation ? layout.implicitHeight : root.contentThickness
Binding {
target: root
property: "splitOffset"
value: clock.split ? root.horizontalPadding + clock.splitOffset : 0
value: clock.split ? root.horizontalPadding + layout.x + clock.x + clock.splitOffset : 0
}
ClockContent {
id: clock
Grid {
id: layout
anchors.centerIn: parent
vertical: root.isVerticalOrientation
segmented: root.surfaceContext?.kind !== "dock" && BarMetrics.widgetStyle(root.barConfig) === "segments" && !root.noBackground
displayMode: SettingsData.widgetOption("clock", root.widgetData, "clockCompactMode") ? "time" : "both"
dateFirst: root.widgetData?.clockDateOrder === "dateFirst"
fontSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
availableWidth: root.widgetThickness
textColor: root.contentColor
dateColor: vertical ? Theme.primary : root.contentColor
columns: root.isVerticalOrientation ? 1 : Math.max(1, layout.visibleChildren.length)
spacing: root.isVerticalOrientation ? Theme.spacingXXS : Theme.spacingXS
horizontalItemAlignment: Grid.AlignHCenter
verticalItemAlignment: Grid.AlignVCenter
ClockContent {
id: clock
vertical: root.isVerticalOrientation
segmented: root.surfaceContext?.kind !== "dock" && BarMetrics.widgetStyle(root.barConfig) === "segments" && !root.noBackground
displayMode: SettingsData.widgetOption("clock", root.widgetData, "clockCompactMode") ? "time" : "both"
dateFirst: root.widgetData?.clockDateOrder === "dateFirst"
fontSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
availableWidth: root.widgetThickness
textColor: root.contentColor
dateColor: vertical ? Theme.primary : root.contentColor
}
Rectangle {
visible: root.showNotificationBadge && root.notificationCount > 0
width: Math.max(height, badgeText.implicitWidth + Theme.spacingXS * 2)
height: badgeText.implicitHeight + Theme.spacingXXS * 2
radius: Theme.fullRadius(width, height)
color: Theme.error
StyledText {
id: badgeText
anchors.centerIn: parent
text: root.notificationCount
font.pixelSize: Math.round(clock.fontSize * 0.75)
font.weight: Theme.fontWeightMedium
color: Theme.onError
}
}
}
}
}
@@ -25,6 +25,7 @@ Column {
resetStore: root.page
resetKeys: ["clockDateOrder"]
text: I18n.tr("Order", "noun, clock widget option for time and date order")
enabled: !root.page.value("clockCompactMode")
model: [I18n.tr("Time first"), I18n.tr("Date first")]
currentIndex: root.page.value("clockDateOrder") === "dateFirst" ? 1 : 0
onSelectionChanged: (index, selected) => {
@@ -34,6 +35,14 @@ Column {
}
}
SettingsToggleRow {
resetStore: root.page
resetKeys: ["clockNotificationBadge"]
text: I18n.tr("Notification badge", "clock widget option: unread notification count next to the time")
checked: root.page.value("clockNotificationBadge")
onToggled: checked => root.page.set("clockNotificationBadge", checked)
}
SettingsNavRow {
iconName: "schedule"
title: I18n.tr("Time & weather")
@@ -9460,6 +9460,14 @@
"runtimeType": "barWidgetOption",
"optionFile": "KeyboardLayoutOptions.qml"
},
{
"section": "barWidgetOption:ClockOptions.qml:3",
"label": "Notification badge",
"tabIndex": 22,
"keywords": [],
"runtimeType": "barWidgetOption",
"optionFile": "ClockOptions.qml"
},
{
"section": "barWidgetOption:BatteryOptions.qml:2",
"label": "Only on battery",
@@ -9701,7 +9709,7 @@
"optionFile": "WorkspaceSwitcherOptions.qml"
},
{
"section": "barWidgetOption:ClockOptions.qml:3",
"section": "barWidgetOption:ClockOptions.qml:4",
"label": "Time & weather",
"tabIndex": 22,
"keywords": [],