flyout tooltips
This commit is contained in:
parent
e3ba80fd0d
commit
99f71f858d
8 changed files with 113 additions and 39 deletions
50
modules/Flyout.qml
Normal file
50
modules/Flyout.qml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import "." as M
|
||||
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
required property var screen
|
||||
|
||||
visible: M.FlyoutState.visible && M.FlyoutState.screen === screen
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.exclusiveZone: 0
|
||||
WlrLayershell.namespace: "nova-flyout"
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
margins.top: M.Theme.barHeight + 4
|
||||
implicitHeight: box.implicitHeight + 8
|
||||
|
||||
Rectangle {
|
||||
id: box
|
||||
|
||||
x: Math.max(4, Math.min(M.FlyoutState.itemX - implicitWidth / 2, parent.width - implicitWidth - 4))
|
||||
y: 4
|
||||
|
||||
implicitWidth: label.implicitWidth + 16
|
||||
implicitHeight: label.implicitHeight + 12
|
||||
|
||||
color: M.Theme.base01
|
||||
border.color: M.Theme.base03
|
||||
border.width: 1
|
||||
radius: 4
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
text: M.FlyoutState.text
|
||||
color: M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.fontFamily
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue