Change name of root id to root everywhere

This commit is contained in:
2025-10-13 14:35:32 -03:00
parent e4087938a5
commit 23eb623fae
13 changed files with 48 additions and 46 deletions

View File

@@ -6,7 +6,7 @@ import qs.Common.Styled
import qs.Services import qs.Services
BackgroundRectangle { BackgroundRectangle {
id: audioWidget id: root
property string monitor: "" property string monitor: ""
property string icon: " " property string icon: " "
@@ -20,26 +20,26 @@ BackgroundRectangle {
states: [ states: [
State { State {
name: "Mute" name: "Mute"
when: audioWidget.volume == 0 || audioWidget.sink.audio.muted when: root.volume == 0 || root.sink.audio.muted
PropertyChanges { PropertyChanges {
audioWidget.icon: " " root.icon: " "
} }
}, },
State { State {
name: "low volume" name: "low volume"
when: audioWidget.volume <= 25 when: root.volume <= 25
PropertyChanges { PropertyChanges {
audioWidget.icon: " " root.icon: " "
} }
}, },
State { State {
name: "high volume" name: "high volume"
when: audioWidget.volume > 25 when: root.volume > 25
PropertyChanges { PropertyChanges {
audioWidget.icon: " " root.icon: " "
} }
} }
] ]
@@ -50,23 +50,23 @@ BackgroundRectangle {
Connections { Connections {
function onVolumeChanged() { function onVolumeChanged() {
audioWidget.volume = Math.round(Pipewire.defaultAudioSink.audio.volume * 100); root.volume = Math.round(Pipewire.defaultAudioSink.audio.volume * 100);
} }
target: audioWidget.audioPipewireActive ? Pipewire.defaultAudioSink.audio : null target: root.audioPipewireActive ? Pipewire.defaultAudioSink.audio : null
} }
StyledText { StyledText {
id: audioText id: audioText
property string audioTextText: audioWidget.audioPipewireActive ? audioWidget.icon + " " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100).toString() + "%" : "" property string audioTextText: root.audioPipewireActive ? root.icon + " " + Math.round(Pipewire.defaultAudioSink.audio.volume * 100).toString() + "%" : ""
anchors.centerIn: parent anchors.centerIn: parent
text: audioTextText text: audioTextText
} }
Process { Process {
id: audioWidgetProcess id: rootProcess
running: false running: false
command: ["pavucontrol"] command: ["pavucontrol"]
@@ -77,7 +77,7 @@ BackgroundRectangle {
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
PopUpHover.start(audioWidget, "audio"); PopUpHover.start(root, "audio");
} }
onExited: { onExited: {
// PopUpHover.exit() // PopUpHover.exit()
@@ -87,7 +87,7 @@ BackgroundRectangle {
if (mouse.button === Qt.RightButton) { if (mouse.button === Qt.RightButton) {
parent.sink.audio.muted = !parent.sink.audio.muted; parent.sink.audio.muted = !parent.sink.audio.muted;
} else if (mouse.button === Qt.LeftButton) { } else if (mouse.button === Qt.LeftButton) {
audioWidgetProcess.startDetached(); rootProcess.startDetached();
} }
} }
onWheel: wheel => { onWheel: wheel => {
@@ -95,12 +95,12 @@ BackgroundRectangle {
if (0) if (0)
return; return;
Pipewire.defaultAudioSink.audio.volume = (audioWidget.volume + 5) / 100; Pipewire.defaultAudioSink.audio.volume = (root.volume + 5) / 100;
} else if (wheel.angleDelta.y < 0) { } else if (wheel.angleDelta.y < 0) {
if (0) if (0)
return; return;
Pipewire.defaultAudioSink.audio.volume = (audioWidget.volume - 5) / 100; Pipewire.defaultAudioSink.audio.volume = (root.volume - 5) / 100;
} }
} }
} }

View File

@@ -5,7 +5,7 @@ import Quickshell.Widgets
import qs.Common import qs.Common
WrapperRectangle { WrapperRectangle {
id: barArea id: root
property var monitor: "DP-1" property var monitor: "DP-1"
property var components: [] // Add this new property property var components: [] // Add this new property
@@ -16,14 +16,14 @@ WrapperRectangle {
RowLayout { RowLayout {
Repeater { Repeater {
model: barArea.components model: root.components
delegate: Loader { delegate: Loader {
required property var modelData required property var modelData
// The source of the loader is the component from the model // The source of the loader is the component from the model
source: modelData source: modelData
onLoaded: { onLoaded: {
item.monitor = barArea.monitor; item.monitor = root.monitor;
} }
} }
} }

View File

@@ -5,6 +5,7 @@ import qs.Common.Styled
Item { Item {
id: root id: root
property int targetYear: new Date().getFullYear() property int targetYear: new Date().getFullYear()
property int targetMonth: new Date().getMonth() // 0-11 property int targetMonth: new Date().getMonth() // 0-11
property date currentDate: new Date() property date currentDate: new Date()

View File

@@ -4,11 +4,10 @@ import Quickshell
import qs.Common import qs.Common
Singleton { Singleton {
id: mediatorRoot id: root
property var component: null property var component: null
property string type: "" property string type: ""
property int x: component? component.implicitWidth : 0 property int x: component ? component.implicitWidth : 0
property int y: component? (component.implicitHeight + Theme.gaps) : 100 property int y: component ? (component.implicitHeight + Theme.gaps) : 100
} }

View File

@@ -5,7 +5,7 @@ import Quickshell.Widgets
import qs.Common.Styled import qs.Common.Styled
BackgroundRectangle { BackgroundRectangle {
id: notificationWrapper id: root
signal dismissed signal dismissed
signal timedout signal timedout
@@ -33,7 +33,7 @@ BackgroundRectangle {
// implicitHeight: Math.max(notifLayout.implicitHeight, 100) // implicitHeight: Math.max(notifLayout.implicitHeight, 100)
Component.onCompleted: { Component.onCompleted: {
notificationWrapper.implicitHeight = targetHeight; root.implicitHeight = targetHeight;
} }
clip: true clip: true
@@ -46,9 +46,9 @@ BackgroundRectangle {
ScriptAction { ScriptAction {
script: { script: {
if (clicked) if (clicked)
notificationWrapper.dismissed(); root.dismissed();
if (notificationWrapper.implicitHeight === 0) if (root.implicitHeight === 0)
notificationWrapper.timedout(); root.timedout();
} }
} }
} }
@@ -57,8 +57,8 @@ BackgroundRectangle {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
notificationWrapper.clicked = true; root.clicked = true;
notificationWrapper.implicitHeight = 0; root.implicitHeight = 0;
} }
} }
@@ -66,10 +66,10 @@ BackgroundRectangle {
id: notifTimer id: notifTimer
interval: timerDuration interval: timerDuration
running: notificationWrapper.startTimer running: root.startTimer
onTriggered: { onTriggered: {
notificationWrapper.implicitHeight = 0; root.implicitHeight = 0;
} }
} }
@@ -88,8 +88,8 @@ BackgroundRectangle {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 10 Layout.leftMargin: 10
implicitSize: 80 implicitSize: 80
visible: notificationWrapper.image ? true : false visible: root.image ? true : false
source: notificationWrapper.image source: root.image
} }
ColumnLayout { ColumnLayout {
@@ -118,7 +118,7 @@ BackgroundRectangle {
anchors.fill: parent anchors.fill: parent
text: notificationWrapper.notification ? notificationWrapper.notification.summary : "" text: root.notification ? root.notification.summary : ""
} }
} }
@@ -140,7 +140,7 @@ BackgroundRectangle {
anchors.fill: parent anchors.fill: parent
text: notificationWrapper.notification ? notificationWrapper.notification.body : "" text: root.notification ? root.notification.body : ""
} }
} }
} }

