Compare commits

..

No commits in common. "0f7dbb804179a9d6ab97cc3832adf813d22f947a" and "c5ac7fe773d989990dda1c23d8752bd71f41a6bd" have entirely different histories.

3 changed files with 59 additions and 43 deletions

View file

@ -1,42 +1,70 @@
import qs.components pragma ComponentBehavior: Bound
import qs.config import qs.config
import qs.constants import qs.constants
import qs.widgets
import QtQuick import QtQuick
import Quickshell.Hyprland import Quickshell.Hyprland
StyledIconButton { Loader {
id: root id: root
required property HyprlandWorkspace modelData
required property HyprlandWorkspace workspace active: modelData.id > 0
text: Icons.triangle sourceComponent: workspace
font.bold: true property Component workspace: StyledButton {
font.pixelSize: 17 id: clickable
padding: 8
onClicked: root.workspace.activate() onClicked: root.modelData.activate()
states: [ content: Text {
State { id: icon
name: "focused"
when: root.workspace.focused font.family: Theme.lucide.font.family
PropertyChanges { font.pixelSize: Dimensions.workspace.iconSize
root { font.bold: true
rotation: 180 text: Icons.triangle
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary
color: Theme.palette.basecontent
states: [
State {
name: "focused"
when: root.modelData.focused
PropertyChanges {
icon {
rotation: 180
color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary
}
}
},
State {
name: "active"
when: root.modelData.active
PropertyChanges {
icon {
text: Icons.triangleDashed
rotation: 180
color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary
}
}
} }
} ]
},
State { transitions: Transition {
name: "active" reversible: true
when: root.workspace.active ParallelAnimation {
PropertyChanges { RotationAnimation {
root { duration: 200
text: Icons.triangleDashed easing.type: Easing.InOutCubic
rotation: 180 }
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary ColorAnimation {
duration: 200
easing.type: Easing.OutCubic
}
} }
} }
} }
] }
} }

View file

@ -1,5 +1,3 @@
pragma ComponentBehavior: Bound
import qs.config import qs.config
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
@ -14,16 +12,6 @@ RowLayout {
model: Hyprland.workspaces model: Hyprland.workspaces
Loader { Workspace {}
id: loader
required property HyprlandWorkspace modelData
active: modelData.id > 0
sourceComponent: workspace
property Component workspace: Workspace {
workspace: loader.modelData
}
}
} }
} }

View file

@ -1,20 +1,20 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import qs.components import qs.widgets
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Services.SystemTray import Quickshell.Services.SystemTray
import Quickshell.Widgets import Quickshell.Widgets
import "menu/" import "menu/"
StyledIconButton { StyledButton {
id: root id: root
property SystemTrayItem trayItem property SystemTrayItem trayItem
onClicked: menu.toggle() onClicked: menu.toggle()
contentItem: IconImage { content: IconImage {
id: icon id: icon
asynchronous: true asynchronous: true
implicitSize: 18 implicitSize: 18