feat: make right bar side dependant on devices
This commit is contained in:
1 parent
91c28f5b37
commit
afa7d5db96
13 files changed
+630
-17
No files matched your search
@@ -0,0 +1,67 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "../Shared"
|
||||
|
||||
// Full-screen, click-through overlay used to render tray icon tooltips.
|
||||
// Kept as its own window so the Bar's own surface can stay exactly as tall
|
||||
// as the pill itself (no shadow/margin bloat from an oversized surface).
|
||||
PanelWindow {
|
||||
id: tooltipWindow
|
||||
|
||||
property string shownText: ""
|
||||
property real anchorX: 0
|
||||
property real anchorY: 0
|
||||
|
||||
function showAt(x, y, text) {
|
||||
anchorX = x;
|
||||
anchorY = y;
|
||||
shownText = text;
|
||||
}
|
||||
|
||||
function hide() {
|
||||
shownText = "";
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
exclusiveZone: 0
|
||||
color: "transparent"
|
||||
visible: shownText.length > 0
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.namespace: "quickshell-tray-tooltip"
|
||||
|
||||
// Never accept input; this window only ever draws a small label.
|
||||
mask: Region {}
|
||||
|
||||
Rectangle {
|
||||
// anchorX is the icon's horizontal center; center this bubble on it,
|
||||
// clamped so it never runs past the screen edges.
|
||||
x: Math.max(
|
||||
Theme.geometry.spacing,
|
||||
Math.min(tooltipWindow.anchorX - width / 2, tooltipWindow.width - width - Theme.geometry.spacing)
|
||||
)
|
||||
y: tooltipWindow.anchorY
|
||||
radius: Theme.geometry.radius / 2
|
||||
color: Theme.colors.background
|
||||
border.color: Theme.colors.border
|
||||
border.width: 1
|
||||
width: label.implicitWidth + Theme.geometry.padding * 2
|
||||
height: label.implicitHeight + Theme.geometry.padding
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
text: tooltipWindow.shownText
|
||||
color: Theme.colors.text
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 11
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user