mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-07 04:15:26 +00:00
SetupWizard: add dimdesktop & dropshadow option
This commit is contained in:
@@ -235,8 +235,20 @@ ColumnLayout {
|
|||||||
visible: !DistroService.isNixOS
|
visible: !DistroService.isNixOS
|
||||||
text: I18n.tr("settings.general.launch-setup-wizard")
|
text: I18n.tr("settings.general.launch-setup-wizard")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
setupWizardLoader.active = false
|
var targetScreen = PanelService.openedPanel ? PanelService.openedPanel.screen : (Quickshell.screens.length > 0 ? Quickshell.screens[0] : null)
|
||||||
setupWizardLoader.active = true
|
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()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: Style.marginL
|
Layout.preferredHeight: Style.marginL
|
||||||
|
|||||||
@@ -137,6 +137,11 @@ ShellRoot {
|
|||||||
BatteryPanel {}
|
BatteryPanel {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: setupWizardComponent
|
||||||
|
SetupWizard {}
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: barComp
|
id: barComp
|
||||||
Bar {}
|
Bar {}
|
||||||
@@ -267,6 +272,9 @@ ShellRoot {
|
|||||||
}, {
|
}, {
|
||||||
"id": "batteryPanel",
|
"id": "batteryPanel",
|
||||||
"component": batteryComponent
|
"component": batteryComponent
|
||||||
|
}, {
|
||||||
|
"id": "setupWizardPanel",
|
||||||
|
"component": setupWizardComponent
|
||||||
}]
|
}]
|
||||||
|
|
||||||
// Bar component
|
// 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 {
|
Connections {
|
||||||
target: Settings
|
target: Settings
|
||||||
function onSettingsLoaded() {
|
function onSettingsLoaded() {
|
||||||
@@ -329,7 +323,21 @@ ShellRoot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.data.settingsVersion >= Settings.settingsVersion) {
|
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 {
|
} else {
|
||||||
Settings.data.setupCompleted = true
|
Settings.data.setupCompleted = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user