quickshell: underline workspaces, dropdown tray
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
69a72e9406
commit
d63693e87a
1 changed files with 75 additions and 27 deletions
|
|
@ -573,6 +573,7 @@ in
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
|
id: bar
|
||||||
required property var modelData
|
required property var modelData
|
||||||
screen: modelData
|
screen: modelData
|
||||||
|
|
||||||
|
|
@ -582,7 +583,7 @@ in
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitHeight: 32
|
implicitHeight: 30
|
||||||
color: "#${c.base00}"
|
color: "#${c.base00}"
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
@ -597,12 +598,10 @@ in
|
||||||
Repeater {
|
Repeater {
|
||||||
model: Hyprland.workspaces
|
model: Hyprland.workspaces
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
Layout.preferredWidth: 32
|
Layout.preferredWidth: 28
|
||||||
Layout.preferredHeight: 32
|
Layout.preferredHeight: 30
|
||||||
color: modelData.focused ? "#${c.base02}" : "transparent"
|
|
||||||
radius: 6
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -610,7 +609,16 @@ in
|
||||||
color: modelData.focused ? "#${c.base05}" : "#${c.base03}"
|
color: modelData.focused ? "#${c.base05}" : "#${c.base03}"
|
||||||
font.family: "FiraMono Nerd Font"
|
font.family: "FiraMono Nerd Font"
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
font.weight: modelData.focused ? Font.Bold : Font.Normal
|
}
|
||||||
|
|
||||||
|
// Underline indicator
|
||||||
|
Rectangle {
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: parent.width - 8
|
||||||
|
height: 2
|
||||||
|
color: "#${c.base05}"
|
||||||
|
visible: modelData.focused
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -624,29 +632,69 @@ in
|
||||||
// Spacer
|
// Spacer
|
||||||
Item { Layout.fillWidth: true }
|
Item { Layout.fillWidth: true }
|
||||||
|
|
||||||
// System tray
|
// Tray toggle button
|
||||||
RowLayout {
|
Item {
|
||||||
spacing: 4
|
Layout.preferredWidth: 28
|
||||||
Layout.rightMargin: 8
|
Layout.preferredHeight: 30
|
||||||
|
Layout.rightMargin: 6
|
||||||
|
|
||||||
Repeater {
|
Text {
|
||||||
model: SystemTray.items
|
anchors.centerIn: parent
|
||||||
|
text: "\ue0b2"
|
||||||
|
color: "#${c.base05}"
|
||||||
|
font.family: "FiraMono Nerd Font"
|
||||||
|
font.pixelSize: 13
|
||||||
|
textFormat: Text.PlainText
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
MouseArea {
|
||||||
required property var modelData
|
anchors.fill: parent
|
||||||
source: modelData.icon
|
onClicked: trayPopup.visible = !trayPopup.visible
|
||||||
Layout.preferredWidth: 18
|
}
|
||||||
Layout.preferredHeight: 18
|
}
|
||||||
smooth: true
|
}
|
||||||
|
|
||||||
MouseArea {
|
PopupWindow {
|
||||||
anchors.fill: parent
|
id: trayPopup
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
anchor.window: bar
|
||||||
onClicked: (event) => {
|
anchor.rect.x: bar.width - 220
|
||||||
if (event.button === Qt.RightButton && parent.modelData.hasMenu) {
|
anchor.rect.y: bar.height
|
||||||
parent.modelData.menu.open();
|
visible: false
|
||||||
} else {
|
color: "#${c.base00}"
|
||||||
parent.modelData.activate();
|
implicitWidth: trayRow.width + 24
|
||||||
|
implicitHeight: 40
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#${c.base00}"
|
||||||
|
border.color: "#${c.base03}"
|
||||||
|
border.width: 1
|
||||||
|
radius: 8
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: trayRow
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: SystemTray.items
|
||||||
|
|
||||||
|
Image {
|
||||||
|
required property var modelData
|
||||||
|
source: modelData.icon
|
||||||
|
Layout.preferredWidth: 18
|
||||||
|
Layout.preferredHeight: 18
|
||||||
|
smooth: true
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
onClicked: (event) => {
|
||||||
|
if (event.button === Qt.RightButton && parent.modelData.hasMenu) {
|
||||||
|
parent.modelData.menu.open();
|
||||||
|
} else {
|
||||||
|
parent.modelData.activate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue