mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
UserInterfaceTab: remove dimDesktop toggle, only use dimming slider
Settings: add migration for dimDesktop -> dimmerOpacity Autoformat
This commit is contained in:
@@ -79,13 +79,12 @@ PanelWindow {
|
||||
}
|
||||
|
||||
// Desktop dimming when panels are open
|
||||
property bool dimDesktop: Settings.data.general.dimDesktop
|
||||
property real dimmerOpacity: Settings.data.general.dimmerOpacity ?? 0.8
|
||||
property bool isPanelOpen: (PanelService.openedPanel !== null) && (PanelService.openedPanel.screen === screen)
|
||||
property bool isPanelClosing: (PanelService.openedPanel !== null) && PanelService.openedPanel.isClosing
|
||||
|
||||
color: {
|
||||
if (dimDesktop && isPanelOpen) {
|
||||
if (dimmerOpacity > 0 && isPanelOpen) {
|
||||
return Qt.alpha(Color.mShadow, dimmerOpacity)
|
||||
}
|
||||
return Color.transparent
|
||||
|
||||
@@ -25,16 +25,8 @@ ColumnLayout {
|
||||
onToggled: checked => Settings.data.ui.tooltipsEnabled = checked
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("settings.user-interface.dim-desktop.label")
|
||||
description: I18n.tr("settings.user-interface.dim-desktop.description")
|
||||
checked: Settings.data.general.dimDesktop
|
||||
onToggled: checked => Settings.data.general.dimDesktop = checked
|
||||
}
|
||||
|
||||
// when dimDesktop is enabled: dimmer opacity
|
||||
// Dim desktop opacity
|
||||
ColumnLayout {
|
||||
visible: Settings.data.general.dimDesktop
|
||||
spacing: Style.marginXXS
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ ColumnLayout {
|
||||
Layout.bottomMargin: Style.marginS
|
||||
}
|
||||
|
||||
// Dim Desktop toggle
|
||||
// Dim Desktop opacity
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginM
|
||||
@@ -471,23 +471,27 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 2
|
||||
NText {
|
||||
text: I18n.tr("settings.user-interface.dim-desktop.label")
|
||||
text: I18n.tr("settings.user-interface.dimmer-opacity.label")
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
}
|
||||
NText {
|
||||
text: I18n.tr("settings.user-interface.dim-desktop.description")
|
||||
text: I18n.tr("settings.user-interface.dimmer-opacity.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
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXS
|
||||
from: 0
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
value: Settings.data.general.dimmerOpacity
|
||||
onMoved: value => Settings.data.general.dimmerOpacity = value
|
||||
text: Math.floor(Settings.data.general.dimmerOpacity * 100) + "%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user