-
-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathwelcome.qml
More file actions
1837 lines (1648 loc) · 82.6 KB
/
Copy pathwelcome.qml
File metadata and controls
1837 lines (1648 loc) · 82.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//@ pragma UseQApplication
//@ pragma Env QS_NO_RELOAD_POPUP=1
//@ pragma Env INIR_STANDALONE_WINDOW=1
//@ pragma Env QT_QUICK_CONTROLS_STYLE=Basic
//@ pragma Env QT_QUICK_FLICKABLE_WHEEL_DECELERATION=10000
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import Qt5Compat.GraphicalEffects as GE
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
Scope {
id: root
property string firstRunFilePath: FileUtils.trimFileProtocol(`${Directories.state}/user/first_run.txt`)
property string firstRunFileContent: "This file is just here to confirm you've been greeted :>"
property int currentStep: 0
readonly property int totalSteps: 5
property var focusedScreen: GlobalStates.primaryScreen
// ─── Entry/exit animation state (gate pattern) ───
property bool _entryReady: false
property bool _contentReady: false
property bool _closing: false
readonly property var steps: [
{ icon: "waving_hand", title: Translation.tr("Welcome") },
{ icon: "palette", title: Translation.tr("Appearance") },
{ icon: "dashboard", title: Translation.tr("Layout") },
{ icon: "tune", title: Translation.tr("Features") },
{ icon: "celebration", title: Translation.tr("Ready") }
]
function finish(skipped: bool): void {
if (root._closing) return
root._closing = true
// Write config keys
Config.setNestedValue("welcomeWizard.completed", !skipped)
Config.setNestedValue("welcomeWizard.skipped", skipped)
// Reverse the entry animation
root._contentReady = false
root._entryReady = false
_exitTimer.start()
}
Timer {
id: _exitTimer
interval: Appearance.animationsEnabled ? 400 : 0
repeat: false
onTriggered: {
// first_run.txt is already written by FirstRunExperience before launching us
Quickshell.execDetached(["/usr/bin/notify-send", Translation.tr("Welcome to inir"), Translation.tr("Press Super+/ for all keyboard shortcuts."), "-a", "Shell"])
Qt.quit()
}
}
Component.onCompleted: {
Quickshell.watchFiles = false
MaterialThemeLoader.reapplyTheme()
Config.readWriteDelay = 0
// Staggered entry: scrim first, then card content
if (Appearance.animationsEnabled) {
_entryTimer.start()
} else {
root._entryReady = true
root._contentReady = true
}
}
Timer {
id: _entryTimer
interval: 80
repeat: false
onTriggered: {
root._entryReady = true
_contentEntryTimer.start()
}
}
Timer {
id: _contentEntryTimer
interval: 120
repeat: false
onTriggered: root._contentReady = true
}
PanelWindow {
id: wizardPanel
visible: true
color: "transparent"
exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "quickshell:welcome"
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.keyboardFocus: root._closing ? WlrKeyboardFocus.None : WlrKeyboardFocus.Exclusive
anchors { top: true; bottom: true; left: true; right: true }
implicitWidth: root.focusedScreen?.width ?? 1920
implicitHeight: root.focusedScreen?.height ?? 1080
// ─── Blurred wallpaper backdrop (scrim) ───
Item {
id: scrim
anchors.fill: parent
opacity: root._entryReady ? 1.0 : 0.0
Behavior on opacity {
enabled: Appearance.animationsEnabled
NumberAnimation {
duration: Appearance.calcEffectiveDuration(320)
easing.type: Easing.OutCubic
}
}
// Blur edge compensation: MultiEffect fades at boundaries
readonly property int blurOverflow: 64
Item {
id: blurSource
anchors.fill: parent
anchors.margins: -scrim.blurOverflow
Image {
anchors.fill: parent
anchors.margins: scrim.blurOverflow
source: Config.options?.background?.wallpaperPath ?? ""
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: true
sourceSize.width: wizardPanel.implicitWidth
sourceSize.height: wizardPanel.implicitHeight
}
}
MultiEffect {
source: blurSource
anchors.fill: parent
anchors.margins: -scrim.blurOverflow
blurEnabled: Appearance.effectsEnabled
blurMax: 64
blur: Appearance.effectsEnabled ? 1.0 : 0
saturation: Appearance.effectsEnabled ? 0.15 : 0
}
// Scrim overlay
Rectangle {
anchors.fill: parent
color: Appearance.colors.colScrim
opacity: 0.55
}
// Vignette
GE.RadialGradient {
anchors.fill: parent
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 0.6; color: "transparent" }
GradientStop { position: 1.0; color: ColorUtils.applyAlpha(Appearance.colors.colScrim, 0.35) }
}
}
}
// Click outside does NOT dismiss — just absorb clicks
MouseArea {
anchors.fill: parent
}
// Main wizard card
Item {
id: wizardCard
anchors.centerIn: parent
width: Math.min(960, parent.width * 0.75)
height: Math.min(parent.height * 0.85, parent.height - 60)
focus: true
// Staggered entry animation — card comes in after scrim
transformOrigin: Item.Center
scale: root._contentReady ? 1.0 : 0.92
opacity: root._contentReady ? 1.0 : 0.0
Behavior on scale {
enabled: Appearance.animationsEnabled
NumberAnimation {
duration: Appearance.calcEffectiveDuration(420)
easing.type: Appearance.animation.elementMoveEnter.type
easing.bezierCurve: Appearance.animation.elementMoveEnter.bezierCurve
}
}
Behavior on opacity {
enabled: Appearance.animationsEnabled
NumberAnimation {
duration: Appearance.calcEffectiveDuration(350)
easing.type: Easing.OutCubic
}
}
// Keyboard navigation
Keys.onEscapePressed: root.finish(true)
Keys.onLeftPressed: if (root.currentStep > 0) root.currentStep--
Keys.onRightPressed: if (root.currentStep < root.totalSteps - 1) root.currentStep++
Keys.onReturnPressed: root.currentStep < root.totalSteps - 1 ? root.currentStep++ : root.finish(false)
Keys.onEnterPressed: root.currentStep < root.totalSteps - 1 ? root.currentStep++ : root.finish(false)
// Shadow (hide in aurora)
StyledRectangularShadow {
target: cardBg
visible: Appearance.angelEverywhere || !Appearance.auroraEverywhere
}
// Card background - style-aware
Rectangle {
id: cardBg
anchors.fill: parent
radius: Appearance.inirEverywhere ? Appearance.inir.roundingLarge
: Appearance.rounding.large
// Base color — colLayer1Base is the raw m3surfaceContainerLow without
// contentTransparency mixing, so the wizard stays solid even when the user
// has transparency enabled in Material/Cards styles.
color: Appearance.inirEverywhere ? Appearance.inir.colLayer1
: Appearance.auroraEverywhere ? "transparent"
: Appearance.colors.colLayer1Base
border.width: Appearance.inirEverywhere ? 1 : (Appearance.auroraEverywhere ? 0 : 1)
border.color: Appearance.inirEverywhere ? Appearance.inir.colBorder
: Appearance.colors.colLayer0Border
Behavior on color { ColorAnimation { duration: Appearance.animation.elementMoveFast.duration } }
Behavior on border.color { ColorAnimation { duration: Appearance.animation.elementMoveFast.duration } }
// Aurora: Wallpaper blur inside card
Item {
id: auroraBlurSource
visible: Appearance.auroraEverywhere
anchors.fill: parent
Image {
x: -wizardCard.x
y: -wizardCard.y
width: wizardPanel.width
height: wizardPanel.height
source: Config.options?.background?.wallpaperPath ?? ""
fillMode: Image.PreserveAspectCrop
}
}
MultiEffect {
visible: Appearance.auroraEverywhere
source: auroraBlurSource
anchors.fill: parent
blurEnabled: Appearance.effectsEnabled
blurMax: 40
blur: Appearance.effectsEnabled ? 1.0 : 0
saturation: Appearance.effectsEnabled ? 0.1 : 0
}
// Aurora: Tinted overlay
Rectangle {
anchors.fill: parent
visible: Appearance.auroraEverywhere
radius: parent.radius
color: ColorUtils.transparentize(Appearance.colors.colLayer1Base, 0.25)
}
// Block clicks from propagating to background MouseArea
MouseArea {
anchors.fill: parent
onClicked: (event) => event.accepted = true
}
// Clip content to rounded corners
layer.enabled: Appearance.effectsEnabled
layer.effect: GE.OpacityMask {
maskSource: Rectangle {
width: cardBg.width
height: cardBg.height
radius: cardBg.radius
}
}
}
ColumnLayout {
anchors.fill: parent
anchors.margins: 36
spacing: 24
// Header with step indicator
ColumnLayout {
Layout.fillWidth: true
spacing: 10
// Step circles + labels
Row {
Layout.alignment: Qt.AlignHCenter
spacing: 0
Repeater {
model: root.steps
Row {
required property int index
required property var modelData
ColumnLayout {
spacing: 4
Rectangle {
id: stepCircle
Layout.alignment: Qt.AlignHCenter
implicitWidth: 38; implicitHeight: 38; radius: 19
color: index < root.currentStep ? Appearance.colors.colPrimary
: index === root.currentStep ? Appearance.colors.colPrimaryContainer
: Appearance.colors.colLayer2
border.width: index === root.currentStep ? 2 : 0
border.color: Appearance.colors.colPrimary
Behavior on color { ColorAnimation { duration: Appearance.animation.elementMoveFast.duration } }
Behavior on scale {
NumberAnimation {
duration: Appearance.animation.elementMove.duration
easing.type: Easing.OutBack
}
}
Behavior on border.width { NumberAnimation { duration: Appearance.animation.elementMoveFast.duration } }
scale: index === root.currentStep ? 1.12 : 1.0
MaterialSymbol {
anchors.centerIn: parent
text: index < root.currentStep ? "check" : modelData.icon
iconSize: index === root.currentStep ? 20 : 18
color: index < root.currentStep ? Appearance.colors.colOnPrimary
: index === root.currentStep ? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colOnLayer2
Behavior on iconSize { NumberAnimation { duration: Appearance.animation.elementMoveFast.duration } }
}
// Click on a past step to jump back to it (forward jumping disabled to keep flow)
MouseArea {
anchors.fill: parent
cursorShape: index <= root.currentStep ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: index <= root.currentStep
onClicked: root.currentStep = index
}
}
// Step label (small, below circle)
StyledText {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: 70
text: modelData.title
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Appearance.font.pixelSize.smallest
font.weight: index === root.currentStep ? Font.Medium : Font.Normal
color: index === root.currentStep
? Appearance.colors.colOnLayer1
: Appearance.colors.colSubtext
elide: Text.ElideRight
Behavior on color { ColorAnimation { duration: Appearance.animation.elementMoveFast.duration } }
}
}
// Connector line with progress
Item {
visible: index < root.steps.length - 1
width: 36; height: 4
y: 17 // align with circle vertical center (38/2 - 4/2)
Rectangle {
anchors.fill: parent
radius: 2
color: Appearance.colors.colLayer2
}
Rectangle {
height: parent.height
radius: 2
color: Appearance.colors.colPrimary
width: index < root.currentStep ? parent.width : 0
Behavior on width {
NumberAnimation {
duration: Appearance.animation.elementMove.duration
easing.type: Appearance.animation.elementMove.type
easing.bezierCurve: Appearance.animation.elementMove.bezierCurve
}
}
}
}
}
}
}
// "Step X of N" subtle counter
StyledText {
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 4
text: Translation.tr("Step %1 of %2").arg(root.currentStep + 1).arg(root.totalSteps)
font.pixelSize: Appearance.font.pixelSize.smallest
color: Appearance.colors.colSubtext
opacity: 0.8
}
// Step title
StyledText {
Layout.alignment: Qt.AlignHCenter
text: root.steps[root.currentStep].title
font.family: Appearance.font.family.title
font.pixelSize: Appearance.font.pixelSize.hugeass
color: Appearance.colors.colOnLayer1
}
}
// Separator
Rectangle {
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
height: 1
color: Appearance.inirEverywhere ? Appearance.inir.colBorderSubtle
: Appearance.colors.colOutlineVariant
}
// Content area with transitions
Item {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
StackLayout {
id: stepStack
anchors.fill: parent
anchors.topMargin: 8
currentIndex: root.currentStep
// Step transition - improved with scale and better easing
property int prevStep: 0
onCurrentIndexChanged: {
stepAnim.direction = currentIndex > prevStep ? 1 : -1
stepAnim.restart()
prevStep = currentIndex
}
opacity: 1
scale: 1
transform: Translate { id: stepTranslate; x: 0 }
ParallelAnimation {
id: stepAnim
property int direction: 1
property int moveDuration: Appearance.animation.elementMove.duration
// Fade + scale out, then fade + scale in
SequentialAnimation {
ParallelAnimation {
NumberAnimation {
target: stepStack; property: "opacity"; to: 0
duration: stepAnim.moveDuration * 0.35
easing.type: Easing.OutCubic
}
NumberAnimation {
target: stepStack; property: "scale"; to: 0.96
duration: stepAnim.moveDuration * 0.35
easing.type: Easing.OutCubic
}
}
ParallelAnimation {
NumberAnimation {
target: stepStack; property: "opacity"; to: 1
duration: stepAnim.moveDuration * 0.65
easing.type: Easing.OutCubic
}
NumberAnimation {
target: stepStack; property: "scale"; to: 1
duration: stepAnim.moveDuration * 0.65
easing.type: Easing.OutBack
easing.overshoot: 1.2
}
}
}
// Slide animation with improved easing
SequentialAnimation {
NumberAnimation {
target: stepTranslate; property: "x"
to: stepAnim.direction * -30
duration: stepAnim.moveDuration * 0.35
easing.type: Easing.OutCubic
}
PropertyAction {
target: stepTranslate; property: "x"
value: stepAnim.direction * 30
}
NumberAnimation {
target: stepTranslate; property: "x"; to: 0
duration: stepAnim.moveDuration * 0.65
easing.type: Easing.OutCubic
}
}
}
Item {
WelcomeContent {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
Item {
ThemeContent {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
Item {
LayoutContent {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
Item {
FeaturesContent {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
Item {
ReadyContent {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
}
}
// Navigation buttons — Back / hint / Continue (Skip moved to top-right corner)
RowLayout {
Layout.fillWidth: true
spacing: 12
DialogButton {
visible: root.currentStep > 0
buttonText: Translation.tr("Back")
colBackground: Appearance.colors.colLayer2
colBackgroundHover: Appearance.colors.colLayer2Hover
onClicked: root.currentStep--
}
Item { Layout.fillWidth: true }
// Keyboard hint
RowLayout {
spacing: 6
opacity: 0.6
Row {
spacing: 2
KeyboardKey { key: "←" }
KeyboardKey { key: "→" }
}
StyledText {
text: Translation.tr("navigate")
font.pixelSize: Appearance.font.pixelSize.smallest
color: Appearance.colors.colSubtext
}
}
Item { Layout.fillWidth: true }
DialogButton {
buttonText: root.currentStep === root.totalSteps - 1 ? Translation.tr("Get Started") : Translation.tr("Continue")
colBackground: Appearance.colors.colPrimary
colBackgroundHover: Appearance.colors.colPrimaryHover
colText: Appearance.colors.colOnPrimary
onClicked: root.currentStep < root.totalSteps - 1 ? root.currentStep++ : root.finish(false)
}
}
}
// Subtle "Skip setup" escape hatch in the top-right corner of the card.
// Hidden on the last step (where "Get Started" is the right action).
RippleButton {
id: skipButton
property bool _hovered: false
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: 14
anchors.rightMargin: 14
visible: root.currentStep < root.totalSteps - 1
opacity: visible ? (_hovered ? 1.0 : 0.65) : 0
Behavior on opacity { NumberAnimation { duration: Appearance.animation.elementMoveFast.duration } }
implicitHeight: 30
implicitWidth: skipRow.implicitWidth + 20
buttonRadius: Appearance.rounding.full
colBackground: "transparent"
colBackgroundHover: Appearance.colors.colLayer2Hover
onClicked: root.finish(true)
contentItem: RowLayout {
id: skipRow
anchors.centerIn: parent
spacing: 4
StyledText {
text: Translation.tr("Skip setup")
font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colSubtext
}
MaterialSymbol {
text: "close"
iconSize: 14
color: Appearance.colors.colSubtext
}
}
StyledToolTip {
text: Translation.tr("You can re-open this wizard anytime with:\n inir welcome")
}
HoverHandler {
cursorShape: Qt.PointingHandCursor
onHoveredChanged: skipButton._hovered = hovered
}
}
}
}
// ═══════════════════════════════════════════════════════════════════════
// STEP CONTENT COMPONENTS
// ═══════════════════════════════════════════════════════════════════════
component WelcomeContent: ColumnLayout {
width: 640
spacing: 18
Item { Layout.fillHeight: true }
MaterialShapeWrappedMaterialSymbol {
Layout.alignment: Qt.AlignHCenter
text: "waving_hand"
iconSize: 56
padding: 18
shape: MaterialShape.Shape.Cookie4Sided
color: Appearance.colors.colPrimaryContainer
colSymbol: Appearance.colors.colOnPrimaryContainer
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: Translation.tr("Welcome to inir")
font.family: Appearance.font.family.title
font.pixelSize: Appearance.font.pixelSize.hugeass + 6
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: Translation.tr("Two minutes to make it yours. Skipping is fine, but you'll thank yourself later.")
color: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.normal
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
Layout.maximumWidth: 520
}
// "What we'll set up" — gives users a preview so they see VALUE before skipping
Rectangle {
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 6
Layout.maximumWidth: 540
implicitWidth: 520
implicitHeight: previewCol.implicitHeight + 24
radius: Appearance.inirEverywhere ? Appearance.inir.roundingNormal : Appearance.rounding.normal
color: Appearance.inirEverywhere ? Appearance.inir.colLayer2
: Appearance.auroraEverywhere ? ColorUtils.transparentize(Appearance.colors.colLayer2, 0.5)
: Appearance.colors.colLayer2
border.width: Appearance.inirEverywhere ? 1 : 0
border.color: Appearance.inir.colBorderSubtle
ColumnLayout {
id: previewCol
anchors {
fill: parent
margins: 12
}
spacing: 10
StyledText {
Layout.fillWidth: true
text: Translation.tr("What you'll dial in")
font.pixelSize: Appearance.font.pixelSize.smaller
font.weight: Font.Medium
color: Appearance.colors.colSubtext
}
Repeater {
model: [
{ icon: "palette", label: Translation.tr("Theme & wallpaper"), desc: Translation.tr("Light/dark, visual style, and your colors") },
{ icon: "dashboard", label: Translation.tr("Layout"), desc: Translation.tr("Bar, dock, panel family — where things live") },
{ icon: "tune", label: Translation.tr("Features"), desc: Translation.tr("AI, weather, sounds, time format, and more") },
{ icon: "celebration", label: Translation.tr("Tips for daily use"), desc: Translation.tr("Keyboard shortcuts and one-click actions") }
]
RowLayout {
Layout.fillWidth: true
required property var modelData
spacing: 12
MaterialSymbol {
text: modelData.icon
iconSize: 22
color: Appearance.colors.colPrimary
Layout.preferredWidth: 24
}
ColumnLayout {
Layout.fillWidth: true
spacing: 0
StyledText {
Layout.fillWidth: true
text: modelData.label
font.pixelSize: Appearance.font.pixelSize.small
font.weight: Font.Medium
color: Appearance.colors.colOnSurface
}
StyledText {
Layout.fillWidth: true
text: modelData.desc
font.pixelSize: Appearance.font.pixelSize.smaller
color: Appearance.colors.colSubtext
wrapMode: Text.WordWrap
elide: Text.ElideRight
}
}
}
}
}
}
// Settings UI experience choice — Easy vs Advanced
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 12
Layout.maximumWidth: 560
spacing: 8
StyledText {
Layout.alignment: Qt.AlignHCenter
text: Translation.tr("How do you want to see Settings?")
font.pixelSize: Appearance.font.pixelSize.small
font.weight: Font.Medium
color: Appearance.colors.colOnSurface
}
RowLayout {
Layout.alignment: Qt.AlignHCenter
spacing: 12
// Easy mode card
Rectangle {
id: easyCard
readonly property bool selected: (Config.options?.settingsUi?.easyMode ?? false) === true
implicitWidth: 240
implicitHeight: easyCardCol.implicitHeight + 24
radius: Appearance.inirEverywhere ? Appearance.inir.roundingNormal : Appearance.rounding.normal
color: selected
? Appearance.colors.colPrimaryContainer
: (Appearance.inirEverywhere ? Appearance.inir.colLayer2
: Appearance.auroraEverywhere ? ColorUtils.transparentize(Appearance.colors.colLayer2, 0.5)
: Appearance.colors.colLayer2)
border.width: selected ? 2 : 1
border.color: selected
? Appearance.colors.colPrimary
: (Appearance.inirEverywhere ? Appearance.inir.colBorderSubtle
: Appearance.colors.colLayer0Border)
Behavior on color {
enabled: Appearance.animationsEnabled
animation: ColorAnimation { duration: Appearance.animation.elementMoveFast.duration; easing.type: Appearance.animation.elementMoveFast.type; easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve }
}
ColumnLayout {
id: easyCardCol
anchors {
fill: parent
margins: 12
}
spacing: 6
RowLayout {
spacing: 8
MaterialSymbol {
text: "school"
iconSize: 22
color: easyCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colPrimary
}
StyledText {
Layout.fillWidth: true
text: Translation.tr("Easy")
font.pixelSize: Appearance.font.pixelSize.normal
font.weight: Font.Medium
color: easyCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colOnSurface
}
MaterialSymbol {
visible: easyCard.selected
text: "check_circle"
iconSize: 18
color: Appearance.colors.colOnPrimaryContainer
}
}
StyledText {
Layout.fillWidth: true
text: Translation.tr("Just the essentials. Less noise, friendlier for new users. You can switch anytime.")
font.pixelSize: Appearance.font.pixelSize.smaller
wrapMode: Text.WordWrap
color: easyCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colSubtext
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Config.setNestedValue("settingsUi.easyMode", true)
}
}
// Advanced mode card
Rectangle {
id: advancedCard
readonly property bool selected: (Config.options?.settingsUi?.easyMode ?? false) === false
implicitWidth: 240
implicitHeight: advancedCardCol.implicitHeight + 24
radius: Appearance.inirEverywhere ? Appearance.inir.roundingNormal : Appearance.rounding.normal
color: selected
? Appearance.colors.colPrimaryContainer
: (Appearance.inirEverywhere ? Appearance.inir.colLayer2
: Appearance.auroraEverywhere ? ColorUtils.transparentize(Appearance.colors.colLayer2, 0.5)
: Appearance.colors.colLayer2)
border.width: selected ? 2 : 1
border.color: selected
? Appearance.colors.colPrimary
: (Appearance.inirEverywhere ? Appearance.inir.colBorderSubtle
: Appearance.colors.colLayer0Border)
Behavior on color {
enabled: Appearance.animationsEnabled
animation: ColorAnimation { duration: Appearance.animation.elementMoveFast.duration; easing.type: Appearance.animation.elementMoveFast.type; easing.bezierCurve: Appearance.animation.elementMoveFast.bezierCurve }
}
ColumnLayout {
id: advancedCardCol
anchors {
fill: parent
margins: 12
}
spacing: 6
RowLayout {
spacing: 8
MaterialSymbol {
text: "tune"
iconSize: 22
color: advancedCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colPrimary
}
StyledText {
Layout.fillWidth: true
text: Translation.tr("Advanced")
font.pixelSize: Appearance.font.pixelSize.normal
font.weight: Font.Medium
color: advancedCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colOnSurface
}
MaterialSymbol {
visible: advancedCard.selected
text: "check_circle"
iconSize: 18
color: Appearance.colors.colOnPrimaryContainer
}
}
StyledText {
Layout.fillWidth: true
text: Translation.tr("Everything iNiR has to offer. Recommended if you like to tinker.")
font.pixelSize: Appearance.font.pixelSize.smaller
wrapMode: Text.WordWrap
color: advancedCard.selected
? Appearance.colors.colOnPrimaryContainer
: Appearance.colors.colSubtext
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Config.setNestedValue("settingsUi.easyMode", false)
}
}
}
}
Item { Layout.fillHeight: true }
}
component ThemeContent: Flickable {
id: themeFlickable
width: 600
contentHeight: themeColumn.implicitHeight
clip: true
boundsBehavior: Flickable.StopAtBounds
ColumnLayout {
id: themeColumn
width: parent.width
spacing: 16
// Light/Dark toggle
RowLayout {
Layout.alignment: Qt.AlignHCenter
spacing: 16
LightDarkPreferenceButton { dark: false }
LightDarkPreferenceButton { dark: true }
}
// Global style selector
SettingsGroup {
Layout.fillWidth: true
Layout.maximumWidth: 560
Layout.alignment: Qt.AlignHCenter
ColumnLayout {
Layout.fillWidth: true
spacing: 10
RowLayout {
Layout.fillWidth: true
MaterialSymbol { text: "style"; iconSize: 20; color: Appearance.colors.colPrimary }
StyledText { text: Translation.tr("Visual Style"); font.pixelSize: Appearance.font.pixelSize.normal }
Item { Layout.fillWidth: true }
StyledText {
text: {
const style = Config.options?.appearance?.globalStyle ?? "material"
return style === "material" ? Translation.tr("Clean & Solid")
: style === "cards" ? Translation.tr("Rounded Cards")
: style === "aurora" ? Translation.tr("Glass & Blur")
: style === "angel" ? Translation.tr("Neo-Brutalism Glass")
: Translation.tr("Terminal Style")
}
color: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.smaller
}
}
ConfigSelectionArray {
Layout.fillWidth: true
currentValue: Config.options?.appearance?.globalStyle ?? "material"
onSelected: newValue => {
Config.setNestedValue("appearance.globalStyle", newValue)
}
options: [
{ displayName: "Material", icon: "dashboard", value: "material" },
{ displayName: "Cards", icon: "crop_square", value: "cards" },
{ displayName: "Aurora", icon: "blur_on", value: "aurora" },
{ displayName: "Angel", icon: "auto_awesome", value: "angel" },
{ displayName: "Inir", icon: "terminal", value: "inir" }
]
}
}
}
// Wallpaper - Inline picker (like QuickWallpaper widget)
SettingsGroup {
id: wallpaperGroup
Layout.fillWidth: true
Layout.maximumWidth: 560
Layout.alignment: Qt.AlignHCenter
property var wallpapersList: []
readonly property string wallpapersPath: Directories.wallpapersPath
readonly property real itemWidth: 130
readonly property real itemHeight: 78
Component.onCompleted: wallpaperScanProc.running = true
Process {