mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
ActiveWindow: new setting to set your favorite width. Fix #417
This commit is contained in:
@@ -865,6 +865,10 @@
|
||||
"scrolling-mode": {
|
||||
"label": "Scrollmodus",
|
||||
"description": "Steuern, wann Textscrolling für lange Fenstertitel aktiviert ist."
|
||||
},
|
||||
"width": {
|
||||
"description": "Steuert die horizontale Größe des Widgets.",
|
||||
"label": "Widget-Breite"
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -846,6 +846,10 @@
|
||||
"scrolling-mode": {
|
||||
"label": "Scrolling mode",
|
||||
"description": "Control when text scrolling is enabled for long window titles."
|
||||
},
|
||||
"width": {
|
||||
"label": "Widget Width",
|
||||
"description": "Controls the horizontal size of the widget."
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -844,6 +844,10 @@
|
||||
"scrolling-mode": {
|
||||
"label": "Modo de desplazamiento",
|
||||
"description": "Controlar cuándo está habilitado el desplazamiento de texto para títulos de ventana largos."
|
||||
},
|
||||
"width": {
|
||||
"description": "Controla el tamaño horizontal del widget.",
|
||||
"label": "Ancho del widget"
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -844,6 +844,10 @@
|
||||
"auto-hide": {
|
||||
"label": "Masquer automatiquement",
|
||||
"description": "Masquer automatiquement le widget quand aucune fenêtre n'est active."
|
||||
},
|
||||
"width": {
|
||||
"description": "Contrôle la taille horizontale du widget.",
|
||||
"label": "Largeur du widget"
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -844,6 +844,10 @@
|
||||
"scrolling-mode": {
|
||||
"label": "Modo de rolagem",
|
||||
"description": "Controlar quando a rolagem de texto está habilitada para títulos de janela longos."
|
||||
},
|
||||
"width": {
|
||||
"description": "Controla o tamanho horizontal do widget.",
|
||||
"label": "Largura do Widget"
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -844,6 +844,10 @@
|
||||
"scrolling-mode": {
|
||||
"label": "滚动模式",
|
||||
"description": "控制何时为长窗口标题启用文本滚动。"
|
||||
},
|
||||
"width": {
|
||||
"description": "控制小部件的水平尺寸。",
|
||||
"label": "小部件宽度"
|
||||
}
|
||||
},
|
||||
"system-monitor": {
|
||||
|
||||
@@ -41,9 +41,8 @@ Item {
|
||||
readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : widgetMetadata.showIcon
|
||||
readonly property bool autoHide: (widgetSettings.autoHide !== undefined) ? widgetSettings.autoHide : widgetMetadata.autoHide
|
||||
readonly property string scrollingMode: (widgetSettings.scrollingMode !== undefined) ? widgetSettings.scrollingMode : (widgetMetadata.scrollingMode !== undefined ? widgetMetadata.scrollingMode : "hover")
|
||||
readonly property int widgetWidth: (widgetSettings.width !== undefined) ? widgetSettings.width : Math.max(widgetMetadata.width, screen.width * 0.06)
|
||||
|
||||
// Fixed width
|
||||
readonly property real widgetWidth: Math.max(145, screen.width * 0.06)
|
||||
|
||||
implicitHeight: visible ? ((barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight * scaling)) : 0
|
||||
implicitWidth: visible ? ((barPosition === "left" || barPosition === "right") ? Math.round(Style.baseWidgetSize * 0.8 * scaling) : (widgetWidth * scaling)) : 0
|
||||
|
||||
@@ -17,12 +17,14 @@ ColumnLayout {
|
||||
property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon
|
||||
property bool valueAutoHide: widgetData.autoHide !== undefined ? widgetData.autoHide : widgetMetadata.autoHide
|
||||
property string valueScrollingMode: widgetData.scrollingMode || widgetMetadata.scrollingMode
|
||||
property int valueWidth: widgetData.width !== undefined ? widgetData.width : widgetMetadata.width
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.autoHide = valueAutoHide
|
||||
settings.showIcon = valueShowIcon
|
||||
settings.scrollingMode = valueScrollingMode
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width
|
||||
return settings
|
||||
}
|
||||
|
||||
@@ -42,6 +44,15 @@ ColumnLayout {
|
||||
onToggled: checked => root.valueShowIcon = checked
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.active-window.width.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.width.description")
|
||||
placeholderText: widgetMetadata.width
|
||||
text: valueWidth
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.active-window.scrolling-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.scrolling-mode.description")
|
||||
|
||||
@@ -42,7 +42,8 @@ Singleton {
|
||||
"allowUserSettings": true,
|
||||
"showIcon": true,
|
||||
"autoHide": false,
|
||||
"scrollingMode": "hover"
|
||||
"scrollingMode": "hover",
|
||||
"width": 145
|
||||
},
|
||||
"Battery": {
|
||||
"allowUserSettings": true,
|
||||
|
||||
Reference in New Issue
Block a user