use root reference
This commit is contained in:
parent
23fa99ed4c
commit
24f932f8d1
1 changed files with 6 additions and 3 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.constants
|
import qs.constants
|
||||||
import qs.widgets
|
import qs.widgets
|
||||||
|
|
@ -5,6 +7,7 @@ import QtQuick
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
id: root
|
||||||
required property HyprlandWorkspace modelData
|
required property HyprlandWorkspace modelData
|
||||||
|
|
||||||
active: modelData.id > 0
|
active: modelData.id > 0
|
||||||
|
|
@ -13,7 +16,7 @@ Loader {
|
||||||
property Component workspace: StyledButton {
|
property Component workspace: StyledButton {
|
||||||
id: clickable
|
id: clickable
|
||||||
|
|
||||||
onClicked: modelData.activate()
|
onClicked: root.modelData.activate()
|
||||||
|
|
||||||
content: Text {
|
content: Text {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
@ -28,7 +31,7 @@ Loader {
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "focused"
|
name: "focused"
|
||||||
when: modelData.focused
|
when: root.modelData.focused
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
icon {
|
icon {
|
||||||
rotation: 180
|
rotation: 180
|
||||||
|
|
@ -38,7 +41,7 @@ Loader {
|
||||||
},
|
},
|
||||||
State {
|
State {
|
||||||
name: "active"
|
name: "active"
|
||||||
when: modelData.active
|
when: root.modelData.active
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
icon {
|
icon {
|
||||||
text: Icons.triangleDashed
|
text: Icons.triangleDashed
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue