Skip to content

Commit d1b8371

Browse files
committed
weather: merge upstream main and fix failing checks
1 parent 93a5f20 commit d1b8371

9 files changed

Lines changed: 144 additions & 160 deletions

File tree

.github/workflows/check-format.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ jobs:
3434
- name: Check C++ format
3535
shell: fish {0}
3636
run: |
37-
for file in (string match -v 'build/*' **.cpp **.hpp)
38-
clang-format $file | diff -u $file - || exit 1
39-
end
37+
find plugin extras -name '*.cpp' -o -name '*.hpp' \
38+
| xargs clang-format --dry-run --Werror

modules/background/Background.qml

Lines changed: 128 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -7,160 +7,155 @@ import qs.components.containers
77
import qs.services
88
import qs.config
99

10-
Loader {
11-
asynchronous: true
12-
active: Config.background.enabled
10+
Variants {
11+
model: Config.background.enabled ? Screens.screens : []
1312

14-
sourceComponent: Variants {
15-
model: Screens.screens
13+
StyledWindow {
14+
id: win
1615

17-
StyledWindow {
18-
id: win
16+
required property ShellScreen modelData
1917

20-
required property ShellScreen modelData
18+
screen: modelData
19+
name: "background"
20+
WlrLayershell.exclusionMode: ExclusionMode.Ignore
21+
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
22+
color: Config.background.wallpaperEnabled ? "black" : "transparent"
23+
surfaceFormat.opaque: false
2124

22-
screen: modelData
23-
name: "background"
24-
WlrLayershell.exclusionMode: ExclusionMode.Ignore
25-
WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom
26-
color: Config.background.wallpaperEnabled ? "black" : "transparent"
27-
surfaceFormat.opaque: false
25+
anchors.top: true
26+
anchors.bottom: true
27+
anchors.left: true
28+
anchors.right: true
2829

29-
anchors.top: true
30-
anchors.bottom: true
31-
anchors.left: true
32-
anchors.right: true
30+
Item {
31+
id: behindClock
3332

34-
Item {
35-
id: behindClock
33+
anchors.fill: parent
34+
35+
Loader {
36+
id: wallpaper
37+
38+
asynchronous: true
3639

3740
anchors.fill: parent
41+
active: Config.background.wallpaperEnabled
3842

39-
Loader {
40-
id: wallpaper
43+
sourceComponent: Wallpaper {}
44+
}
4145

42-
asynchronous: true
46+
Visualiser {
47+
anchors.fill: parent
48+
screen: win.modelData
49+
wallpaper: wallpaper
50+
}
51+
}
4352

44-
anchors.fill: parent
45-
active: Config.background.wallpaperEnabled
53+
Loader {
54+
id: clockLoader
4655

47-
sourceComponent: Wallpaper {}
48-
}
56+
asynchronous: true
57+
active: Config.background.desktopClock.enabled
4958

50-
Visualiser {
51-
anchors.fill: parent
52-
screen: win.modelData
53-
wallpaper: wallpaper
54-
}
55-
}
59+
anchors.margins: Appearance.padding.large * 2
60+
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
5661

57-
Loader {
58-
id: clockLoader
62+
state: Config.background.desktopClock.position
63+
states: [
64+
State {
65+
name: "top-left"
5966

60-
asynchronous: true
61-
active: Config.background.desktopClock.enabled
62-
63-
anchors.margins: Appearance.padding.large * 2
64-
anchors.leftMargin: Appearance.padding.large * 2 + Config.bar.sizes.innerWidth + Math.max(Appearance.padding.smaller, Config.border.thickness)
65-
66-
state: Config.background.desktopClock.position
67-
states: [
68-
State {
69-
name: "top-left"
70-
71-
AnchorChanges {
72-
target: clockLoader
73-
anchors.top: parent.top
74-
anchors.left: parent.left
75-
}
76-
},
77-
State {
78-
name: "top-center"
79-
80-
AnchorChanges {
81-
target: clockLoader
82-
anchors.top: parent.top
83-
anchors.horizontalCenter: parent.horizontalCenter
84-
}
85-
},
86-
State {
87-
name: "top-right"
88-
89-
AnchorChanges {
90-
target: clockLoader
91-
anchors.top: parent.top
92-
anchors.right: parent.right
93-
}
94-
},
95-
State {
96-
name: "middle-left"
97-
98-
AnchorChanges {
99-
target: clockLoader
100-
anchors.verticalCenter: parent.verticalCenter
101-
anchors.left: parent.left
102-
}
103-
},
104-
State {
105-
name: "middle-center"
106-
107-
AnchorChanges {
108-
target: clockLoader
109-
anchors.verticalCenter: parent.verticalCenter
110-
anchors.horizontalCenter: parent.horizontalCenter
111-
}
112-
},
113-
State {
114-
name: "middle-right"
115-
116-
AnchorChanges {
117-
target: clockLoader
118-
anchors.verticalCenter: parent.verticalCenter
119-
anchors.right: parent.right
120-
}
121-
},
122-
State {
123-
name: "bottom-left"
124-
125-
AnchorChanges {
126-
target: clockLoader
127-
anchors.bottom: parent.bottom
128-
anchors.left: parent.left
129-
}
130-
},
131-
State {
132-
name: "bottom-center"
133-
134-
AnchorChanges {
135-
target: clockLoader
136-
anchors.bottom: parent.bottom
137-
anchors.horizontalCenter: parent.horizontalCenter
138-
}
139-
},
140-
State {
141-
name: "bottom-right"
142-
143-
AnchorChanges {
144-
target: clockLoader
145-
anchors.bottom: parent.bottom
146-
anchors.right: parent.right
147-
}
67+
AnchorChanges {
68+
target: clockLoader
69+
anchors.top: parent.top
70+
anchors.left: parent.left
14871
}
149-
]
150-
151-
transitions: Transition {
152-
AnchorAnimation {
153-
duration: Appearance.anim.durations.expressiveDefaultSpatial
154-
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
72+
},
73+
State {
74+
name: "top-center"
75+
76+
AnchorChanges {
77+
target: clockLoader
78+
anchors.top: parent.top
79+
anchors.horizontalCenter: parent.horizontalCenter
80+
}
81+
},
82+
State {
83+
name: "top-right"
84+
85+
AnchorChanges {
86+
target: clockLoader
87+
anchors.top: parent.top
88+
anchors.right: parent.right
89+
}
90+
},
91+
State {
92+
name: "middle-left"
93+
94+
AnchorChanges {
95+
target: clockLoader
96+
anchors.verticalCenter: parent.verticalCenter
97+
anchors.left: parent.left
98+
}
99+
},
100+
State {
101+
name: "middle-center"
102+
103+
AnchorChanges {
104+
target: clockLoader
105+
anchors.verticalCenter: parent.verticalCenter
106+
anchors.horizontalCenter: parent.horizontalCenter
107+
}
108+
},
109+
State {
110+
name: "middle-right"
111+
112+
AnchorChanges {
113+
target: clockLoader
114+
anchors.verticalCenter: parent.verticalCenter
115+
anchors.right: parent.right
116+
}
117+
},
118+
State {
119+
name: "bottom-left"
120+
121+
AnchorChanges {
122+
target: clockLoader
123+
anchors.bottom: parent.bottom
124+
anchors.left: parent.left
125+
}
126+
},
127+
State {
128+
name: "bottom-center"
129+
130+
AnchorChanges {
131+
target: clockLoader
132+
anchors.bottom: parent.bottom
133+
anchors.horizontalCenter: parent.horizontalCenter
134+
}
135+
},
136+
State {
137+
name: "bottom-right"
138+
139+
AnchorChanges {
140+
target: clockLoader
141+
anchors.bottom: parent.bottom
142+
anchors.right: parent.right
155143
}
156144
}
145+
]
157146

158-
sourceComponent: DesktopClock {
159-
wallpaper: behindClock
160-
absX: clockLoader.x
161-
absY: clockLoader.y
147+
transitions: Transition {
148+
AnchorAnimation {
149+
duration: Appearance.anim.durations.expressiveDefaultSpatial
150+
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
162151
}
163152
}
153+
154+
sourceComponent: DesktopClock {
155+
wallpaper: behindClock
156+
absX: clockLoader.x
157+
absY: clockLoader.y
158+
}
164159
}
165160
}
166161
}

modules/dashboard/WeatherTab.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import QtQuick
22
import QtQuick.Layouts
3-
import qs.config
43
import qs.services
4+
import qs.config
55
import "weather"
66

77
Item {

modules/dashboard/weather/BigInfo.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import QtQuick
22
import QtQuick.Layouts
33
import qs.components
4-
import qs.config
54
import qs.services
5+
import qs.config
66

77
RowLayout {
88
id: bigInfo
@@ -17,8 +17,8 @@ RowLayout {
1717
spacing: Appearance.spacing.small
1818
Layout.fillWidth: true
1919
Layout.fillHeight: true
20-
StyledRect {
2120

21+
StyledRect {
2222
radius: Appearance.rounding.normal
2323
color: Colours.tPalette.m3surfaceContainer
2424
Layout.fillWidth: true

modules/dashboard/weather/CityInfo.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import QtQuick
22
import QtQuick.Layouts
33
import qs.components
4-
import qs.config
54
import qs.services
5+
import qs.config
66

77
RowLayout {
88
Layout.leftMargin: Appearance.padding.large
@@ -24,7 +24,6 @@ RowLayout {
2424
font.pointSize: Appearance.font.size.small
2525
color: Colours.palette.m3onSurfaceVariant
2626
}
27-
2827
}
2928

3029
Item {
@@ -47,7 +46,6 @@ RowLayout {
4746
value: Weather.sunset
4847
colour: Colours.palette.m3tertiary
4948
}
50-
5149
}
5250

5351
component WeatherStat: Row {
@@ -67,7 +65,6 @@ RowLayout {
6765
}
6866

6967
Column {
70-
7168
StyledText {
7269
text: weatherStat.label
7370
font.pointSize: Appearance.font.size.smaller
@@ -80,9 +77,6 @@ RowLayout {
8077
font.weight: 600
8178
color: Colours.palette.m3onSurface
8279
}
83-
8480
}
85-
8681
}
87-
8882
}

modules/dashboard/weather/DailyForecast.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import QtQuick
22
import QtQuick.Layouts
3-
import qs.config
43
import qs.components
54
import qs.services
5+
import qs.config
66

77
ColumnLayout {
8-
98
StyledText {
109
Layout.topMargin: Appearance.spacing.normal
1110
Layout.leftMargin: Appearance.padding.normal
@@ -18,11 +17,13 @@ ColumnLayout {
1817

1918
RowLayout {
2019
id: dailyForecast
20+
2121
Layout.fillWidth: true
2222
spacing: Appearance.spacing.smaller
2323

2424
Repeater {
2525
id: dailyRepeater
26+
2627
model: Weather.forecast
2728

2829
DailyForecastItem {}

0 commit comments

Comments
 (0)