mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2026-09-19 18:19:02 +05:30
style: format qml files
This commit is contained in:
@@ -5,56 +5,56 @@ import Quickshell.Hyprland
|
||||
import qs.config
|
||||
|
||||
Row {
|
||||
id: root
|
||||
id: root
|
||||
|
||||
property int count: 7
|
||||
property int count: 7
|
||||
|
||||
spacing: Appearance.spacing
|
||||
spacing: Appearance.spacing
|
||||
|
||||
Repeater {
|
||||
model: root.count
|
||||
Repeater {
|
||||
model: root.count
|
||||
|
||||
Rectangle {
|
||||
id: pill
|
||||
Rectangle {
|
||||
id: pill
|
||||
|
||||
required property int index
|
||||
property var ws: Hyprland.workspaces.values.find(w => w.id === pill.index + 1)
|
||||
property bool isActive: Hyprland.focusedWorkspace?.id === (pill.index + 1)
|
||||
required property int index
|
||||
property var ws: Hyprland.workspaces.values.find(w => w.id === pill.index + 1)
|
||||
property bool isActive: Hyprland.focusedWorkspace?.id === (pill.index + 1)
|
||||
|
||||
radius: 1000
|
||||
implicitHeight: 15
|
||||
implicitWidth: pill.isActive ? pill.implicitHeight * 2.3 : pill.implicitHeight
|
||||
color: {
|
||||
if (handler.hovered)
|
||||
return Appearance.colors.accent;
|
||||
if (pill.isActive || pill.ws)
|
||||
return Appearance.colors.accent;
|
||||
return Appearance.colors.inActive;
|
||||
}
|
||||
radius: 1000
|
||||
implicitHeight: 15
|
||||
implicitWidth: pill.isActive ? pill.implicitHeight * 2.3 : pill.implicitHeight
|
||||
color: {
|
||||
if (handler.hovered)
|
||||
return Appearance.colors.accent;
|
||||
if (pill.isActive || pill.ws)
|
||||
return Appearance.colors.accent;
|
||||
return Appearance.colors.inActive;
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: Hyprland.dispatch("workspace " + (pill.index + 1))
|
||||
}
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: Hyprland.dispatch("workspace " + (pill.index + 1))
|
||||
}
|
||||
|
||||
HoverHandler {
|
||||
id: handler
|
||||
}
|
||||
HoverHandler {
|
||||
id: handler
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Appearance.duration
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Appearance.duration
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: Appearance.duration
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
duration: Appearance.duration
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user