SetupWizard: add dimdesktop & dropshadow option

This commit is contained in:
Ly-sec
2025-11-03 18:00:06 +01:00
parent 451784a82b
commit e4bb28dd5e
3 changed files with 139 additions and 17 deletions
+14 -2
View File
@@ -235,8 +235,20 @@ ColumnLayout {
visible: !DistroService.isNixOS
text: I18n.tr("settings.general.launch-setup-wizard")
onClicked: {
setupWizardLoader.active = false
setupWizardLoader.active = true
var targetScreen = PanelService.openedPanel ? PanelService.openedPanel.screen : (Quickshell.screens.length > 0 ? Quickshell.screens[0] : null)
if (!targetScreen) {
return
}
var setupPanel = PanelService.getPanel("setupWizardPanel", targetScreen)
if (setupPanel) {
setupPanel.open()
} else {
Qt.callLater(() => {
var sp = PanelService.getPanel("setupWizardPanel", targetScreen)
if (sp)
sp.open()
})
}
}
}
}
+102
View File
@@ -442,6 +442,108 @@ ColumnLayout {
}
}
// Divider
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: Color.mOutline
opacity: 0.2
Layout.topMargin: Style.marginS
Layout.bottomMargin: Style.marginS
}
// Dim Desktop toggle
RowLayout {
Layout.fillWidth: true
spacing: Style.marginM
Rectangle {
width: 32
height: 32
radius: Style.radiusM
color: Color.mSurface
NIcon {
icon: "screen-share"
pointSize: Style.fontSizeL
color: Color.mPrimary
anchors.centerIn: parent
}
}
ColumnLayout {
Layout.fillWidth: true
spacing: 2
NText {
text: I18n.tr("settings.user-interface.dim-desktop.label")
pointSize: Style.fontSizeL
font.weight: Style.fontWeightBold
color: Color.mOnSurface
}
NText {
text: I18n.tr("settings.user-interface.dim-desktop.description")
pointSize: Style.fontSizeS
color: Color.mOnSurfaceVariant
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
}
NToggle {
checked: Settings.data.general.dimDesktop
onToggled: function (checked) {
Settings.data.general.dimDesktop = checked
}
}
}
// Divider
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: Color.mOutline
opacity: 0.2
Layout.topMargin: Style.marginS
Layout.bottomMargin: Style.marginS
}
// Drop Shadows toggle
RowLayout {
Layout.fillWidth: true
spacing: Style.marginM
Rectangle {
width: 32
height: 32
radius: Style.radiusM
color: Color.mSurface
NIcon {
icon: "shadow"
pointSize: Style.fontSizeL
color: Color.mPrimary
anchors.centerIn: parent
}
}
ColumnLayout {
Layout.fillWidth: true
spacing: 2
NText {
text: I18n.tr("settings.user-interface.shadows.label")
pointSize: Style.fontSizeL
font.weight: Style.fontWeightBold
color: Color.mOnSurface
}
NText {
text: I18n.tr("settings.user-interface.shadows.description")
pointSize: Style.fontSizeS
color: Color.mOnSurfaceVariant
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
}
NToggle {
checked: Settings.data.general.enableShadows
onToggled: function (checked) {
Settings.data.general.enableShadows = checked
}
}
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: Style.marginL
+23 -15
View File
@@ -137,6 +137,11 @@ ShellRoot {
BatteryPanel {}
}
Component {
id: setupWizardComponent
SetupWizard {}
}
Component {
id: barComp
Bar {}
@@ -267,6 +272,9 @@ ShellRoot {
}, {
"id": "batteryPanel",
"component": batteryComponent
}, {
"id": "setupWizardPanel",
"component": setupWizardComponent
}]
// Bar component
@@ -291,20 +299,6 @@ ShellRoot {
}
}
// ------------------------------
// Setup Wizard
Loader {
id: setupWizardLoader
active: false
asynchronous: true
sourceComponent: SetupWizard {}
onLoaded: {
if (setupWizardLoader.item && setupWizardLoader.item.open) {
setupWizardLoader.item.open()
}
}
}
Connections {
target: Settings
function onSettingsLoaded() {
@@ -329,7 +323,21 @@ ShellRoot {
}
if (Settings.data.settingsVersion >= Settings.settingsVersion) {
setupWizardLoader.active = true
// Open Setup Wizard as a panel in the same windowing system as Settings/ControlCenter
if (Quickshell.screens.length > 0) {
var targetScreen = Quickshell.screens[0]
var setupPanel = PanelService.getPanel("setupWizardPanel", targetScreen)
if (setupPanel) {
setupPanel.open()
} else {
// If not yet loaded, ensure it loads and try again shortly
Qt.callLater(() => {
var sp = PanelService.getPanel("setupWizardPanel", targetScreen)
if (sp)
sp.open()
})
}
}
} else {
Settings.data.setupCompleted = true
}