View File

@@ -2,9 +2,10 @@ import QtQuick
import qs.Common import qs.Common
Rectangle { Rectangle {
id: root
color: Theme.backgroudColor color: Theme.backgroudColor
border.width: 1 border.width: 2
border.color: Theme.color2 border.color: Theme.color2
radius: 20 radius: 20
} }

View File

@@ -2,6 +2,7 @@ import QtQuick
import qs.Common import qs.Common
Rectangle { Rectangle {
id: root
color: Theme.backgroudColorBright color: Theme.backgroudColorBright
radius: 20 radius: 20

View File

@@ -2,7 +2,7 @@ import QtQuick
import qs.Common import qs.Common
Text { Text {
id: clockText id: root
anchors.margins: 5 anchors.margins: 5
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter

View File

@@ -5,7 +5,7 @@ import Quickshell
import Quickshell.Io import Quickshell.Io
Singleton { Singleton {
id: timeRoot id: root
readonly property int barSize: 35 readonly property int barSize: 35
readonly property double heightGaps: barSize * 0.8 readonly property double heightGaps: barSize * 0.8
@@ -18,7 +18,7 @@ Singleton {
// Colors // Colors
FileView { FileView {
id: walColors id: walColors
path: Qt.resolvedUrl(Quickshell.env("XDG_CACHE_HOME")+"/wal/colors") path: Qt.resolvedUrl(Quickshell.env("XDG_CACHE_HOME") + "/wal/colors")
blockLoading: true blockLoading: true
watchChanges: true watchChanges: true
onFileChanged: this.reload() onFileChanged: this.reload()

View File

@@ -3,7 +3,7 @@ pragma Singleton
import Quickshell import Quickshell
Singleton { Singleton {
id: timeRoot id: root
readonly property string time: { readonly property string time: {
Qt.formatDateTime(clock.date, "hh:mm"); Qt.formatDateTime(clock.date, "hh:mm");

View File

@@ -10,7 +10,7 @@ import qs.Common.Styled
import qs.Services import qs.Services
BackgroundRectangle { BackgroundRectangle {
id: systrayRoot id: root
MarginWrapperManager { MarginWrapperManager {
rightMargin: Theme.gaps rightMargin: Theme.gaps

View File

@@ -11,7 +11,7 @@ import qs.Common
import Quickshell.Wayland import Quickshell.Wayland
PanelWindow { PanelWindow {
id: notificationRoot id: root
anchors { anchors {
left: true left: true
@@ -33,12 +33,12 @@ PanelWindow {
focus: true focus: true
Keys.onPressed: event => { Keys.onPressed: event => {
if (event.key == Qt.Key_Escape) if (event.key == Qt.Key_Escape)
notificationRoot.clear(); root.clear();
} }
} }
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: notificationRoot.clear() onClicked: root.clear()
} }
Rectangle { Rectangle {

View File

@@ -11,7 +11,7 @@ import qs.Common.Styled
import qs.Services import qs.Services
WrapperMouseArea { WrapperMouseArea {
id: workspacesWidget id: root
property var monitor: "black" property var monitor: "black"
@@ -31,7 +31,7 @@ WrapperMouseArea {
RowLayout { RowLayout {
property var monitor: workspacesWidget.monitor property var monitor: root.monitor
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter