Merge remote-tracking branch 'origin/omarchy-shell' into omarchy-shell

# Conflicts:
#	shell/Ui/PillButton.qml
#	shell/plugins/bar/widgets/monitorPanel.qml
#	shell/plugins/bar/widgets/networkPanel.qml
This commit is contained in:
Ryan Hughes
2026-05-18 21:11:37 -04:00
12 changed files with 691 additions and 188 deletions
+10 -1
View File
@@ -41,6 +41,7 @@ Rectangle {
property real fontSize: Style.font.body
property real iconSize: Style.font.icon
property real iconRotation: 0
property bool iconSpinning: false
property real horizontalPadding: Style.spacing.controlPaddingX
property real verticalPadding: Style.spacing.controlPaddingY
property bool leftAlign: false
@@ -132,9 +133,17 @@ Rectangle {
color: root.selected ? root._selectedColor : root.foreground
font.family: root.fontFamily
font.pixelSize: root.iconSize
rotation: root.iconRotation
rotation: root.iconSpinning ? 0 : root.iconRotation
transformOrigin: Item.Center
anchors.verticalCenter: parent.verticalCenter
RotationAnimation on rotation {
from: 0
to: 360
duration: 900
loops: Animation.Infinite
running: root.iconSpinning
}
}
Text {
+52 -12
View File
@@ -83,20 +83,17 @@ PanelWindow {
right: true
}
// Clickable region = whole screen MINUS the bar's strip. Clicks on the
// bar pass through to the bar layer; clicks anywhere else are caught
// by us and either land on the card (no-op) or trigger dismissal.
readonly property real _barStripSize: bar ? bar.barSize : 0
// Clickable region is the whole screen. Clicks in the bar strip are
// forwarded to registered bar buttons so switching between panel icons
// works in one click even when the overlay surface is above the bar.
readonly property real _barStripSize: {
if (!bar) return 0
var actual = (root.barPos === "top" || root.barPos === "bottom") ? root.barH : root.barW
return Math.max(bar.barSize, actual) + root.gap
}
mask: Region {
width: root.screenW
height: root.screenH
Region {
x: root.barPos === "right" ? root.screenW - root._barStripSize : 0
y: root.barPos === "bottom" ? root.screenH - root._barStripSize : 0
width: (root.barPos === "top" || root.barPos === "bottom") ? root.screenW : root._barStripSize
height: (root.barPos === "top" || root.barPos === "bottom") ? root._barStripSize : root.screenH
intersection: Intersection.Subtract
}
}
// Track every layout change between the bar's contentItem and the
@@ -203,9 +200,52 @@ PanelWindow {
// during the fade-out so the dying overlay doesn't swallow clicks that
// were meant for the apps behind it.
MouseArea {
id: dismissArea
anchors.fill: parent
enabled: root.open
onClicked: root.closePopout()
hoverEnabled: true
property bool hoveringBar: false
cursorShape: hoveringBar ? Qt.PointingHandCursor : Qt.ArrowCursor
function inBarRegion(px, py) {
if (root.barPos === "bottom") return py >= root.screenH - root._barStripSize
if (root.barPos === "left") return px <= root._barStripSize
if (root.barPos === "right") return px >= root.screenW - root._barStripSize
return py <= root._barStripSize
}
function barPoint(px, py) {
if (root.barPos === "bottom") return Qt.point(px, py - (root.screenH - root.barH))
if (root.barPos === "right") return Qt.point(px - (root.screenW - root.barW), py)
return Qt.point(px, py)
}
function pressTargetAt(px, py) {
if (!root.anchorWindow || !root.anchorWindow.contentItem || !root.bar || !root.bar.clickTargets) return null
var p = barPoint(px, py)
var targets = root.bar.clickTargets
for (var i = targets.length - 1; i >= 0; i--) {
var target = targets[i]
if (!target || !target.triggerPress || target.visible === false || target.opacity === 0 || !target.mapToItem) continue
var pos = root.anchorWindow.itemPosition(target)
if (p.x >= pos.x && p.x <= pos.x + target.width && p.y >= pos.y && p.y <= pos.y + target.height) return target
}
return null
}
function forwardBarClick(px, py, button) {
var target = pressTargetAt(px, py)
if (!target) return false
target.triggerPress(button)
return true
}
onPositionChanged: function(mouse) { hoveringBar = inBarRegion(mouse.x, mouse.y) }
onExited: hoveringBar = false
onClicked: function(mouse) {
if (inBarRegion(mouse.x, mouse.y) && forwardBarClick(mouse.x, mouse.y, mouse.button)) return
root.closePopout()
}
}
// --- card ----------------------------------------------------------------
+1 -1
View File
@@ -77,7 +77,7 @@ Rectangle {
anchors.centerIn: parent
text: root.iconText
color: root.enabled
? (root._hot ? root.hoverColor : Qt.darker(root.foreground, 1.3))
? (root._hot ? root.hoverColor : root.foreground)
: Qt.darker(root.foreground, 2.0)
font.family: root.fontFamily
font.pixelSize: root.fontSize
+17 -4
View File
@@ -19,10 +19,26 @@ Item {
property real textRotation: 0
property bool keepSpace: false
property string tooltipText: ""
property var registeredBar: null
signal pressed(int button)
signal wheelMoved(int delta)
function triggerPress(button) {
if (root.bar) root.bar.hideTooltip(root)
root.pressed(button)
}
function syncClickRegistration() {
if (registeredBar && registeredBar.unregisterClickTarget) registeredBar.unregisterClickTarget(root)
registeredBar = root.bar
if (registeredBar && registeredBar.registerClickTarget) registeredBar.registerClickTarget(root)
}
onBarChanged: syncClickRegistration()
Component.onCompleted: syncClickRegistration()
Component.onDestruction: if (registeredBar && registeredBar.unregisterClickTarget) registeredBar.unregisterClickTarget(root)
readonly property bool vertical: bar ? bar.vertical : false
readonly property int barSize: bar ? bar.barSize : Style.bar.sizeHorizontal
readonly property real scaledHorizontalMargin: Style.spaceReal(horizontalMargin)
@@ -64,10 +80,7 @@ Item {
cursorShape: Qt.PointingHandCursor
onEntered: if (root.bar) root.bar.showTooltip(root, root.tooltipText)
onExited: if (root.bar) root.bar.hideTooltip(root)
onClicked: function(mouse) {
if (root.bar) root.bar.hideTooltip(root)
root.pressed(mouse.button)
}
onClicked: function(mouse) { root.triggerPress(mouse.button) }
onWheel: function(wheel) { root.wheelMoved(wheel.angleDelta.y) }
}
}