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
property Component workspace: StyledButton {
id: clickable
onClicked: root.modelData.activate()
content: Text {
id: icon
font.family: Theme.lucide.font.family
font.pixelSize: Dimensions.workspace.iconSize
font.bold: true font.bold: true
font.pixelSize: 17 text: Icons.triangle
padding: 8
onClicked: root.workspace.activate() color: Theme.palette.basecontent
states: [ states: [
State { State {
name: "focused" name: "focused"
when: root.workspace.focused when: root.modelData.focused
PropertyChanges { PropertyChanges {
root { icon {
rotation: 180 rotation: 180
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary
} }
} }
}, },
State { State {
name: "active" name: "active"
when: root.workspace.active when: root.modelData.active
PropertyChanges { PropertyChanges {
root { icon {
text: Icons.triangleDashed text: Icons.triangleDashed
rotation: 180 rotation: 180
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary color: clickable.hovered ? Theme.palette.basecontent : Theme.palette.primary
} }
} }
} }
] ]
transitions: Transition {
reversible: true
ParallelAnimation {
RotationAnimation {
duration: 200
easing.type: Easing.InOutCubic
}
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