mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-06 12:39:35 +02:00
Refine shell panel and lock theming
This commit is contained in:
@@ -40,6 +40,8 @@ Item {
|
||||
property bool useTransparentForeground: false
|
||||
property bool transparent: false
|
||||
property bool centerSectionHovered: false
|
||||
property bool centerSectionRevealHeld: false
|
||||
property bool centerHoverRevealSuppressed: false
|
||||
property int barConfigSerial: 0
|
||||
property string position: "top"
|
||||
// Resolves through fontconfig at paint time (Style.font.family defaults
|
||||
@@ -374,6 +376,22 @@ Item {
|
||||
|
||||
Component.onCompleted: applyBarConfig()
|
||||
|
||||
function setCenterSectionHovered(hovered) {
|
||||
centerSectionHovered = hovered
|
||||
if (hovered) {
|
||||
centerSectionRevealTimer.stop()
|
||||
centerSectionRevealHeld = true
|
||||
} else {
|
||||
centerSectionRevealTimer.restart()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: centerSectionRevealTimer
|
||||
interval: 120
|
||||
onTriggered: root.centerSectionRevealHeld = root.centerSectionHovered
|
||||
}
|
||||
|
||||
function run(command) {
|
||||
if (!command) return
|
||||
|
||||
@@ -970,7 +988,7 @@ Item {
|
||||
CenterGestureArea { anchors.fill: parent }
|
||||
|
||||
HoverHandler {
|
||||
onHoveredChanged: root.centerSectionHovered = hovered
|
||||
onHoveredChanged: root.setCenterSectionHovered(hovered)
|
||||
}
|
||||
|
||||
ModuleList {
|
||||
@@ -1001,7 +1019,7 @@ Item {
|
||||
|
||||
visible: centerRoot.hasAnchor && centerAnchorModule.moduleName === "omarchy.clock"
|
||||
clockHovered: centerAnchorModule.hovered
|
||||
centerHovered: root.centerSectionHovered
|
||||
centerHovered: root.centerSectionRevealHeld && !root.centerHoverRevealSuppressed
|
||||
anchors.right: centerAnchorModule.left
|
||||
anchors.verticalCenter: centerAnchorModule.verticalCenter
|
||||
}
|
||||
@@ -1025,7 +1043,7 @@ Item {
|
||||
CenterGestureArea { anchors.fill: parent }
|
||||
|
||||
HoverHandler {
|
||||
onHoveredChanged: root.centerSectionHovered = hovered
|
||||
onHoveredChanged: root.setCenterSectionHovered(hovered)
|
||||
}
|
||||
|
||||
ModuleList {
|
||||
@@ -1056,7 +1074,7 @@ Item {
|
||||
|
||||
visible: centerRoot.hasAnchor && centerAnchorModule.moduleName === "omarchy.clock"
|
||||
clockHovered: centerAnchorModule.hovered
|
||||
centerHovered: root.centerSectionHovered
|
||||
centerHovered: root.centerSectionRevealHeld && !root.centerHoverRevealSuppressed
|
||||
anchors.bottom: centerAnchorModule.top
|
||||
anchors.horizontalCenter: centerAnchorModule.horizontalCenter
|
||||
}
|
||||
@@ -1098,13 +1116,8 @@ Item {
|
||||
implicitHeight: button.implicitHeight
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
opacity: revealed ? 1.0 : 0
|
||||
z: 500
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 120; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
HoverHandler { id: controlHover }
|
||||
|
||||
Component.onCompleted: root.registerConfigControl(configControl)
|
||||
|
||||
@@ -17,7 +17,7 @@ BarWidget {
|
||||
property bool indicatorAreaHovered: false
|
||||
property bool indicatorItemHovered: false
|
||||
readonly property bool alwaysShowIndicators: setting("alwaysShow", false) === true
|
||||
readonly property bool revealInactiveIndicators: alwaysShowIndicators || indicatorAreaHovered || indicatorItemHovered || (bar && bar.centerSectionHovered === true)
|
||||
readonly property bool revealInactiveIndicators: alwaysShowIndicators || indicatorAreaHovered || indicatorItemHovered || (bar && bar.centerSectionRevealHeld === true && bar.centerHoverRevealSuppressed !== true)
|
||||
|
||||
signal refreshRequested()
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Item {
|
||||
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.hyprlandActiveSpec(Color.accent, root.outlineThickness)
|
||||
: Border.surfaceSpec("lock", "border-active", Color.lock.borderActive, root.outlineThickness, "border-alpha")
|
||||
|
||||
signal submitPassword(string password)
|
||||
signal passwordTextEdited(string password)
|
||||
|
||||
@@ -9,17 +9,38 @@ Panel {
|
||||
id: root
|
||||
moduleName: "omarchy.weather"
|
||||
ipcTarget: "omarchy.weather"
|
||||
manageIpc: false
|
||||
|
||||
property var anchorItem: null
|
||||
property bool openedFromHotkey: false
|
||||
|
||||
function open() {
|
||||
openedFromHotkey = false
|
||||
setCenterHoverRevealSuppressed(false)
|
||||
root.controller.show()
|
||||
root.refresh()
|
||||
}
|
||||
|
||||
function openFromHotkey() {
|
||||
openedFromHotkey = true
|
||||
setCenterHoverRevealSuppressed(true)
|
||||
root.controller.show()
|
||||
root.refresh()
|
||||
}
|
||||
|
||||
function close() {
|
||||
setCenterHoverRevealSuppressed(false)
|
||||
root.controller.hide()
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (root.opened) root.close()
|
||||
else root.open()
|
||||
else root.openFromHotkey()
|
||||
}
|
||||
|
||||
function setCenterHoverRevealSuppressed(value) {
|
||||
if (root.bar && "centerHoverRevealSuppressed" in root.bar)
|
||||
root.bar.centerHoverRevealSuppressed = value
|
||||
}
|
||||
|
||||
// Parsed wttr.in j1 response. Kept on failure so stale data stays visible.
|
||||
@@ -190,29 +211,45 @@ Panel {
|
||||
onTriggered: root.refresh()
|
||||
}
|
||||
|
||||
PopupCard {
|
||||
id: popup
|
||||
IpcHandler {
|
||||
target: root.ipcTarget
|
||||
|
||||
function open(): void { root.openFromHotkey() }
|
||||
function close(): void { root.close() }
|
||||
function show(): void { root.openFromHotkey() }
|
||||
function hide(): void { root.close() }
|
||||
function toggle(): void { root.toggle() }
|
||||
}
|
||||
|
||||
KeyboardPanel {
|
||||
id: panel
|
||||
anchorItem: root.anchorItem
|
||||
owner: root
|
||||
bar: root.bar
|
||||
open: root.opened
|
||||
centerOnBar: true
|
||||
triggerMode: "click"
|
||||
contentWidth: popup.fittedContentWidth(Style.space(480))
|
||||
contentHeight: popup.fittedContentHeight(weatherColumn.implicitHeight)
|
||||
focusTarget: keyCatcher
|
||||
contentWidth: panel.fittedContentWidth(Style.space(480))
|
||||
contentHeight: panel.fittedContentHeight(weatherColumn.implicitHeight)
|
||||
|
||||
Flickable {
|
||||
id: weatherScroll
|
||||
PanelKeyCatcher {
|
||||
id: keyCatcher
|
||||
anchors.fill: parent
|
||||
contentWidth: width
|
||||
contentHeight: weatherColumn.implicitHeight
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
onCloseRequested: root.close()
|
||||
onTabRequested: function(direction) { root.switchPanel(direction) }
|
||||
|
||||
Column {
|
||||
id: weatherColumn
|
||||
width: weatherScroll.width
|
||||
spacing: Style.space(14)
|
||||
Flickable {
|
||||
id: weatherScroll
|
||||
anchors.fill: parent
|
||||
contentWidth: width
|
||||
contentHeight: weatherColumn.implicitHeight
|
||||
clip: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
Column {
|
||||
id: weatherColumn
|
||||
width: weatherScroll.width
|
||||
spacing: Style.space(14)
|
||||
|
||||
// ---- Hero row: big icon + temp on the left; location and stats stacked on the right.
|
||||
Item {
|
||||
@@ -431,6 +468,7 @@ Panel {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Poll the weather pill text/class every minute. Local to this widget.
|
||||
Process {
|
||||
|
||||
Reference in New Issue
Block a user