flyout position, theme
This commit is contained in:
parent
b969f0824f
commit
d208e264e2
1 changed files with 32 additions and 25 deletions
|
|
@ -15,29 +15,37 @@ PanelWindow {
|
||||||
WlrLayershell.exclusiveZone: 0
|
WlrLayershell.exclusiveZone: 0
|
||||||
WlrLayershell.namespace: "nova-flyout"
|
WlrLayershell.namespace: "nova-flyout"
|
||||||
|
|
||||||
anchors {
|
anchors.top: true
|
||||||
top: true
|
anchors.left: true
|
||||||
left: true
|
|
||||||
right: true
|
|
||||||
}
|
|
||||||
|
|
||||||
margins.top: M.Theme.barHeight + 4
|
// Flush below bar, centered on hovered item
|
||||||
implicitHeight: box.implicitHeight + 8
|
margins.top: M.Theme.barHeight
|
||||||
|
margins.left: Math.max(0, Math.min(
|
||||||
|
Math.round(M.FlyoutState.itemX - implicitWidth / 2),
|
||||||
|
screen.width - implicitWidth
|
||||||
|
))
|
||||||
|
|
||||||
|
implicitWidth: label.implicitWidth + M.Theme.barPadding * 2
|
||||||
|
implicitHeight: label.implicitHeight + M.Theme.barPadding * 2
|
||||||
|
|
||||||
|
// Background matching bar style
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: box
|
anchors.fill: parent
|
||||||
|
color: M.Theme.base00
|
||||||
x: Math.max(4, Math.min(M.FlyoutState.itemX - implicitWidth / 2, parent.width - implicitWidth - 4))
|
opacity: M.Theme.barOpacity
|
||||||
y: 4
|
|
||||||
|
|
||||||
implicitWidth: label.implicitWidth + 16
|
|
||||||
implicitHeight: label.implicitHeight + 12
|
|
||||||
|
|
||||||
color: M.Theme.base01
|
|
||||||
border.color: M.Theme.base03
|
|
||||||
border.width: 1
|
|
||||||
radius: M.Theme.radius
|
radius: M.Theme.radius
|
||||||
|
|
||||||
|
// Cover the top rounded corners so the flyout
|
||||||
|
// appears flush / attached to the bar above
|
||||||
|
Rectangle {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: parent.radius
|
||||||
|
color: M.Theme.base00
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: label
|
id: label
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -47,4 +55,3 @@ PanelWindow {
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue