diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 4993c6444..02295280c 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -36,7 +36,9 @@ "hide-mode-description": "Controls how the widget behaves when no window is active.", "scrolling-mode-description": "Control when text scrolling is enabled for long window titles.", "show-app-icon-description": "Display the application icon next to the window title.", - "show-app-icon-label": "Show app icon" + "show-app-icon-label": "Show app icon", + "show-app-text-description": "Display the window title.", + "show-app-text-label": "Show window title" }, "audio-visualizer": { "color-name-description": "Select the color for the visualizer.", diff --git a/Assets/settings-widgets-default.json b/Assets/settings-widgets-default.json index d810117ff..eeb2c07a7 100644 --- a/Assets/settings-widgets-default.json +++ b/Assets/settings-widgets-default.json @@ -2,6 +2,7 @@ "bar": { "ActiveWindow": { "showIcon": true, + "showText": true, "hideMode": "hidden", "scrollingMode": "hover", "maxWidth": 145, @@ -77,7 +78,7 @@ "maxTextLength": { "horizontal": 10, "vertical": 10 - }, + },"showIcon": true, "enableColorization": false, "colorizeSystemIcon": "none", "ipcIdentifier": "" @@ -291,4 +292,4 @@ "colorName": "primary" } } -} \ No newline at end of file +} diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 14fc1d7b6..12f197ddd 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -40,6 +40,7 @@ Item { // Widget settings - matching MediaMini pattern readonly property bool showIcon: (widgetSettings.showIcon !== undefined) ? widgetSettings.showIcon : (widgetMetadata.showIcon || false) + readonly property bool showText: (widgetSettings.showText !== undefined) ? widgetSettings.showText : (widgetMetadata.showText || false) readonly property string hideMode: (widgetSettings.hideMode !== undefined) ? widgetSettings.hideMode : (widgetMetadata.hideMode || "hidden") readonly property string scrollingMode: (widgetSettings.scrollingMode !== undefined) ? widgetSettings.scrollingMode : (widgetMetadata.scrollingMode || "hover") @@ -98,14 +99,17 @@ Item { // Icon width (if visible) if (showIcon) { contentWidth += iconSize; - contentWidth += Style.marginS; // Spacing after icon + if (showText) { + contentWidth += Style.marginS; // Spacing after icon + } } // Text width (use the measured width) - contentWidth += titleContainer.measuredWidth; - - // Additional small margin for text - contentWidth += Style.margin2XXS; + if (showText) { + contentWidth += titleContainer.measuredWidth; + // Additional small margin for text + contentWidth += Style.margin2XXS; + } // Add container margins contentWidth += margins; @@ -257,6 +261,7 @@ Item { Layout.alignment: Qt.AlignVCenter Layout.preferredHeight: root.capsuleHeight fadeRoundLeftCorners: !showIcon + visible: showText maxWidth: { // Calculate available width based on other elements diff --git a/Modules/Panels/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml b/Modules/Panels/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml index 7fbecd6dd..f997fd6b2 100644 --- a/Modules/Panels/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml +++ b/Modules/Panels/Settings/Bar/WidgetSettings/ActiveWindowSettings.qml @@ -17,6 +17,7 @@ ColumnLayout { // Local state property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon + property bool valueShowText: widgetData.showText !== undefined ? widgetData.showText : widgetMetadata.showText property string valueHideMode: widgetData.hideMode !== undefined ? widgetData.hideMode : widgetMetadata.hideMode property string valueScrollingMode: widgetData.scrollingMode || widgetMetadata.scrollingMode property int valueMaxWidth: widgetData.maxWidth !== undefined ? widgetData.maxWidth : widgetMetadata.maxWidth @@ -34,6 +35,7 @@ ColumnLayout { var settings = Object.assign({}, widgetData || {}); settings.hideMode = valueHideMode; settings.showIcon = valueShowIcon; + settings.showText = valueShowText; settings.scrollingMode = valueScrollingMode; settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth; settings.useFixedWidth = valueUseFixedWidth; @@ -78,6 +80,18 @@ ColumnLayout { defaultValue: widgetMetadata.textColor } + NToggle { + Layout.fillWidth: true + label: I18n.tr("bar.active-window.show-app-text-label") + description: I18n.tr("bar.active-window.show-app-text-description") + checked: root.valueShowText + onToggled: checked => { + root.valueShowText = checked; + saveSettings(); + } + defaultValue: widgetMetadata.showText + } + NToggle { Layout.fillWidth: true label: I18n.tr("bar.active-window.show-app-icon-label") diff --git a/Services/UI/BarWidgetRegistry.qml b/Services/UI/BarWidgetRegistry.qml index 2c0461da0..5c951d4cc 100644 --- a/Services/UI/BarWidgetRegistry.qml +++ b/Services/UI/BarWidgetRegistry.qml @@ -79,6 +79,7 @@ Singleton { property var widgetMetadata: ({ "ActiveWindow": { + "showText": true, "showIcon": true, "hideMode": "hidden", "scrollingMode": "hover",