Merge branch 'quattro' into unified-input-method-setup

This commit is contained in:
David Heinemeier Hansson committed 2026-10-09 13:19:17 +02:00
commit d040abb66f
246 files changed
+4592 -652

No files matched your search

+17 -16
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
Panel {
@@ -11,11 +12,11 @@ Panel {
ipcTarget: "omarchy.agents"
manageIpc: false
readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent
readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55)
readonly property color surface: Color.popups.background
readonly property color track: Style.selectedFillFor(foreground, Color.accent)
readonly property color surface: Commons.Color.popups.background
readonly property color track: Style.selectedFillFor(foreground, Commons.Color.accent)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
// Every subscription on one page, limits first: the question this panel
@@ -719,7 +720,7 @@ Panel {
function iconCandidatesForProvider(p, surfaceColor) {
if (!p) return []
var candidates = []
if (colorLuminance(surfaceColor || Color.background) >= 0.5)
if (colorLuminance(surfaceColor || Commons.Color.background) >= 0.5)
candidates.push(Qt.resolvedUrl("assets/" + p.providerId + "-light.svg"))
candidates.push(Qt.resolvedUrl("assets/" + p.providerId + ".svg"))
return candidates
@@ -1109,7 +1110,7 @@ Panel {
anchors.horizontalCenter: parent.horizontalCenter
textFormat: Text.PlainText
text: choice.modelData.providerName
color: choice.hasCursor ? Color.accent : root.foreground
color: choice.hasCursor ? Commons.Color.accent : root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.body
font.bold: true
@@ -1187,7 +1188,7 @@ Panel {
Text {
textFormat: Text.PlainText
text: root.addCode
color: Color.accent
color: Commons.Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.display
font.bold: true
@@ -1528,7 +1529,7 @@ Panel {
property bool hasCursor: false
implicitHeight: tileBody.implicitHeight + Style.space(20)
radius: Style.cornerRadius
color: hasCursor ? root.alpha(Color.accent, 0.14) : root.alpha(root.foreground, 0.05)
color: hasCursor ? root.alpha(Commons.Color.accent, 0.14) : root.alpha(root.foreground, 0.05)
onHasCursorChanged: if (hasCursor) root.revealItem(tile)
Row {
@@ -1540,7 +1541,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
textFormat: Text.PlainText
text: tile.glyph
color: Color.accent
color: Commons.Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.heading
}
@@ -1549,7 +1550,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
textFormat: Text.PlainText
text: tile.title
color: tile.hasCursor ? Color.accent : root.foreground
color: tile.hasCursor ? Commons.Color.accent : root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.body
font.bold: true
@@ -1583,16 +1584,16 @@ Panel {
implicitHeight: implicitWidth
radius: Style.cornerRadius
// The cursor needs more than a shade deeper to read on a tinted square.
color: root.alpha(Color.accent, hasCursor ? 0.3 : 0.12)
color: root.alpha(Commons.Color.accent, hasCursor ? 0.3 : 0.12)
border.width: hasCursor ? Math.max(1, Style.hoverBorderWidth) : 0
border.color: Color.accent
border.color: Commons.Color.accent
onHasCursorChanged: if (hasCursor) root.revealItem(heroButton)
Text {
anchors.centerIn: parent
textFormat: Text.PlainText
text: heroButton.glyph
color: Color.accent
color: Commons.Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.heading
}
@@ -1624,7 +1625,7 @@ Panel {
readonly property bool hot: linkMouse.containsMouse || picked
onPickedChanged: if (picked) root.revealItem(link)
textFormat: Text.PlainText
color: current ? Color.accent : (hot ? root.foreground : idleColor)
color: current ? Commons.Color.accent : (hot ? root.foreground : idleColor)
font.family: root.fontFamily
font.pixelSize: Style.font.caption
font.bold: current
@@ -1705,7 +1706,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
width: Math.min(implicitWidth, parent.width * 0.6)
text: head.label
color: head.picked ? Color.accent : root.foreground
color: head.picked ? Commons.Color.accent : root.foreground
font.family: root.fontFamily
font.pixelSize: Style.font.body
font.bold: head.isActive
@@ -1810,7 +1811,7 @@ Panel {
visible: head.isActive
anchors.right: parent.right
text: "ACTIVE"
color: Color.accent
color: Commons.Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.caption
font.bold: true
+34 -7
View File
@@ -5,12 +5,14 @@ import QtQuick
import QtQuick.Effects
import QtQuick.Shapes
import qs.Commons
import qs.Commons as Commons
import qs.Ui
Item {
id: root
property var shell: null
property bool suspended: false
readonly property string home: Quickshell.env("HOME")
readonly property string stateHome: home + "/.local/state"
readonly property string currentBackgroundLink: stateHome + "/omarchy/current/background"
@@ -37,11 +39,20 @@ Item {
property var sizeQueue: []
property bool finishingTransition: false
property int backgroundVersion: 0
property int reloadVersion: 0
property int revealStartedVersion: -1
property int pendingThemeVersion: -1
property string pendingColorsRaw: ""
property string pendingShellRaw: ""
property real revealProgress: 1
readonly property bool ready: {
if (isVideo(displayedBackground)) return true
if (backgrounds.instances.length === 0) return false
for (var panel of backgrounds.instances) {
if (!panel.backgroundReady) return false
}
return true
}
function isVideo(path) {
return Util.isVideoPath(path)
@@ -56,7 +67,8 @@ Item {
}
function setBackground(path, instant) {
transitionBackground("", path, path, instant, false)
if (instant) reloadVersion += 1
transitionBackground("", path, path, instant, instant)
}
function transitionBackground(fromPath, path, finalPath, instant, force) {
@@ -106,10 +118,10 @@ Item {
// pending; the latest theme payload should still apply.
if (pendingThemeVersion < 0) return
pendingThemeFallbackTimer.stop()
Color.loadColors(pendingColorsRaw)
// Color.loadShell also refreshes Style so the type scale flips with the
Commons.Color.loadColors(pendingColorsRaw)
// Commons.Color.loadShell also refreshes Style so the type scale flips with the
// background reveal instead of waiting for a separate reload path.
Color.loadShell(pendingShellRaw)
Commons.Color.loadShell(pendingShellRaw)
Style.scheduleRefresh()
pendingThemeVersion = -1
pendingColorsRaw = ""
@@ -223,6 +235,10 @@ Item {
root.setBackground(path, true)
}
function setSuspended(value: string): void {
root.suspended = value === "true"
}
function transition(fromPath: string, path: string): void {
root.transitionBackground(fromPath, path, path, false, false)
}
@@ -258,8 +274,8 @@ Item {
property: "revealProgress"
from: 0
to: 1
duration: Style.duration(420)
easing.type: Easing.InOutCubic
duration: Style.duration(840)
easing.type: Easing.OutCubic
onFinished: {
if (root.incomingBackground) {
root.displayedBackground = root.currentBackground || root.incomingBackground
@@ -272,6 +288,7 @@ Item {
Component.onCompleted: refreshBackground()
Variants {
id: backgrounds
model: Quickshell.screens
PanelWindow {
@@ -279,7 +296,7 @@ Item {
required property var modelData
screen: modelData
visible: !remapGuard.remapping
visible: !remapGuard.remapping && !root.suspended
anchors { top: true; bottom: true; left: true; right: true }
ScreenMoveRemap {
@@ -294,6 +311,13 @@ Item {
updatesEnabled: true
property bool maskReady: false
property int readyFrames: 0
readonly property bool backgroundReady: base.ready && readyFrames >= 2
FrameAnimation {
running: base.ready && panel.readyFrames < 2
onTriggered: panel.readyFrames += 1
}
// Decode the wallpaper at the size this screen can show, not the size
// it was shipped at. With PreserveAspectCrop Qt takes sourceSize as the
@@ -337,9 +361,12 @@ Item {
id: base
anchors.fill: parent
path: root.displayedBackground
version: root.reloadVersion
cached: true
constrainDecode: true
decodeSize: panel.decodeSize(root.displayedBackground)
onReadyChanged: {
panel.readyFrames = 0
if (ready && root.finishingTransition) {
root.incomingBackground = ""
root.oldBackground = ""
+14 -13
View File
@@ -5,6 +5,7 @@ import Quickshell.Wayland
import QtQuick
import QtQuick.Layouts
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "BarModel.js" as BarModel
@@ -71,18 +72,18 @@ Item {
property string fontFamily: Style.font.family
// Bound to the central Color singleton so the bar tracks shell.toml's
// [bar] section. Property names kept for the rest of this file's bindings.
property color themeForeground: Color.bar.text
property color themeContrastForeground: Color.background
property color transparentForeground: Color.bar.text
property color themeForeground: Commons.Color.bar.text
property color themeContrastForeground: Commons.Color.background
property color transparentForeground: Commons.Color.bar.text
property color foreground: themeForeground
property color barForeground: useTransparentForeground ? transparentForeground : themeForeground
property bool foregroundAnimationEnabled: true
property color background: Color.bar.background
property color urgent: Color.bar.active
property color background: Commons.Color.bar.background
property color urgent: Commons.Color.bar.active
Behavior on barForeground { enabled: root.foregroundAnimationEnabled; ColorAnimation { duration: Style.duration(420); easing.type: Easing.InOutCubic } }
Behavior on background { ColorAnimation { duration: Style.duration(420); easing.type: Easing.InOutCubic } }
Behavior on urgent { ColorAnimation { duration: Style.duration(420); easing.type: Easing.InOutCubic } }
Behavior on barForeground { enabled: root.foregroundAnimationEnabled; ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } }
Behavior on background { ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } }
Behavior on urgent { ColorAnimation { duration: Style.duration(420); easing.type: Easing.OutCubic } }
property var tooltipTarget: null
property var pendingTooltipTarget: null
property string tooltipText: ""
@@ -1342,8 +1343,8 @@ Item {
id: tooltipBubble
implicitWidth: tooltipLabel.implicitWidth + 20
implicitHeight: tooltipLabel.implicitHeight + 14
color: Color.tooltip.background
borderSpec: Border.surfaceSpec("tooltip", "border", Color.tooltip.border, 1)
color: Commons.Color.tooltip.background
borderSpec: Border.surfaceSpec("tooltip", "border", Commons.Color.tooltip.border, 1)
radius: Style.cornerRadius
Text {
@@ -1351,7 +1352,7 @@ Item {
textFormat: Text.PlainText
anchors.centerIn: parent
text: root.tooltipText
color: Color.tooltip.text
color: Commons.Color.tooltip.text
font.family: root.fontFamily
font.pixelSize: Style.font.body
horizontalAlignment: Text.AlignHCenter
@@ -1470,7 +1471,7 @@ Item {
y: targetRect ? Math.round(targetRect.y) : 0
width: targetRect ? targetRect.width : 0
height: targetRect ? targetRect.height : 0
color: Color.accent
color: Commons.Color.accent
radius: Math.min(width, height) / 2
}
}
@@ -1905,7 +1906,7 @@ Item {
visible: opacity > 0
opacity: slot.panelOpen && !slot.dragSource ? 0.9 : 0
color: Color.accent
color: Commons.Color.accent
radius: Math.min(width, height) / 2
width: root.vertical ? Style.space(2) : slot.panelIndicatorExtent
height: root.vertical ? slot.panelIndicatorExtent : Style.space(2)
@@ -1,38 +0,0 @@
import QtQuick
import Quickshell.Io
import qs.Ui
BarIndicator {
id: root
property string state: "idle"
property string icon: ""
active: state === "recording"
activeText: icon
inactiveText: "󰍬"
activeTooltipText: state
inactiveTooltipText: "Dictate"
function update(raw) {
var data = extractData(raw)
state = String(data.alt || data.class || "idle")
if (state === "recording") icon = "󰍬"
else if (state === "transcribing") icon = "󰔟"
else icon = ""
}
Process {
command: ["bash", "-c", "omarchy-voxtype-status"]
running: true
stdout: SplitParser {
onRead: function(data) { root.update(data) }
}
}
onPressed: function() {
if (!root.bar) return
root.bar.run("omarchy-voxtype-config")
}
}
@@ -1,6 +1,7 @@
import QtQuick
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
BarIndicator {
@@ -15,7 +16,7 @@ BarIndicator {
activeTooltipText: "Disable Passwordless Sudo"
inactiveTooltipText: "Passwordless Sudo"
useActiveColor: true
activeColor: Color.urgent
activeColor: Commons.Color.urgent
function refresh() {
if (!root.bar) return
+2 -1
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import qs.Ui
BarWidget {
@@ -34,7 +35,7 @@ BarWidget {
anchors.left: parent.left
width: parent.width
text: root.title
color: root.bar ? root.bar.barForeground : Color.foreground
color: root.bar ? root.bar.barForeground : Commons.Color.foreground
font.family: root.bar ? root.bar.fontFamily : Style.font.family
font.pixelSize: Style.font.body
elide: Text.ElideRight
@@ -31,11 +31,6 @@
"label": "Passwordless sudo",
"description": "Warning while passwordless root access is enabled"
},
{
"value": "Dictation",
"label": "Dictation",
"description": "Voice typing status"
},
{
"value": "ScreenRecording",
"label": "Screen recording",
+1 -1
View File
@@ -8,7 +8,7 @@ BarWidget {
id: root
moduleName: "omarchy.indicators"
readonly property var defaultIndicatorEntries: [ "PasswordlessSudo", "Dictation", "ScreenRecording", "Reminder", "NightLight", "Dnd", "StayAwake" ]
readonly property var defaultIndicatorEntries: [ "PasswordlessSudo", "ScreenRecording", "Reminder", "NightLight", "Dnd", "StayAwake" ]
readonly property var indicatorEntries: indicatorEntriesFromSettings(settings)
property var activeIndicatorIds: []
property var indicatorActiveStates: ({})
+4 -3
View File
@@ -4,6 +4,7 @@ import QtQuick.Controls
import QtQuick.Effects
import Quickshell.Services.SystemTray
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "TrayModel.js" as TrayModel
@@ -16,7 +17,7 @@ BarWidget {
property bool trayMenuOpen: false
property var activeTrayItem: null
property var activeTrayAnchor: null
readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property var pinnedIds: settings.pinned instanceof Array ? settings.pinned : []
readonly property var hiddenIds: settings.hidden instanceof Array ? settings.hidden : []
@@ -617,7 +618,7 @@ BarWidget {
anchors.rightMargin: Style.space(10)
anchors.verticalCenter: parent.verticalCenter
height: 1
color: Color.popups.border
color: Commons.Color.popups.border
opacity: 0.45
}
}
@@ -671,7 +672,7 @@ BarWidget {
anchors.rightMargin: Style.space(10)
anchors.verticalCenter: parent.verticalCenter
height: 1
color: Color.popups.border
color: Commons.Color.popups.border
opacity: 0.45
}
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "ClipboardHistory.js" as ClipboardHistory
@@ -22,13 +23,13 @@ Item {
// Shares the [menu] surface tokens — themes that style the menu also
// style the clipboard. Selected-row colors composed in the
// singleton so consumers drop them straight into Rectangle bindings.
property color background: Color.menu.background
property color foreground: Color.menu.text
property color border: Color.menu.border
property color background: Commons.Color.menu.background
property color foreground: Commons.Color.menu.text
property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText
property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Commons.Color.menu.selectedText
readonly property int cornerRadius: Style.cornerRadius
property string fontFamily: Style.font.menuFamily
property int contentMargin: Style.spacing.panelPadding
+5 -4
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls
import Quickshell
import qs.Ui
import qs.Commons
import qs.Commons as Commons
// Visual reference + live playground for omarchy-shell's common UI
// components. Summon with `omarchy dev ui-preview`, or directly via:
@@ -66,10 +67,10 @@ Item {
property var shell: null
// ---- theme --------------------------------------------------------------
readonly property color foreground: Color.foreground
readonly property color background: Color.background
readonly property color accent: Color.accent
readonly property color urgent: Color.urgent
readonly property color foreground: Commons.Color.foreground
readonly property color background: Commons.Color.background
readonly property color accent: Commons.Color.accent
readonly property color urgent: Commons.Color.urgent
readonly property string fontFamily: "monospace"
// Fake `bar` for components that take a whole bar object (e.g. Slider).
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "EmojiSearch.js" as EmojiSearch
@@ -23,13 +24,13 @@ Item {
// Shares the [menu] surface tokens — themes that style the menu also
// style emojis. Selected-cell colors composed in the
// singleton so consumers drop them straight into Rectangle bindings.
property color background: Color.menu.background
property color foreground: Color.menu.text
property color border: Color.menu.border
property color background: Commons.Color.menu.background
property color foreground: Commons.Color.menu.text
property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText
property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Commons.Color.menu.selectedText
readonly property int cornerRadius: Style.cornerRadius
property string fontFamily: Style.font.menuFamily
property int contentMargin: Style.spacing.panelPadding
+235 -33
View File
@@ -5,6 +5,7 @@ import QtQuick
import QtQuick.Effects
import QtQuick.Shapes
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "ImagePickerModel.js" as ImagePickerModel
@@ -14,6 +15,7 @@ Item {
// Injected by omarchy-shell; defaults to the session OMARCHY_PATH.
property string omarchyPath: Quickshell.env("OMARCHY_PATH")
property string stateHome: Quickshell.env("HOME") + "/.local/state"
property string userThemesPath: Quickshell.env("HOME") + "/.config/omarchy/themes"
property string imageDirs: Quickshell.env("OMARCHY_IMAGE_SELECTOR_DIRS") || Quickshell.env("OMARCHY_IMAGE_SELECTOR_DIR") || Quickshell.env("OMARCHY_STOCK_BACKGROUNDS_DIR") || (stateHome + "/omarchy/current/theme/backgrounds")
property string imageRows: ""
property string loadedImageRows: ""
@@ -26,6 +28,7 @@ Item {
property bool filterable: false
property bool layoutSettled: false
property bool neighborImagesEnabled: false
property int renderedFrames: 0
property bool requestActive: false
property int requestSerial: 0
property int applySerial: 0
@@ -37,14 +40,21 @@ Item {
property string themeRows: ""
property bool themeMode: false
property bool themeOpenPending: false
// Bound to the central [image-picker] section in shell.toml via Color.qml.
// `dimColor` tints unselected slices and text outlines on top of the scrim;
// it intentionally tracks the foundational background, not a surface role.
property color dimColor: Color.background
property color foreground: Color.imagePicker.text
property color scrim: Color.imagePicker.scrim
property color selectedBorder: Color.imagePicker.selectedBorder
property color unselectedBorder: Color.imagePicker.unselectedBorder
property var extraThemeNames: []
property var stockThemeNames: []
property bool stockThemesKnown: false
property bool awaitingDeleteRefresh: false
property string pendingDeleteTheme: ""
property string deleteSelectionPath: ""
property bool deleteConfirmOpen: false
// Bound to the central [image-picker] section in shell.toml via Commons.Color.qml.
// `dimColor` tints unselected slices and text outlines against the desktop
// behind the picker; it intentionally tracks the foundational background,
// not a surface role.
property color dimColor: Commons.Color.background
property color foreground: Commons.Color.imagePicker.text
property color selectedBorder: Commons.Color.imagePicker.selectedBorder
property color unselectedBorder: Commons.Color.imagePicker.unselectedBorder
property int expandedWidth: 768
property int expandedHeight: 475
property int sliceWidth: 108
@@ -56,7 +66,7 @@ Item {
readonly property int previewRadius: Math.max(1, Math.min(16, Math.ceil((panel.width - expandedWidth) / (2 * (sliceWidth + sliceSpacing))) + 1))
onPreviewRadiusChanged: updateVisibleItems()
onOpenedChanged: if (!opened) layoutSettled = false
onOpenedChanged: if (!opened) { layoutSettled = false; renderedFrames = 0; deleteConfirmOpen = false; pendingDeleteTheme = ""; deleteSelectionPath = ""; awaitingDeleteRefresh = false }
function scriptPath(name) {
return omarchyPath + "/shell/plugins/image-picker/" + name
@@ -69,10 +79,35 @@ Item {
function revealWhenSettled(serial) {
Qt.callLater(function() {
if (serial === root.requestSerial && root.opened && root.imagesLoaded && root.imageArray.length > 0) {
root.layoutSettled = true
root.focusPicker()
}
if (serial === root.requestSerial) root.maybeReveal()
})
}
// The card renders at opacity 0 until every visible preview has decoded
// and its masked layers have presented, so the picker lands in one
// complete frame instead of flashing its images in as each asynchronous
// decode and layer upload finishes.
function allPreviewsSettled() {
if (!opened || !imagesLoaded || layoutSettled || imageArray.length === 0 || imageCards.count === 0) return false
for (var i = 0; i < imageCards.count; i++) {
var item = imageCards.itemAt(i)
if (!item || !item.previewSettled) return false
}
return true
}
function settleReveal() {
if (!opened || !imagesLoaded || layoutSettled || imageArray.length === 0) return
layoutSettled = true
focusPicker()
}
function maybeReveal() {
if (!allPreviewsSettled() || renderedFrames < 2) return
// Confirm on the next tick: delegates inserted later in the same window
// sync must not pop in after an early all-ready reading.
Qt.callLater(function() {
if (root.allPreviewsSettled() && root.renderedFrames >= 2) root.settleReveal()
})
}
@@ -152,6 +187,7 @@ Item {
}
function applySelected() {
if (themeMode && (deleteThemeProc.running || awaitingDeleteRefresh)) return
var path = currentPath()
if (themeMode) {
@@ -224,6 +260,10 @@ Item {
}
function openSelector(nextImageDirs, nextImageRows, nextSelectedImage, nextSelectionFile, nextDoneFile, nextShowLabels, nextFilterable) {
deleteConfirmOpen = false
pendingDeleteTheme = ""
deleteSelectionPath = ""
awaitingDeleteRefresh = false
if (requestActive && doneFile && doneFile !== nextDoneFile)
finishDoneFile(doneFile)
@@ -274,7 +314,29 @@ Item {
property var imageArray: []
readonly property var matchingImageIndices: ImagePickerModel.matchingIndices(imageArray, filterText)
onMatchingImageIndicesChanged: updateVisibleItems()
onSelectedIndexChanged: updateVisibleItems()
onSelectedIndexChanged: {
updateVisibleItems()
introPrepareTimer.restart()
}
onThemeModeChanged: if (themeMode) introPrepareTimer.restart()
Timer {
id: introPrepareTimer
interval: 75
onTriggered: {
if (root.opened && root.themeMode && !introPrepare.running) {
introPrepare.theme = root.nameForPath(root.currentPath())
introPrepare.command = ["omarchy-theme-bg-boot-intro", "--prepare-theme", root.nameForPath(root.currentPath())]
introPrepare.running = true
}
}
}
Process {
id: introPrepare
property string theme: ""
onExited: if (root.opened && root.themeMode && theme !== root.nameForPath(root.currentPath())) introPrepareTimer.restart()
}
function updateVisibleItems() {
ImagePickerModel.syncWindow(visibleImages, ImagePickerModel.visibleWindow(matchingImageIndices, selectedIndex, previewRadius))
@@ -307,6 +369,8 @@ Item {
themeOpenPending = true
}
refreshThemeRows()
refreshExtraThemes()
refreshStockThemes()
}
function openThemeRows() {
@@ -314,8 +378,53 @@ Item {
themeMode = true
}
// A refresh asked mid-refresh (a deletion finishing behind the open-time
// one) queues a second pass instead of leaving the list stale.
function refreshThemeRows() {
if (!themeRowsProc.running) themeRowsProc.running = true
if (themeRowsProc.running) { themeRowsProc.queued = true; return }
themeRowsProc.running = true
}
function refreshExtraThemes() {
if (extraThemesProc.running) { extraThemesProc.queued = true; return }
extraThemesProc.running = true
}
function refreshStockThemes() {
if (!stockThemesProc.running) stockThemesProc.running = true
}
function selectedThemeName() {
return nameForPath(currentPath())
}
function canDeleteSelectedTheme() {
return themeMode && !deleteThemeProc.running && !awaitingDeleteRefresh && stockThemesKnown && ImagePickerModel.canDeleteTheme(selectedThemeName(), extraThemeNames, stockThemeNames)
}
function requestDeleteSelectedTheme() {
if (!canDeleteSelectedTheme()) return
pendingDeleteTheme = selectedThemeName()
deleteConfirm.selectedIndex = 1
deleteConfirmOpen = true
}
function cancelDeleteTheme() {
deleteConfirmOpen = false
pendingDeleteTheme = ""
}
// Removal itself is omarchy-theme-remove's job (including its guards and
// notification); the picker only refreshes its rows once it finishes.
function confirmDeleteTheme() {
var name = pendingDeleteTheme
deleteConfirmOpen = false
pendingDeleteTheme = ""
if (!name || deleteThemeProc.running) return
// Keep the user's place in the list once the deleted theme is gone.
if (name === selectedThemeName()) deleteSelectionPath = ImagePickerModel.replacementSelectionPath(imageArray, selectedIndex, filterText)
deleteThemeProc.command = ["omarchy-theme-remove", name]
deleteThemeProc.running = true
}
function updateThemeRows(rows) {
@@ -327,8 +436,11 @@ Item {
if (rows) openThemeRows()
} else if (changed && rows && themeMode && opened) {
// A theme was added or removed since the rows were last read. Keep the
// user's place in the carousel rather than jumping back to the current.
selectedImage = currentPath() || currentThemePreview()
// user's place in the carousel rather than jumping back to the current;
// a just-deleted selection lands on the theme before it.
selectedImage = deleteSelectionPath || currentPath() || currentThemePreview()
deleteSelectionPath = ""
awaitingDeleteRefresh = false
imageRows = rows
loadRows(rows, false)
}
@@ -343,13 +455,62 @@ Item {
Process {
id: themeRowsProc
property bool queued: false
command: [root.omarchyPath + "/bin/omarchy-theme-switcher", "--print-rows"]
stdout: StdioCollector {
onStreamFinished: root.updateThemeRows(String(text || "").trim())
}
onExited: {
if (queued) {
queued = false
running = true
}
}
}
Component.onCompleted: refreshThemeRows()
// The same listing omarchy-theme-remove offers interactively: real
// directories under the user themes path, never symlinked working copies.
Process {
id: extraThemesProc
property bool queued: false
command: ["find", root.userThemesPath, "-mindepth", "1", "-maxdepth", "1", "-type", "d", "!", "-xtype", "l", "-printf", "%f\n"]
stdout: StdioCollector {
onStreamFinished: root.extraThemeNames = ImagePickerModel.parseThemeNames(String(text || ""))
}
onExited: {
if (queued) {
queued = false
running = true
}
}
}
Process {
id: stockThemesProc
command: ["find", root.omarchyPath + "/themes", "-mindepth", "1", "-maxdepth", "1", "-type", "d", "-printf", "%f\n"]
stdout: StdioCollector {
onStreamFinished: root.stockThemeNames = ImagePickerModel.parseThemeNames(String(text || ""))
}
// Until this lands, stockThemeNames is empty and an override would look
// deletable: deletion stays disabled unless the listing succeeded.
onExited: function(exitCode) { if (exitCode === 0) root.stockThemesKnown = true }
}
Process {
id: deleteThemeProc
onExited: function(exitCode) {
if (exitCode === 0) root.awaitingDeleteRefresh = true
else root.deleteSelectionPath = ""
root.refreshExtraThemes()
root.refreshThemeRows()
}
}
Component.onCompleted: {
refreshThemeRows()
refreshExtraThemes()
refreshStockThemes()
}
function startImageScan(serial, dirs) {
if (loadImagesProc.running) {
@@ -427,7 +588,7 @@ Item {
// Theme/background set hooks can warm selector rows after a picker was
// dismissed. Ignore those preloads while a user-visible request is open;
// otherwise the preload resets layoutSettled without revealing again,
// leaving only the fullscreen scrim.
// leaving the picker invisible behind its own open overlay.
if (opened || requestActive) return
requestSerial += 1
@@ -465,28 +626,39 @@ Item {
shownKeyboardFocus: root.imagesLoaded ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
WlrLayershell.namespace: "omarchy-image-selector"
Rectangle {
anchors.fill: parent
visible: root.opened && root.imagesLoaded
color: root.scrim
}
MouseArea {
anchors.fill: parent
enabled: root.opened && root.imagesLoaded
onClicked: root.cancel()
}
// Count presented frames while the card pre-renders below; two frames
// prove its masked layers uploaded on this fresh surface.
FrameAnimation {
running: root.opened && !root.layoutSettled && root.renderedFrames < 2
onTriggered: {
root.renderedFrames += 1
root.maybeReveal()
}
}
// A preview stuck decoding (slow disk, huge original) must not hold an
// invisible picker with the keyboard grabbed: reveal anyway shortly.
Timer {
interval: 400
running: root.opened && root.imagesLoaded && !root.layoutSettled && root.imageArray.length > 0
onTriggered: root.settleReveal()
}
Item {
id: card
visible: root.opened && root.imagesLoaded && root.layoutSettled && root.imageArray.length > 0
visible: root.opened && root.imagesLoaded && root.imageArray.length > 0
opacity: root.layoutSettled ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 90 } }
width: Math.min(parent.width - 80, root.expandedWidth + 13 * (root.sliceWidth + root.sliceSpacing) + 40)
height: root.expandedHeight + Style.space(30) + root.bottomChromeHeight
anchors.centerIn: parent
MouseArea { anchors.fill: parent; onClicked: {} }
MouseArea { anchors.fill: parent; enabled: root.layoutSettled; onClicked: {} }
Item {
id: carousel
@@ -504,6 +676,19 @@ Item {
Keys.priority: Keys.BeforeItem
Keys.onPressed: function(event) {
if (root.deleteConfirmOpen) {
if (deleteConfirm.handleKey(event)) event.accepted = true
return
}
// Nothing is visible before the reveal: only let the user back
// out, never filter into a dead end or apply an unseen pick.
if (!root.layoutSettled) {
if (event.key === Qt.Key_Escape) {
root.cancel()
event.accepted = true
}
return
}
if (event.key === Qt.Key_Escape) {
if (root.filterText) {
root.updateFilter("")
@@ -514,6 +699,9 @@ Item {
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
root.applySelected()
event.accepted = true
} else if (event.key === Qt.Key_Delete && !(event.modifiers & (Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier))) {
root.requestDeleteSelectedTheme()
event.accepted = true
} else if (root.filterable && Util.editsFilter(event, root.filterText)) {
root.updateFilter(Util.editedFilter(event, root.filterText))
event.accepted = true
@@ -534,6 +722,7 @@ Item {
Repeater {
id: imageCards
model: visibleImages
onCountChanged: root.maybeReveal()
delegate: Item {
id: item
@@ -547,6 +736,8 @@ Item {
readonly property bool selected: imageIndex === root.selectedIndex
readonly property bool previewReady: image.status === Image.Ready || image.status === Image.Error
readonly property bool previewSettled: !thumbnailPath || previewReady
onPreviewSettledChanged: if (previewSettled) root.maybeReveal()
onSelectedChanged: if (selected && previewReady) root.neighborImagesEnabled = true
x: selected ? carousel.previewX : (relativeIndex < 0 ? carousel.previewX + relativeIndex * carousel.itemStep : carousel.previewX + root.expandedWidth + root.sliceSpacing + (relativeIndex - 1) * carousel.itemStep)
@@ -554,10 +745,6 @@ Item {
height: selected ? root.expandedHeight : root.sliceHeight
y: selected ? 0 : (root.expandedHeight - root.sliceHeight) / 2
z: selected ? 100 : 50 - Math.min(Math.abs(relativeIndex), 40)
Behavior on x { NumberAnimation { duration: 90; easing.type: Easing.OutCubic } }
Behavior on y { NumberAnimation { duration: 90; easing.type: Easing.OutCubic } }
Behavior on width { NumberAnimation { duration: 90; easing.type: Easing.OutCubic } }
Behavior on height { NumberAnimation { duration: 90; easing.type: Easing.OutCubic } }
readonly property real skAbs: Math.abs(root.skewOffset)
readonly property real topLeft: root.skewOffset >= 0 ? skAbs : 0
@@ -617,7 +804,6 @@ Item {
cache: false
smooth: true
opacity: status === Image.Ready ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 90 } }
onStatusChanged: if (item.selected && (status === Image.Ready || status === Image.Error)) root.neighborImagesEnabled = true
}
@@ -645,6 +831,7 @@ Item {
MouseArea {
anchors.fill: parent
enabled: root.layoutSettled
cursorShape: Qt.PointingHandCursor
onClicked: item.selected ? root.applySelected() : root.select(item.imageIndex)
}
@@ -687,5 +874,20 @@ Item {
elide: Text.ElideRight
}
}
// Unlike the picker itself, the confirmation keeps the faded backdrop:
// a destructive choice should take over the screen.
ConfirmDialog {
id: deleteConfirm
anchors.fill: parent
opened: root.deleteConfirmOpen
z: 10
message: "Do you want to delete " + (root.pendingDeleteTheme ? root.labelForPath(root.pendingDeleteTheme) : "") + "?"
confirmText: "Delete"
background: root.dimColor
foreground: root.foreground
onCanceled: root.cancelDeleteTheme()
onConfirmed: root.confirmDeleteTheme()
}
}
}
@@ -6,6 +6,41 @@ function labelForPath(path) {
return nameForPath(path).replace(/[-_]+/g, " ").replace(/\b\w/g, function(match) { return match.toUpperCase() })
}
// Extra (user-installed) theme names, one per line, as listed from the user
// themes directory: the set omarchy-theme-remove can delete.
function parseThemeNames(text) {
var names = []
var lines = String(text || "").split("\n")
for (var i = 0; i < lines.length; i++) {
var name = lines[i].trim()
if (name) names.push(name)
}
return names
}
// A user directory shadowing a stock theme holds customizations, not an
// extra theme: removing it from here would silently revert to stock (and a
// shadow can even list twice, once per preview extension), so only themes
// with no stock twin can be deleted from the picker.
function canDeleteTheme(name, extraNames, stockNames) {
if (!name || !Array.isArray(extraNames) || extraNames.indexOf(name) === -1) return false
return !Array.isArray(stockNames) || stockNames.indexOf(name) === -1
}
// Where selection lands when the selected image goes away: the previous
// match in list order, or the next one when the first match is deleted.
function replacementSelectionPath(images, selectedIndex, filterText) {
var values = Array.isArray(images) ? images : []
if (selectedIndex < 0 || selectedIndex >= values.length) return ""
for (var i = selectedIndex - 1; i >= 0; i--) {
if (itemMatches(values, i, filterText)) return values[i].filePath
}
for (var i = selectedIndex + 1; i < values.length; i++) {
if (itemMatches(values, i, filterText)) return values[i].filePath
}
return ""
}
function loadRows(rows) {
var images = []
var seen = {}
@@ -125,6 +160,9 @@ if (typeof module !== "undefined") {
module.exports = {
nameForPath: nameForPath,
labelForPath: labelForPath,
parseThemeNames: parseThemeNames,
canDeleteTheme: canDeleteTheme,
replacementSelectionPath: replacementSelectionPath,
loadRows: loadRows,
itemMatches: itemMatches,
firstMatchingIndex: firstMatchingIndex,
+12 -11
View File
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Effects
import qs.Commons
import qs.Commons as Commons
import qs.Ui
Item {
@@ -42,8 +43,8 @@ Item {
readonly property bool showPasswordCursor: inputEnabled && !authenticatingPassword && failureMessage.length === 0
readonly property bool errorState: failureMessage.length > 0
readonly property var inputBorderSpec: errorState
? Border.surfaceSpec("lock", "border-error", Color.lock.borderError, root.outlineThickness, "border-alpha")
: Border.surfaceSpec("lock", "border-active", Color.lock.borderActive, root.outlineThickness, "border-alpha")
? Border.surfaceSpec("lock", "border-error", Commons.Color.lock.borderError, root.outlineThickness, "border-alpha")
: Border.surfaceSpec("lock", "border-active", Commons.Color.lock.borderActive, root.outlineThickness, "border-alpha")
readonly property bool video: Util.isVideoPath(root.backgroundPath)
readonly property bool feedActive: root.video && root.loadBackground && !root.displaysBlank && !root.powerSaverActive
@@ -97,7 +98,7 @@ Item {
Rectangle {
anchors.fill: parent
color: Color.background
color: Commons.Color.background
BackgroundMedia {
id: wallpaper
@@ -156,7 +157,7 @@ Item {
width: root.fieldWidth
height: root.fieldHeight
anchors.centerIn: parent
color: Color.lock.background
color: Commons.Color.lock.background
borderSpec: root.inputBorderSpec
radius: Style.cornerRadius
clip: true
@@ -179,16 +180,16 @@ Item {
echoMode: TextInput.Password
passwordCharacter: "\u25CF"
passwordMaskDelay: 0
color: Color.lock.text
selectionColor: Color.lock.selection
selectedTextColor: Color.lock.text
color: Commons.Color.lock.text
selectionColor: Commons.Color.lock.selection
selectedTextColor: Commons.Color.lock.text
font.family: Style.font.family
font.pixelSize: text.length > 0 ? Math.max(1, Math.floor(root.passwordDotFontSize * root.passwordDotScale)) : root.fieldFontSize
font.letterSpacing: text.length > 0 ? root.passwordDotLetterSpacing * root.passwordDotScale : 0
cursorVisible: activeFocus && root.showPasswordCursor && text.length > 0
cursorDelegate: Rectangle {
width: 2
color: Color.lock.text
color: Commons.Color.lock.text
visible: passwordInput.cursorVisible
}
@@ -224,7 +225,7 @@ Item {
anchors.fill: passwordInput
text: root.authenticatingPassword ? "Checking…" : (root.failureMessage.length > 0 ? root.failureMessage : root.placeholderText)
visible: passwordInput.text.length === 0
color: root.authenticatingPassword ? Color.lock.text : (root.failureMessage.length > 0 ? Color.lock.textError : Color.lock.placeholder)
color: root.authenticatingPassword ? Commons.Color.lock.text : (root.failureMessage.length > 0 ? Commons.Color.lock.textError : Commons.Color.lock.placeholder)
font.family: Style.font.family
font.pixelSize: root.fieldFontSize
font.italic: !root.authenticatingPassword && root.failureMessage.length > 0
@@ -247,7 +248,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
visible: root.fingerprintConfigured
text: root.fingerprintUnavailable ? "󰺱" : "󰈷"
color: root.fingerprintUnavailable ? Color.lock.textError : Color.lock.placeholder
color: root.fingerprintUnavailable ? Commons.Color.lock.textError : Commons.Color.lock.placeholder
font.family: Style.font.family
font.pixelSize: Math.round(root.fieldFontSize * 1.1)
horizontalAlignment: Text.AlignHCenter
@@ -266,7 +267,7 @@ Item {
anchors.horizontalCenter: inputField.horizontalCenter
visible: root.fingerprintConfigured && root.fingerprintUnavailable
text: "Fingerprint reader unavailable"
color: Color.lock.textError
color: Commons.Color.lock.textError
font.family: Style.font.family
font.pixelSize: Style.font.heading
font.italic: true
+2 -1
View File
@@ -4,6 +4,7 @@ import Quickshell.Io
import Quickshell.Services.Pam
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import "FingerprintModel.js" as FingerprintModel
Item {
@@ -467,7 +468,7 @@ Item {
WlSessionLockSurface {
id: lockSurface
color: Color.background
color: Commons.Color.background
LockView {
id: lockView
+11 -10
View File
@@ -3,6 +3,7 @@ import Quickshell.Io
import Quickshell.Wayland
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "MenuModel.js" as MenuModel
@@ -81,17 +82,17 @@ Item {
property bool deleteConfirmOpen: false
property var deleteTarget: null
onOpenedChanged: if (!opened) { deleteConfirmOpen = false; deleteTarget = null }
// Bound to the central [menu] section in shell.toml via Color.qml.
// Bound to the central [menu] section in shell.toml via Commons.Color.qml.
// Each color already includes its alpha companion (composed in the
// singleton), so consumers can drop them straight into a Rectangle.
property color background: Color.menu.background
property color foreground: Color.menu.text
property color border: Color.menu.border
property color background: Commons.Color.menu.background
property color foreground: Commons.Color.menu.text
property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim
property color selectedBackground: Color.menu.selectedBackground
property color selectedText: Color.menu.selectedText
property color selectedBorder: Color.menu.selectedBorder
property color scrim: Commons.Color.menu.scrim
property color selectedBackground: Commons.Color.menu.selectedBackground
property color selectedText: Commons.Color.menu.selectedText
property color selectedBorder: Commons.Color.menu.selectedBorder
property var selectedBorderSpec: Border.surfaceSpec("menu", "selected-border", selectedBorder, 0)
readonly property real rowReservedBorderLeft: Border.left(selectedBorderSpec)
readonly property real rowReservedBorderRight: Border.right(selectedBorderSpec)
@@ -1075,7 +1076,7 @@ Item {
// then on the card grows and shrinks downward instead of re-centering
// on every resize, which made the menu jump around. The rows height is
// frozen at the same moment, so the starting menu also caps how tall the
// card may grow from there. Closing unfreezes both.
// card may grow from there. Closing or changing screens unfreezes both.
property int cardTop: -1
property int maxRowsHeight: -1
readonly property int centeredTop: Math.max(Style.gapsOut, Math.round((height - root.cardHeight) / 2))
@@ -1086,8 +1087,8 @@ Item {
maxRowsHeight = root.visibleRowsHeight
}
}
// The surface stays mapped between opens, so closing is shown going false.
onShownChanged: if (!shown) { cardTop = -1; maxRowsHeight = -1 }
onTargetScreenChanged: { cardTop = -1; maxRowsHeight = -1 }
Rectangle {
anchors.fill: parent
+1
View File
@@ -398,6 +398,7 @@ var GUARD_READERS = [
"omarchy-default-browser",
"omarchy-default-editor",
"omarchy-default-terminal",
"omarchy-default-dictation",
"omarchy-dns"
]
@@ -6,6 +6,7 @@ import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "../NotificationLogic.js" as NotificationLogic
@@ -48,10 +49,10 @@ BorderSurface {
readonly property string sanitizedBody: sanitizeBody(body)
readonly property string styledBody: NotificationLogic.styledBody(body, app, appIcon)
readonly property color dimColor: Qt.darker(Color.notifications.text, 1.4)
readonly property color bodyColor: Qt.darker(Color.notifications.text, 1.15)
readonly property color accentColor: urgency === 2 ? Color.urgent : (urgency === 0 ? dimColor : Color.notifications.countdown)
readonly property var cardBorderSpec: Border.surfaceSpec("notifications", "border", Color.notifications.border, Math.max(1, Style.space(2)))
readonly property color dimColor: Qt.darker(Commons.Color.notifications.text, 1.4)
readonly property color bodyColor: Qt.darker(Commons.Color.notifications.text, 1.15)
readonly property color accentColor: urgency === 2 ? Commons.Color.urgent : (urgency === 0 ? dimColor : Commons.Color.notifications.countdown)
readonly property var cardBorderSpec: Border.surfaceSpec("notifications", "border", Commons.Color.notifications.border, Math.max(1, Style.space(2)))
function sanitizeBody(s) {
return NotificationLogic.sanitizeBody(s, app, appIcon)
@@ -70,7 +71,7 @@ BorderSurface {
// doesn't push content under the bottom edge.
implicitHeight: mainColumn.implicitHeight + borderTop + borderBottom
radius: cornerRadius
color: Color.notifications.background
color: Commons.Color.notifications.background
borderSpec: cardBorderSpec
clip: true
@@ -139,7 +140,7 @@ BorderSurface {
anchors.centerIn: parent
visible: root.hasGlyph && smallIconImage.status !== Image.Ready
text: root.glyph
color: Color.notifications.text
color: Commons.Color.notifications.text
font.family: root.fontFamily
font.pixelSize: Style.font.displayLarge
}
@@ -150,7 +151,7 @@ BorderSurface {
Layout.alignment: Qt.AlignVCenter
visible: root.compactGlyph
text: root.glyph
color: Color.notifications.text
color: Commons.Color.notifications.text
font.family: root.fontFamily
font.pixelSize: Style.font.icon
}
@@ -172,7 +173,7 @@ BorderSurface {
visible: root.summary.length > 0
text: root.summary
font.family: "Liberation Sans"
color: Color.notifications.text
color: Commons.Color.notifications.text
font.pixelSize: Style.font.title
font.bold: true
wrapMode: Text.WordWrap
@@ -235,7 +236,7 @@ BorderSurface {
Text {
anchors.centerIn: parent
text: "✕"
color: closeArea.containsMouse ? Color.notifications.text : root.dimColor
color: closeArea.containsMouse ? Commons.Color.notifications.text : root.dimColor
font.pixelSize: Math.round(Style.font.caption * 1.44)
}
+7 -6
View File
@@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "OsdModel.js" as OsdModel
@@ -139,8 +140,8 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.space(67)
color: Util.alpha(Color.background, 0.97)
borderSpec: Border.surfaceSpec("popups", "border", Color.popups.border, Math.max(1, Style.space(2)))
color: Util.alpha(Commons.Color.background, 0.97)
borderSpec: Border.surfaceSpec("popups", "border", Commons.Color.popups.border, Math.max(1, Style.space(2)))
radius: Style.cornerRadius
opacity: root.opened ? 1 : 0
@@ -162,7 +163,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
text: root.icon
font: iconMetrics.font
color: Color.popups.text
color: Commons.Color.popups.text
}
}
Rectangle {
@@ -170,11 +171,11 @@ Item {
width: root.barWidth
height: Math.max(Style.space(6), Style.spacing.sm)
anchors.verticalCenter: parent.verticalCenter
color: Util.alpha(Color.popups.text, 0.45)
color: Util.alpha(Commons.Color.popups.text, 0.45)
Rectangle {
height: parent.height
width: parent.width * (root.hasProgress ? root.value / root.maxValue : 0)
color: Color.accent
color: Commons.Color.accent
Behavior on width {
enabled: root.opened
@@ -192,7 +193,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter
text: root.message
font: messageMetrics.font
color: Color.popups.text
color: Commons.Color.popups.text
elide: Text.ElideRight
maximumLineCount: 1
}
+3 -2
View File
@@ -6,6 +6,7 @@ import Quickshell.Services.Mpris
import Quickshell.Services.Pipewire
import qs.Ui
import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model
Panel {
@@ -179,10 +180,10 @@ Panel {
readonly property string toggleHint: anyAudible ? "Mute" : "Unmute"
readonly property color hoverFill: bar
? Style.hoverFillFor(bar.foreground, Color.accent)
? Style.hoverFillFor(bar.foreground, Commons.Color.accent)
: "transparent"
readonly property color selectedFill: bar
? Style.selectedFillFor(bar.foreground, Color.accent)
? Style.selectedFillFor(bar.foreground, Commons.Color.accent)
: "transparent"
function sectionCount(section) {
+3 -2
View File
@@ -6,6 +6,7 @@ import Quickshell.Bluetooth
import Quickshell.Services.Pipewire
import qs.Ui
import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model
Panel {
@@ -104,10 +105,10 @@ Panel {
readonly property string toggleHint: root.adapter && root.adapter.enabled ? "Turn Bluetooth off" : "Turn Bluetooth on"
readonly property color hoverFill: bar
? Style.hoverFillFor(bar.foreground, Color.accent)
? Style.hoverFillFor(bar.foreground, Commons.Color.accent)
: "transparent"
readonly property color selectedFill: bar
? Style.selectedFillFor(bar.foreground, Color.accent)
? Style.selectedFillFor(bar.foreground, Commons.Color.accent)
: "transparent"
function sectionCount(section) {
+9 -8
View File
@@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
@@ -75,7 +76,7 @@ Panel {
// Guarded so the widget renders before the bar is injected (the bar-widget
// contract instantiates it bare).
readonly property color contentForeground: bar ? bar.foreground : Color.foreground
readonly property color contentForeground: bar ? bar.foreground : Commons.Color.foreground
readonly property string contentFontFamily: bar ? bar.fontFamily : Style.font.family
readonly property int cellWidth: Style.space(52)
@@ -302,7 +303,7 @@ Panel {
anchors.baseline: heroDate.baseline
text: "󰃭"
color: heroMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent)
? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: root.contentForeground
font.family: root.contentFontFamily
// Decorative, and deliberately outside the Style.font.*
@@ -317,7 +318,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
text: Qt.formatDate(root.today, "MMMM d")
color: heroMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent)
? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: root.contentForeground
font.family: root.contentFontFamily
font.pixelSize: 52
@@ -455,7 +456,7 @@ Panel {
width: Math.round(parent.width * root.yearDone)
height: parent.height
radius: parent.radius
color: Style.selectedStateColor(root.contentForeground, Color.accent)
color: Style.selectedStateColor(root.contentForeground, Commons.Color.accent)
Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } }
}
@@ -513,7 +514,7 @@ Panel {
width: Math.round(parent.width * root.lifeDone)
height: parent.height
radius: parent.radius
color: Style.selectedStateColor(root.contentForeground, Color.accent)
color: Style.selectedStateColor(root.contentForeground, Commons.Color.accent)
Behavior on width { NumberAnimation { duration: Style.duration(160); easing.type: Easing.OutCubic } }
}
@@ -575,14 +576,14 @@ Panel {
height: Style.space(16)
radius: Style.cornerRadius
color: weekStartMouse.containsMouse
? Style.hoverFillFor(root.contentForeground, Color.accent)
? Style.hoverFillFor(root.contentForeground, Commons.Color.accent)
: "transparent"
Text {
anchors.centerIn: parent
text: "W"
color: weekStartMouse.containsMouse
? Style.hoverStateColor(root.contentForeground, Color.accent)
? Style.hoverStateColor(root.contentForeground, Commons.Color.accent)
: Qt.darker(root.contentForeground, 1.9)
font.family: root.contentFontFamily
font.pixelSize: Style.font.caption
@@ -667,7 +668,7 @@ Panel {
// over a grid this quiet.
color: "transparent"
border.width: modelData.today ? Style.spacing.hairline : 0
border.color: Style.normalBorderFor(root.contentForeground, Color.accent)
border.color: Style.normalBorderFor(root.contentForeground, Commons.Color.accent)
Text {
textFormat: Text.PlainText
+2 -1
View File
@@ -1,12 +1,13 @@
import QtQuick
import QtQuick.Shapes
import qs.Commons
import qs.Commons as Commons
Item {
id: root
property real iconSize: Style.font.icon
property color color: Color.foreground
property color color: Commons.Color.foreground
width: iconSize * 1.18
height: iconSize
+3 -2
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
@@ -32,8 +33,8 @@ Panel {
"Cataloging chaos"
]
readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length]
readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent
readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property color iconColor: dropbox.authenticated && dropbox.active ? foreground : dim
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
import "Arc.js" as Arc
// One line of text arched over what sits below it, each character turned to
@@ -13,7 +14,7 @@ Item {
property real rise: 6
property string fontFamily: Style.font.family
property int pixelSize: Style.font.caption
property color color: Color.foreground
property color color: Commons.Color.foreground
FontMetrics {
id: metrics
+4 -3
View File
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Layouts
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
import "Greetings.js" as Greet
@@ -52,7 +53,7 @@ Rectangle {
// arrow keys never reads darker than the daytime rows around it.
readonly property bool picked: panel.focusIndex === index && !panel.addSelected
readonly property bool lit: rowHover.hovered || picked
color: Model.mix(Color.popups.background, foreground,
color: Model.mix(Commons.Color.popups.background, foreground,
picked ? dayFill + hoverLift : rowHover.hovered ? phaseFill + hoverLift : phaseFill)
// Transforms leave the Column's layout alone: the knock that clears the
@@ -297,8 +298,8 @@ Rectangle {
anchors.verticalCenter: parent.top
size: fontSize + (Style.space(22) - fontSize) * 0.85
radius: size / 2
color: Model.mix(Color.popups.background, row.foreground, _hot ? 0.24 : 0.14)
borderSpec: Border.flat(Model.mix(Color.popups.background, row.foreground, _hot ? 0.65 : 0.35), Style.space(1))
color: Model.mix(Commons.Color.popups.background, row.foreground, _hot ? 0.24 : 0.14)
borderSpec: Border.flat(Model.mix(Commons.Color.popups.background, row.foreground, _hot ? 0.65 : 0.35), Style.space(1))
iconText: "\u00d7"
tooltipText: "Remove"
foreground: row.dim
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
@@ -20,7 +21,7 @@ Column {
property string placeholderText: "Search cities\u2026"
property string loadingText: "Loading zones\u2026"
property real fontSize: Style.font.bodySmall
property color foreground: Color.foreground
property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1)
property string fontFamily: Style.font.family
@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
import "Sun.js" as Sun
@@ -22,7 +23,7 @@ Item {
property bool hovered: false
property bool hour24: false
property real moonPhase: 0
property color foreground: Color.foreground
property color foreground: Commons.Color.foreground
property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker: "#E5C736"
property string fontFamily: Style.font.family
+9 -8
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "GlobeModel.js" as Solar
import "Model.js" as Model
@@ -11,14 +12,14 @@ import "Model.js" as Model
Item {
id: root
property color foreground: Color.foreground
property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker
// Passed in so the footer's moon agrees with the rows' strips.
property real moonPhase: 0.5
// Night dots are dark so they read against the bright continents.
readonly property color nightMarker: Util.alpha(Color.background, 0.92)
readonly property color nightMarker: Util.alpha(Commons.Color.background, 0.92)
property string fontFamily: Style.font.family
property bool hour24: false
// The panel's offset setting, and the offset "home" is measured from.
@@ -30,7 +31,7 @@ Item {
property real chromeOpacity: 1
// Opaque tones mixed against the background, so the rows behind never show through.
readonly property color surfaceBase: Color.popups.background
readonly property color surfaceBase: Commons.Color.popups.background
// Light names over sea, dark over land, split at the coastline.
readonly property color seaInk: foreground
readonly property color landInk: surfaceBase
@@ -470,26 +471,26 @@ Item {
ctx.fillStyle = day ? root.daylightMarker : root.nightMarker
ctx.fill()
ctx.lineWidth = root.scaled(1.2)
ctx.strokeStyle = day ? Util.alpha(Color.background, 0.7) : Util.alpha(fg, 0.85)
ctx.strokeStyle = day ? Util.alpha(Commons.Color.background, 0.7) : Util.alpha(fg, 0.85)
ctx.stroke()
if (root.isHome(i)) {
ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(3.4), 0, Math.PI * 2)
ctx.fillStyle = Color.accent
ctx.fillStyle = Commons.Color.accent
ctx.fill()
ctx.lineWidth = root.scaled(1.2)
ctx.strokeStyle = Util.alpha(Color.background, 0.5)
ctx.strokeStyle = Util.alpha(Commons.Color.background, 0.5)
ctx.stroke()
ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(6.4), 0, Math.PI * 2)
ctx.lineWidth = root.scaled(1.4)
ctx.strokeStyle = Util.alpha(Color.accent, 0.65)
ctx.strokeStyle = Util.alpha(Commons.Color.accent, 0.65)
ctx.stroke()
} else if (root.isTracked(i)) {
ctx.beginPath()
ctx.arc(p.x, p.y, root.scaled(4.6), 0, Math.PI * 2)
ctx.lineWidth = root.scaled(1.3)
ctx.strokeStyle = Color.accent
ctx.strokeStyle = Commons.Color.accent
ctx.stroke()
}
if (isSel) {
@@ -1,5 +1,6 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
// The selected city under the globe: name, local time and badge, then its
// zone and offset. Blank without a selection; the parent reserves the height.
@@ -12,7 +13,7 @@ Item {
property string offsetLabel: ""
property string badge: "" // "home", "tracked" or ""
property real moonPhase: 0.5
property color foreground: Color.foreground
property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55)
property color fainter: Qt.darker(foreground, 2.1)
property color daylightMarker
@@ -90,7 +91,7 @@ Item {
textFormat: Text.PlainText
text: root.badge
visible: root.has && text !== ""
color: Color.accent
color: Commons.Color.accent
font.family: root.fontFamily
font.pixelSize: Style.font.caption
}
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar
// "World [globe] Clock" under an arched caption. The little globe is the door
@@ -10,7 +11,7 @@ Column {
property string caption: ""
property color captionColor: dim
property bool captionClickable: false
property color foreground: Color.foreground
property color foreground: Commons.Color.foreground
property color dim: Qt.darker(foreground, 1.55)
property string fontFamily: Style.font.family
+5 -4
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar
import "Model.js" as Model
@@ -11,7 +12,7 @@ Item {
id: root
property real spin: 0
property color color: Color.foreground
property color color: Commons.Color.foreground
// Below this size land turns to noise; draw the graticule alone.
readonly property bool showLand: width >= 22
@@ -24,7 +25,7 @@ Item {
property bool showMarker: false
property real markerLat: 0
property real markerLon: 0
property color markerColor: Color.accent
property color markerColor: Commons.Color.accent
readonly property real radius: Math.min(width, height) / 2 - 1
readonly property string pluginDir: Quickshell.env("OMARCHY_PATH") + "/shell/plugins/panels/elsewhen"
@@ -68,7 +69,7 @@ Item {
// The ocean, opaque like the large globe.
ctx.beginPath()
ctx.arc(0, 0, r, 0, Math.PI * 2)
ctx.fillStyle = Model.mix(Color.popups.background, c, root.bold ? 0.16 : 0.13)
ctx.fillStyle = Model.mix(Commons.Color.popups.background, c, root.bold ? 0.16 : 0.13)
ctx.fill()
ctx.save()
@@ -117,7 +118,7 @@ Item {
ctx.fill()
// Edged so it does not dissolve into a continent of similar lightness.
ctx.lineWidth = Math.max(1, r * 0.04)
ctx.strokeStyle = Util.alpha(Color.background, 0.5)
ctx.strokeStyle = Util.alpha(Commons.Color.background, 0.5)
ctx.stroke()
ctx.beginPath()
+2 -1
View File
@@ -1,5 +1,6 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
import "GlobeModel.js" as Solar
// The night marker drawn as the moon's current phase. The faint full disc
@@ -8,7 +9,7 @@ Item {
id: root
property real phase: 0 // 0 new, 0.25 first quarter, 0.5 full
property color color: Color.foreground
property color color: Commons.Color.foreground
onPhaseChanged: canvas.requestPaint()
onColorChanged: canvas.requestPaint()
+3 -2
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
import "GlobeModel.js" as Solar
@@ -80,7 +81,7 @@ Panel {
implicitWidth: button.implicitWidth
implicitHeight: button.implicitHeight
readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color dim: Qt.darker(foreground, 1.55)
readonly property color fainter: Qt.darker(foreground, 2.1)
// A literal gold: several themes' "yellow" is not yellow.
@@ -830,7 +831,7 @@ Panel {
width: parent.width
caption: root.hereLine
// Accent while scrubbed, so a shifted time is never taken for now.
captionColor: root.scrubMinutes !== 0 ? Color.accent : root.dim
captionColor: root.scrubMinutes !== 0 ? Commons.Color.accent : root.dim
captionClickable: root.focusIndex >= 0
foreground: root.foreground
dim: root.dim
+3 -2
View File
@@ -4,6 +4,7 @@ import Quickshell
import Quickshell.Io
import qs.Ui
import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model
Panel {
@@ -873,8 +874,8 @@ Panel {
onHasCursorChanged: if (hasCursor) root.ensureCursorVisible(monitorRow)
current: isFocused
foreground: root.bar.foreground
fill: Style.hoverFillFor(root.bar.foreground, Color.accent)
currentFill: Style.selectedFillFor(root.bar.foreground, Color.accent)
fill: Style.hoverFillFor(root.bar.foreground, Commons.Color.accent)
currentFill: Style.selectedFillFor(root.bar.foreground, Commons.Color.accent)
implicitHeight: monitorInner.implicitHeight + Style.spacing.xl
opacity: canToggle ? 1.0 : 0.45
+8 -11
View File
@@ -6,6 +6,7 @@ import Quickshell.Io
import Quickshell.Networking
import qs.Ui
import qs.Commons
import qs.Commons as Commons
import "Model.js" as Model
Panel {
@@ -291,8 +292,8 @@ Panel {
// `selectedIndex`). Mouse hover and keyboard nav both mutate this state
// at the root; items never read containsMouse for visuals. See
// CursorSurface for the shared chrome shared by rows and pills.
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "transparent"
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Commons.Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Commons.Color.accent) : "transparent"
// scannerEnabled lives on the shared WifiDevice, which has no reference
// counting, and a bar widget is instantiated once per monitor. Tracking the
@@ -1245,32 +1246,28 @@ Panel {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Button {
PanelActionButton {
id: qrAction
visible: root.canShareWifi
iconText: "󰐲"
tooltipText: "Show QR code"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
iconSize: Style.font.subtitle * 1.5
horizontalPadding: Style.space(5)
verticalPadding: Style.space(2)
fontSize: Style.font.subtitle * 1.5
hasCursor: root.qrHeaderHasCursor
Layout.alignment: Qt.AlignVCenter
onHovered: function(on) { if (on) root.setHeaderCursor(root.qrHeaderIndex) }
onClicked: root.summonWifiQr()
}
Button {
PanelActionButton {
id: speedAction
visible: root.canRunSpeedTest
iconText: "󰓅"
tooltipText: "Run a speed test"
foreground: root.bar.foreground
fontFamily: root.bar.fontFamily
iconSize: Style.font.subtitle * 1.5
horizontalPadding: Style.space(5)
verticalPadding: Style.space(2)
fontSize: Style.font.subtitle * 1.5
hasCursor: root.speedHeaderHasCursor
Layout.alignment: Qt.AlignVCenter
onHovered: function(on) { if (on) root.setHeaderCursor(root.speedHeaderIndex) }
@@ -2078,7 +2075,7 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
height: Style.spacing.controlHeight
color: Style.normalFillFor(root.bar.foreground)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Color.accent)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent)
radius: Style.cornerRadius
Text {
+2 -1
View File
@@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Io
import Quickshell.Services.UPower
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
@@ -88,7 +89,7 @@ Panel {
}
readonly property color batteryFillColor: {
return root.bar ? root.bar.foreground : Color.foreground
return root.bar ? root.bar.foreground : Commons.Color.foreground
}
// Cute agent-flavored phrases shown in the hero status line, rotated on a
+6 -5
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
Panel {
@@ -37,8 +38,8 @@ Panel {
]
readonly property string heroPhraseText: activePhrases[phraseIndex % activePhrases.length]
readonly property color foreground: bar ? bar.foreground : Color.foreground
readonly property color urgent: bar ? bar.urgent : Color.urgent
readonly property color foreground: bar ? bar.foreground : Commons.Color.foreground
readonly property color urgent: bar ? bar.urgent : Commons.Color.urgent
readonly property color dim: Qt.darker(foreground, 1.55)
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family
readonly property bool showConnections: tailscale.accounts.length > 1 || tailscale.accountsAccessDenied
@@ -54,8 +55,8 @@ Panel {
readonly property color iconColor: tailscale.active ? foreground : dim
readonly property string toggleHint: tailscale.active ? "Turn Tailscale off" : (tailscale.needsLogin ? "Authorize this device" : "Turn Tailscale on")
readonly property color barIconColor: tailscale.active ? barForeground : Qt.darker(barForeground, 1.55)
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "transparent"
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Commons.Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Commons.Color.accent) : "transparent"
function selectedPeer() {
if (tailscale.peers.length === 0) return null
@@ -1035,7 +1036,7 @@ Panel {
}
}
background: BorderSurface {
color: Color.background
color: Commons.Color.background
borderSpec: Border.flat(root.dim, 1)
radius: Style.cornerRadius
}
@@ -1,13 +1,14 @@
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
Item {
id: root
property real iconSize: Style.font.icon
property color color: Color.foreground
property color badgeColor: Color.urgent
property color color: Commons.Color.foreground
property color badgeColor: Commons.Color.urgent
property bool crossed: false
property bool warning: false
@@ -51,12 +52,12 @@ Item {
color: root.badgeColor
anchors.right: parent.right
anchors.bottom: parent.bottom
borderSpec: Border.flat(Color.popups.background, 1)
borderSpec: Border.flat(Commons.Color.popups.background, 1)
Text {
anchors.centerIn: parent
text: "!"
color: Color.background
color: Commons.Color.background
font.family: Style.font.family
font.pixelSize: Math.max(6, parent.height * 0.72)
font.bold: true
+4 -3
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "Model.js" as Model
@@ -646,7 +647,7 @@ Panel {
height: Style.space(18)
anchors.verticalCenter: parent.verticalCenter
radius: Math.min(4, Style.cornerRadius)
color: !root.savingLocation && clearLocationArea.containsMouse ? Style.hoverFillFor(root.bar.foreground, Color.accent) : "transparent"
color: !root.savingLocation && clearLocationArea.containsMouse ? Style.hoverFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
Text {
textFormat: Text.PlainText
@@ -752,7 +753,7 @@ Panel {
width: parent.width
height: suggestionRow.implicitHeight + Style.space(12)
radius: Style.cornerRadius
color: index === root.suggestionIndex ? Style.hoverFillFor(root.bar.foreground, Color.accent) : "transparent"
color: index === root.suggestionIndex ? Style.hoverFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
Row {
id: suggestionRow
@@ -764,7 +765,7 @@ Panel {
Text {
textFormat: Text.PlainText
text: modelData.name
color: index === root.suggestionIndex ? Style.hoverStateColor(root.bar.foreground, Color.accent) : root.bar.foreground
color: index === root.suggestionIndex ? Style.hoverStateColor(root.bar.foreground, Commons.Color.accent) : root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: Style.font.body
}
+13 -12
View File
@@ -4,6 +4,7 @@ import Quickshell.Io
import Quickshell.Services.Polkit
import Quickshell.Wayland
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "PolkitModel.js" as PolkitModel
@@ -11,14 +12,14 @@ Item {
id: root
property string fontFamily: Style.font.menuFamily
// Bound to the central [polkit] section in shell.toml via Color.qml.
property color accent: Color.polkit.accent
property color background: Color.polkit.background
property color foreground: Color.polkit.text
property color border: Color.polkit.border
property color borderError: Color.polkit.borderError
// Bound to the central [polkit] section in shell.toml via Commons.Color.qml.
property color accent: Commons.Color.polkit.accent
property color background: Commons.Color.polkit.background
property color foreground: Commons.Color.polkit.text
property color border: Commons.Color.polkit.border
property color borderError: Commons.Color.polkit.borderError
property var borderSpec: Border.surfaceSpec("polkit", errorFlash ? "border-error" : "border", errorFlash ? borderError : border, Math.max(1, Style.space(2)), "border-alpha")
property color scrim: Color.polkit.scrim
property color scrim: Commons.Color.polkit.scrim
readonly property int cornerRadius: Style.cornerRadius
property int contentMargin: Style.spacing.panelPadding
property int fieldHeight: Math.max(Style.space(42), Style.spacing.controlHeight)
@@ -278,7 +279,7 @@ Item {
text: "\udb80\ude37"
fontFamily: root.fontFamily
fontSize: Math.round(root.fieldHeight * 0.7)
color: root.errorFlash ? Color.polkit.textError : root.accent
color: root.errorFlash ? Commons.Color.polkit.textError : root.accent
}
Row {
@@ -293,7 +294,7 @@ Item {
Text {
text: "\uf023"
color: root.errorFlash ? Color.polkit.textError : root.accent
color: root.errorFlash ? Commons.Color.polkit.textError : root.accent
font.family: root.fontFamily
font.pixelSize: Style.font.iconLarge
width: Style.space(26)
@@ -318,7 +319,7 @@ Item {
font.pixelSize: Style.font.iconLarge
echoMode: root.responseVisible ? TextInput.Normal : TextInput.Password
passwordCharacter: "\u2022"
color: root.errorFlash ? Color.polkit.textError : root.foreground
color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
cursorVisible: activeFocus && !root.submitted && !root.errorFlash
readOnly: root.submitted || root.errorFlash
enabled: root.dialogVisible
@@ -337,7 +338,7 @@ Item {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: root.errorFlash ? "Wrong" : (root.submitted ? "Checking..." : "Enter password")
color: root.errorFlash ? Color.polkit.textError : root.foreground
color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
opacity: root.errorFlash ? 1 : 0.36
font.family: root.fontFamily
font.pixelSize: Style.font.iconLarge
@@ -350,7 +351,7 @@ Item {
height: Style.space(24)
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
color: root.errorFlash ? Color.polkit.textError : root.foreground
color: root.errorFlash ? Commons.Color.polkit.textError : root.foreground
visible: passwordInput.visible && passwordInput.activeFocus && passwordInput.text.length === 0 && !root.submitted && !root.errorFlash
}
+5 -4
View File
@@ -2,6 +2,7 @@ import Quickshell
import Quickshell.Wayland
import QtQuick
import qs.Commons
import qs.Commons as Commons
import qs.Ui
import "ReminderFlowModel.js" as ReminderFlowModel
@@ -18,11 +19,11 @@ Item {
property string filterText: ""
property string fontFamily: Style.font.menuFamily
property color background: Color.menu.background
property color foreground: Color.menu.text
property color border: Color.menu.border
property color background: Commons.Color.menu.background
property color foreground: Commons.Color.menu.text
property color border: Commons.Color.menu.border
property var borderSpec: Border.surfaceSpec("menu", "border", border, Math.max(1, Style.space(2)))
property color scrim: Color.menu.scrim
property color scrim: Commons.Color.menu.scrim
readonly property int cornerRadius: Style.cornerRadius
property int contentMargin: Style.spacing.panelPadding
property int headerHeight: Math.max(Style.space(34), Style.font.title + Style.spacing.controlPaddingY * 2)
+5 -4
View File
@@ -2,6 +2,7 @@ import QtQuick
import Quickshell
import qs.Ui
import qs.Commons
import qs.Commons as Commons
BarWidget {
id: root
@@ -125,8 +126,8 @@ BarWidget {
width: Style.space(64)
height: Style.space(64)
radius: Style.spacing.labelGap
color: Style.normalFillFor(root.bar.foreground, Color.accent)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Color.accent)
color: Style.normalFillFor(root.bar.foreground, Commons.Color.accent)
borderSpec: Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent)
Image {
anchors.fill: parent
@@ -249,8 +250,8 @@ BarWidget {
width: sourceList.width
height: sourceInner.implicitHeight + Style.space(10)
radius: Style.spacing.labelGap
color: selected ? Style.selectedFillFor(root.bar.foreground, Color.accent) : "transparent"
borderSpec: selected ? Border.controlSpec("normal", root.bar.foreground, Color.accent) : Border.none()
color: selected ? Style.selectedFillFor(root.bar.foreground, Commons.Color.accent) : "transparent"
borderSpec: selected ? Border.controlSpec("normal", root.bar.foreground, Commons.Color.accent) : Border.none()
Row {
id: sourceInner