Skip to content

Commit 48b60b1

Browse files
authored
Add files via upload
1 parent 081d9e8 commit 48b60b1

93 files changed

Lines changed: 3114 additions & 1146 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/BatteryMonitor.qml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import QtQuick
1+
import qs.config
2+
import Caelestia
23
import Quickshell
34
import Quickshell.Services.UPower
4-
import Caelestia
5-
import qs.config
5+
import QtQuick
66

77
Scope {
88
id: root
99

1010
readonly property list<var> warnLevels: [...Config.general.battery.warnLevels].sort((a, b) => b.level - a.level)
1111

1212
Connections {
13+
target: UPower
14+
1315
function onOnBatteryChanged(): void {
1416
if (UPower.onBattery) {
1517
if (Config.utilities.toasts.chargingChanged)
@@ -21,11 +23,11 @@ Scope {
2123
level.warned = false;
2224
}
2325
}
24-
25-
target: UPower
2626
}
2727

2828
Connections {
29+
target: UPower.displayDevice
30+
2931
function onPercentageChanged(): void {
3032
if (!UPower.onBattery)
3133
return;
@@ -43,8 +45,6 @@ Scope {
4345
hibernateTimer.start();
4446
}
4547
}
46-
47-
target: UPower.displayDevice
4848
}
4949

5050
Timer {

modules/IdleMonitors.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
pragma ComponentBehavior: Bound
22

33
import "lock"
4+
import qs.config
5+
import qs.services
6+
import Caelestia.Internal
47
import Quickshell
58
import Quickshell.Wayland
6-
import Caelestia.Internal
7-
import qs.services
8-
import qs.config
99

1010
Scope {
1111
id: root

modules/Shortcuts.qml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
import Quickshell
2-
import Quickshell.Io
3-
import Caelestia
41
import qs.components.misc
5-
import qs.services
62
import qs.modules.controlcenter
3+
import qs.services
4+
import Caelestia
5+
import Quickshell
6+
import Quickshell.Io
77

88
Scope {
99
id: root
1010

1111
property bool launcherInterrupted
1212
readonly property bool hasFullscreen: Hypr.focusedWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2) ?? false
1313

14-
// qmllint disable unresolved-type
1514
CustomShortcut {
16-
// qmllint enable unresolved-type
1715
name: "controlCenter"
1816
description: "Open control center"
1917
onPressed: WindowFactory.create()
2018
}
2119

22-
// qmllint disable unresolved-type
2320
CustomShortcut {
24-
// qmllint enable unresolved-type
2521
name: "showall"
2622
description: "Toggle launcher, dashboard and osd"
2723
onPressed: {
@@ -32,9 +28,7 @@ Scope {
3228
}
3329
}
3430

35-
// qmllint disable unresolved-type
3631
CustomShortcut {
37-
// qmllint enable unresolved-type
3832
name: "dashboard"
3933
description: "Toggle dashboard"
4034
onPressed: {
@@ -45,9 +39,7 @@ Scope {
4539
}
4640
}
4741

48-
// qmllint disable unresolved-type
4942
CustomShortcut {
50-
// qmllint enable unresolved-type
5143
name: "session"
5244
description: "Toggle session menu"
5345
onPressed: {
@@ -58,9 +50,7 @@ Scope {
5850
}
5951
}
6052

61-
// qmllint disable unresolved-type
6253
CustomShortcut {
63-
// qmllint enable unresolved-type
6454
name: "launcher"
6555
description: "Toggle launcher"
6656
onPressed: root.launcherInterrupted = false
@@ -73,17 +63,14 @@ Scope {
7363
}
7464
}
7565

76-
// qmllint disable unresolved-type
7766
CustomShortcut {
78-
// qmllint enable unresolved-type
7967
name: "launcherInterrupt"
8068
description: "Interrupt launcher keybind"
8169
onPressed: root.launcherInterrupted = true
8270
}
8371

84-
// qmllint disable unresolved-type
72+
8573
CustomShortcut {
86-
// qmllint enable unresolved-type
8774
name: "sidebar"
8875
description: "Toggle sidebar"
8976
onPressed: {
@@ -94,9 +81,7 @@ Scope {
9481
}
9582
}
9683

97-
// qmllint disable unresolved-type
9884
CustomShortcut {
99-
// qmllint enable unresolved-type
10085
name: "utilities"
10186
description: "Toggle utilities"
10287
onPressed: {
@@ -108,6 +93,8 @@ Scope {
10893
}
10994

11095
IpcHandler {
96+
target: "drawers"
97+
11198
function toggle(drawer: string): void {
11299
if (list().split("\n").includes(drawer)) {
113100
if (root.hasFullscreen && ["launcher", "session", "dashboard"].includes(drawer))
@@ -123,19 +110,19 @@ Scope {
123110
const visibilities = Visibilities.getForActive();
124111
return Object.keys(visibilities).filter(k => typeof visibilities[k] === "boolean").join("\n");
125112
}
126-
127-
target: "drawers"
128113
}
129114

130115
IpcHandler {
116+
target: "controlCenter"
117+
131118
function open(): void {
132119
WindowFactory.create();
133120
}
134-
135-
target: "controlCenter"
136121
}
137122

138123
IpcHandler {
124+
target: "toaster"
125+
139126
function info(title: string, message: string, icon: string): void {
140127
Toaster.toast(title, message, icon, Toast.Info);
141128
}
@@ -151,7 +138,5 @@ Scope {
151138
function error(title: string, message: string, icon: string): void {
152139
Toaster.toast(title, message, icon, Toast.Error);
153140
}
154-
155-
target: "toaster"
156141
}
157142
}

modules/dashboard/Background.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import QtQuick
2-
import QtQuick.Shapes
31
import qs.components
42
import qs.services
53
import qs.config
4+
import QtQuick
5+
import QtQuick.Shapes
66

77
ShapePath {
88
id: root

modules/dashboard/Content.qml

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
pragma ComponentBehavior: Bound
22

3-
import QtQuick
4-
import QtQuick.Layouts
5-
import Quickshell
6-
import Quickshell.Widgets
73
import qs.components
84
import qs.components.filedialog
95
import qs.config
6+
import Quickshell
7+
import Quickshell.Widgets
8+
import QtQuick
9+
import QtQuick.Layouts
1010

1111
Item {
1212
id: root
1313

14-
required property DrawerVisibilities visibilities
15-
readonly property bool needsKeyboard: {
16-
const count = repeater.count;
17-
for (let i = 0; i < count; i++) {
18-
const item = repeater.itemAt(i) as Loader;
19-
if (item?.sourceComponent === mediaComponent && (item?.item as MediaWrapper)?.needsKeyboard)
20-
return true;
21-
}
22-
return false;
23-
}
24-
required property DashboardState state
14+
required property PersistentProperties visibilities
15+
required property PersistentProperties state
2516
required property FileDialog facePicker
2617

2718
readonly property var dashboardTabs: {
@@ -90,24 +81,21 @@ Item {
9081
id: view
9182

9283
readonly property int currentIndex: root.state.currentTab
93-
readonly property Item currentItem: {
94-
repeater.count; // Trigger update on count change
95-
return repeater.itemAt(currentIndex);
96-
}
84+
readonly property Item currentItem: row.children[currentIndex]
9785

9886
anchors.fill: parent
9987

10088
flickableDirection: Flickable.HorizontalFlick
10189

102-
implicitWidth: currentItem?.implicitWidth ?? 0
103-
implicitHeight: currentItem?.implicitHeight ?? 0
90+
implicitWidth: currentItem.implicitWidth
91+
implicitHeight: currentItem.implicitHeight
10492

105-
contentX: currentItem?.x ?? 0
93+
contentX: currentItem.x
10694
contentWidth: row.implicitWidth
10795
contentHeight: row.implicitHeight
10896

10997
onContentXChanged: {
110-
if (!moving || !currentItem)
98+
if (!moving)
11199
return;
112100

113101
const x = contentX - currentItem.x;
@@ -118,24 +106,19 @@ Item {
118106
}
119107

120108
onDragEnded: {
121-
if (!currentItem)
122-
return;
123-
124109
const x = contentX - currentItem.x;
125110
if (x > currentItem.implicitWidth / 10)
126111
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
127112
else if (x < -currentItem.implicitWidth / 10)
128113
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
129114
else
130-
contentX = Qt.binding(() => currentItem?.x ?? 0);
115+
contentX = Qt.binding(() => currentItem.x);
131116
}
132117

133118
RowLayout {
134119
id: row
135120

136121
Repeater {
137-
id: repeater
138-
139122
model: ScriptModel {
140123
values: root.dashboardTabs
141124
}
@@ -163,7 +146,6 @@ Item {
163146

164147
Component {
165148
id: dashComponent
166-
167149
Dash {
168150
visibilities: root.visibilities
169151
state: root.state
@@ -173,22 +155,19 @@ Item {
173155

174156
Component {
175157
id: mediaComponent
176-
177-
MediaWrapper {
158+
Media {
178159
visibilities: root.visibilities
179160
}
180161
}
181162

182163
Component {
183164
id: performanceComponent
184-
185165
Performance {}
186166
}
187167

188168
Component {
189169
id: weatherComponent
190-
191-
WeatherTab {}
170+
Weather {}
192171
}
193172

194173
Behavior on contentX {

modules/dashboard/Dash.qml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import "dash"
2-
import QtQuick.Layouts
31
import qs.components
42
import qs.components.filedialog
53
import qs.services
64
import qs.config
5+
import "dash"
6+
import Quickshell
7+
import QtQuick.Layouts
78

89
GridLayout {
910
id: root
1011

11-
required property DrawerVisibilities visibilities
12-
required property DashboardState state
12+
required property PersistentProperties visibilities
13+
required property PersistentProperties state
1314
required property FileDialog facePicker
1415

1516
rowSpacing: Appearance.spacing.normal
@@ -40,7 +41,7 @@ GridLayout {
4041

4142
radius: Appearance.rounding.large * 1.5
4243

43-
SmallWeather {}
44+
Weather {}
4445
}
4546

4647
Rect {

0 commit comments

Comments
 (0)