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:
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user