mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-07 04:15:26 +00:00
feat(activewindow): Add tri-state hideMode to ActiveWindow
This commit is contained in:
@@ -15,25 +15,43 @@ ColumnLayout {
|
||||
|
||||
// Local state
|
||||
property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon
|
||||
property bool valueAutoHide: widgetData.autoHide !== undefined ? widgetData.autoHide : widgetMetadata.autoHide
|
||||
property string valueHideMode: "hidden" // Default to 'Hide When Empty'
|
||||
property string valueScrollingMode: widgetData.scrollingMode || widgetMetadata.scrollingMode
|
||||
property int valueWidth: widgetData.width !== undefined ? widgetData.width : widgetMetadata.width
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.autoHide = valueAutoHide
|
||||
settings.hideMode = valueHideMode
|
||||
settings.showIcon = valueShowIcon
|
||||
settings.scrollingMode = valueScrollingMode
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width
|
||||
return settings
|
||||
}
|
||||
|
||||
NToggle {
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.active-window.auto-hide.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.auto-hide.description")
|
||||
checked: root.valueAutoHide
|
||||
onToggled: checked => root.valueAutoHide = checked
|
||||
label: I18n.tr("bar.widget-settings.active-window.hide-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.hide-mode.description")
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("options.hide-modes.visible")
|
||||
}, {
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("options.hide-modes.hidden")
|
||||
}, {
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("options.hide-modes.transparent")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => root.valueHideMode = key
|
||||
}
|
||||
|
||||
NToggle {
|
||||
|
||||
Reference in New Issue
Block a user