Improve notification look
This commit is contained in:
@@ -119,8 +119,8 @@ QtObject {
|
|||||||
var match = String(raw || "").match(/\$activeBorderColor\s*=\s*rgba?\(([0-9A-Fa-f]{6,8})\)/)
|
var match = String(raw || "").match(/\$activeBorderColor\s*=\s*rgba?\(([0-9A-Fa-f]{6,8})\)/)
|
||||||
if (!match) { border = accent; return }
|
if (!match) { border = accent; return }
|
||||||
var hex = match[1]
|
var hex = match[1]
|
||||||
// rgba() in hyprland is AARRGGBB; strip the AA prefix and use the RGB.
|
// Hyprland rgba() is RRGGBBAA; strip the AA suffix and use RGB.
|
||||||
if (hex.length === 8) hex = hex.substring(2)
|
if (hex.length === 8) hex = hex.substring(0, 6)
|
||||||
border = "#" + hex
|
border = "#" + hex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ Item {
|
|||||||
// }
|
// }
|
||||||
// All keys optional; unset keys fall back to the live Color.* tokens.
|
// All keys optional; unset keys fall back to the live Color.* tokens.
|
||||||
readonly property string themeOverridePath: home + "/.config/omarchy/current/theme/notifications.json"
|
readonly property string themeOverridePath: home + "/.config/omarchy/current/theme/notifications.json"
|
||||||
|
readonly property string themeNamePath: home + "/.config/omarchy/current/theme.name"
|
||||||
|
|
||||||
// Corner radius is shared with omarchy-shell menu and settings panel —
|
// Corner radius is shared with omarchy-shell menu and settings panel —
|
||||||
// `omarchy style corners <sharp|round>` writes this file once and every
|
// `omarchy style corners <sharp|round>` writes this file once and every
|
||||||
@@ -84,7 +85,9 @@ Item {
|
|||||||
property string overrideText: ""
|
property string overrideText: ""
|
||||||
property string overrideCountdown: ""
|
property string overrideCountdown: ""
|
||||||
|
|
||||||
readonly property color effectiveBorder: overrideBorder.length > 0 ? overrideBorder : Color.border
|
// Match the compact mako-style layout, but keep colors live-bound to the
|
||||||
|
// current Omarchy theme unless a theme explicitly ships notifications.json.
|
||||||
|
readonly property color effectiveBorder: overrideBorder.length > 0 ? overrideBorder : Color.accent
|
||||||
readonly property color effectiveBackground: overrideBackground.length > 0 ? overrideBackground : Color.background
|
readonly property color effectiveBackground: overrideBackground.length > 0 ? overrideBackground : Color.background
|
||||||
readonly property color effectiveText: overrideText.length > 0 ? overrideText : Color.foreground
|
readonly property color effectiveText: overrideText.length > 0 ? overrideText : Color.foreground
|
||||||
readonly property color effectiveCountdown: overrideCountdown.length > 0 ? overrideCountdown : Color.accent
|
readonly property color effectiveCountdown: overrideCountdown.length > 0 ? overrideCountdown : Color.accent
|
||||||
@@ -105,6 +108,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
|
id: themeOverrideFile
|
||||||
path: service.themeOverridePath
|
path: service.themeOverridePath
|
||||||
watchChanges: true
|
watchChanges: true
|
||||||
printErrors: false
|
printErrors: false
|
||||||
@@ -113,6 +117,18 @@ Item {
|
|||||||
onFileChanged: reload()
|
onFileChanged: reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Theme switching recreates ~/.config/omarchy/current/theme, which can leave
|
||||||
|
// the notifications.json watcher attached to the old symlink target. Watch
|
||||||
|
// theme.name (overwritten in place) as the stable tripwire and force a fresh
|
||||||
|
// override reload; if the new theme has no override, onLoadFailed clears the
|
||||||
|
// old colors instead of leaving stale theme-specific notification styling.
|
||||||
|
FileView {
|
||||||
|
path: service.themeNamePath
|
||||||
|
watchChanges: true
|
||||||
|
printErrors: false
|
||||||
|
onFileChanged: themeOverrideFile.reload()
|
||||||
|
}
|
||||||
|
|
||||||
// Fired by IPC (`omarchy-shell-ipc notifications showHistory`) so the
|
// Fired by IPC (`omarchy-shell-ipc notifications showHistory`) so the
|
||||||
// bar widget can drop its PopupCard from the same anchor a click would.
|
// bar widget can drop its PopupCard from the same anchor a click would.
|
||||||
signal historyOpenRequested()
|
signal historyOpenRequested()
|
||||||
|
|||||||
+3
-3
@@ -90,7 +90,7 @@ Rectangle {
|
|||||||
// Add 2 * border.width so mainColumn (inset by border.width on top/left/right)
|
// Add 2 * border.width so mainColumn (inset by border.width on top/left/right)
|
||||||
// doesn't push content under the bottom edge. The bottom edge is also inset
|
// doesn't push content under the bottom edge. The bottom edge is also inset
|
||||||
// for symmetry except when the progress bar replaces it.
|
// for symmetry except when the progress bar replaces it.
|
||||||
implicitHeight: mainColumn.implicitHeight + border.width * 2 + (showProgress ? 3 : 0)
|
implicitHeight: mainColumn.implicitHeight + border.width * 2
|
||||||
radius: cornerRadius
|
radius: cornerRadius
|
||||||
color: backgroundColorOverride
|
color: backgroundColorOverride
|
||||||
border.color: urgency === 2 ? Color.urgent : borderColorOverride
|
border.color: urgency === 2 ? Color.urgent : borderColorOverride
|
||||||
@@ -174,7 +174,7 @@ Rectangle {
|
|||||||
// Hide the slot when the icon failed to resolve (themed-icon name
|
// Hide the slot when the icon failed to resolve (themed-icon name
|
||||||
// not in the user's icon theme) AND we don't have a glyph fallback
|
// not in the user's icon theme) AND we don't have a glyph fallback
|
||||||
// — prevents rendering Qt's pink broken-image placeholder.
|
// — prevents rendering Qt's pink broken-image placeholder.
|
||||||
visible: root.hasSmallIcon && (root.hasGlyph || smallIconImage.status !== Image.Error)
|
visible: false
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: smallIconImage
|
id: smallIconImage
|
||||||
@@ -244,7 +244,7 @@ Rectangle {
|
|||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
height: 3
|
height: 3
|
||||||
color: root.borderColorOverride
|
color: root.borderColorOverride
|
||||||
visible: root.showProgress
|
visible: false
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
Reference in New Issue
Block a user