From e437939407fc764c847bb461bdcc2a7af5de6e4f Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Tue, 16 Dec 2025 20:20:41 +0100 Subject: [PATCH] SessionMenu: use panel opacity, fix styling DesktopWidgets: add control explanation to edit mode --- Assets/Translations/de.json | 1 + Assets/Translations/en.json | 1 + Assets/Translations/es.json | 1 + Assets/Translations/fr.json | 1 + Assets/Translations/ja.json | 1 + Assets/Translations/nl.json | 1 + Assets/Translations/pt.json | 1 + Assets/Translations/ru.json | 1 + Assets/Translations/tr.json | 1 + Assets/Translations/uk-UA.json | 1 + Assets/Translations/zh-CN.json | 1 + Modules/DesktopWidgets/DesktopWidgets.qml | 19 ++++++++++++ Modules/Panels/SessionMenu/SessionMenu.qml | 35 ++++------------------ Services/Theming/TemplateProcessor.qml | 5 +++- 14 files changed, 39 insertions(+), 31 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 4b5705cc0..b4e12678a 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1362,6 +1362,7 @@ "button": { "label": "Bearbeitungsmodus aktivieren" }, + "controls-explanation": "Linke Maustaste: Widget verschieben\nRechte Maustaste: Widget Größe ändern", "description": "Aktiviere den Bearbeitungsmodus, um Desktop-Widgets zu verschieben und neu zu positionieren. Im aktivierten Zustand zeigen Widgets eine Ziehumrandung und können neu positioniert werden.", "exit-button": "Bearbeitungsmodus verlassen", "label": "Bearbeitungsmodus" diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index c1b3e0b83..074029b4b 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1362,6 +1362,7 @@ "button": { "label": "Enter edit mode" }, + "controls-explanation": "Left Mouse Button: Move widget\nRight Mouse Button: Resize widget", "description": "Enable edit mode to move and reposition desktop widgets. When enabled, widgets show a drag outline and can be repositioned.", "exit-button": "Exit edit mode", "label": "Edit mode" diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 9602fbbe5..5a8e244ec 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1362,6 +1362,7 @@ "button": { "label": "Entrar en modo de edición" }, + "controls-explanation": "Botón izquierdo del ratón: Mover widget\nBotón derecho del ratón: Redimensionar widget", "description": "Habilita el modo de edición para mover y cambiar la posición de los widgets del escritorio. Cuando está habilitado, los widgets muestran un contorno de arrastre y se pueden reposicionar.", "exit-button": "Salir del modo de edición", "label": "Modo de edición" diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 4b6d70f47..6d60b77e7 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1362,6 +1362,7 @@ "button": { "label": "Entrer en mode édition" }, + "controls-explanation": "Bouton gauche de la souris : Déplacer le widget\nBouton droit de la souris : Redimensionner le widget", "description": "Activer le mode édition pour déplacer et repositionner les widgets du bureau. Une fois activé, les widgets affichent un contour de glissement et peuvent être repositionnés.", "exit-button": "Quitter le mode édition", "label": "Mode édition" diff --git a/Assets/Translations/ja.json b/Assets/Translations/ja.json index d0220ef9b..cc69133c4 100644 --- a/Assets/Translations/ja.json +++ b/Assets/Translations/ja.json @@ -1362,6 +1362,7 @@ "button": { "label": "編集モードに入る" }, + "controls-explanation": "左マウスボタン: ウィジェットを移動\n右マウスボタン: ウィジェットのサイズを変更", "description": "デスクトップウィジェットを移動および再配置するには、編集モードを有効にしてください。有効にすると、ウィジェットにドラッグアウトラインが表示され、再配置できます。", "exit-button": "編集モードを終了します。", "label": "編集モード" diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 36ef6e275..9b5a8ca6d 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -1362,6 +1362,7 @@ "button": { "label": "Ga naar de bewerkingsmodus" }, + "controls-explanation": "Linkermuisknop: Widget verplaatsen\nRechtermuisknop: Widget vergroten/verkleinen", "description": "Schakel de bewerkingsmodus in om desktopwidgets te verplaatsen en te herpositioneren. In de ingeschakelde modus tonen widgets een sleepomtrek en kunnen ze worden verplaatst.", "exit-button": "Bewerkingsmodus verlaten", "label": "Bewerkingsmodus" diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 46277427d..618097dcd 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1362,6 +1362,7 @@ "button": { "label": "Entrar no modo de edição" }, + "controls-explanation": "Botão esquerdo do mouse: Mover widget\nBotão direito do mouse: Redimensionar widget", "description": "Ative o modo de edição para mover e reposicionar widgets da área de trabalho. Quando ativado, os widgets exibem um contorno de arrastar e podem ser reposicionados.", "exit-button": "Sair do modo de edição", "label": "Modo de edição" diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 5565ba74c..9c1436100 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -1362,6 +1362,7 @@ "button": { "label": "Войти в режим редактирования" }, + "controls-explanation": "Левая кнопка мыши: Перемещать виджет\nПравая кнопка мыши: Изменять размер виджета", "description": "Включите режим редактирования, чтобы перемещать и изменять положение виджетов рабочего стола. В этом режиме виджеты отображаются с контуром перетаскивания и могут быть перемещены.", "exit-button": "Выйти из режима редактирования", "label": "Режим редактирования" diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index ec60da7e9..ebc57e969 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1362,6 +1362,7 @@ "button": { "label": "Düzenleme moduna gir" }, + "controls-explanation": "Sol fare tuşu: Araç taşı\nSağ fare tuşu: Araç yeniden boyutlandır", "description": "Masaüstü araçlarını taşımak ve yeniden konumlandırmak için düzenleme modunu etkinleştirin. Etkinleştirildiğinde, araçlar bir sürükleme ana hattı gösterir ve yeniden konumlandırılabilir.", "exit-button": "Düzenleme modundan çık", "label": "Düzenleme modu" diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index a75ecc802..31b79b66e 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1362,6 +1362,7 @@ "button": { "label": "Увійти в режим редагування" }, + "controls-explanation": "Ліва кнопка миші: Переміщувати віджет\nПрава кнопка миші: Змінювати розмір віджета", "description": "Увімкніть режим редагування, щоб переміщувати та змінювати розташування віджетів робочого столу. У ввімкненому стані віджети відображають контур перетягування, і їх можна переміщувати.", "exit-button": "Вийти з режиму редагування", "label": "Режим редагування" diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index f21d8f68d..4ce2cc86a 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1362,6 +1362,7 @@ "button": { "label": "进入编辑模式" }, + "controls-explanation": "鼠标左键:移动小组件\n鼠标右键:调整小组件大小", "description": "启用编辑模式以移动和重新定位桌面小组件。启用后,小组件会显示拖动轮廓,并且可以重新定位。", "exit-button": "退出编辑模式", "label": "编辑模式" diff --git a/Modules/DesktopWidgets/DesktopWidgets.qml b/Modules/DesktopWidgets/DesktopWidgets.qml index b74125d6c..9b2b06dcf 100644 --- a/Modules/DesktopWidgets/DesktopWidgets.qml +++ b/Modules/DesktopWidgets/DesktopWidgets.qml @@ -137,6 +137,25 @@ Variants { z: 10000 onClicked: Settings.data.desktopWidgets.editMode = false } + + // Controls explanation text + NText { + id: controlsExplanation + visible: Settings.data.desktopWidgets.editMode && Settings.data.desktopWidgets.enabled + anchors { + top: editModeButton.bottom + right: parent.right + topMargin: Style.marginM + rightMargin: editModeButton.barOffsetRight + } + text: I18n.tr("settings.desktop-widgets.edit-mode.controls-explanation") + pointSize: Style.fontSizeS + color: Color.mOnSurfaceVariant + horizontalAlignment: Text.AlignRight + wrapMode: Text.WordWrap + width: Math.min(implicitWidth, 300 * Style.uiScaleRatio) + z: 10000 + } } } } diff --git a/Modules/Panels/SessionMenu/SessionMenu.qml b/Modules/Panels/SessionMenu/SessionMenu.qml index 5b160cc77..8401b7ec9 100644 --- a/Modules/Panels/SessionMenu/SessionMenu.qml +++ b/Modules/Panels/SessionMenu/SessionMenu.qml @@ -384,7 +384,7 @@ SmartPanel { width: timerText.width + Style.marginXL * 2 height: timerText.height + Style.marginL * 2 radius: Style.radiusM - color: Qt.alpha(Color.mSurface, 0.9) + color: Qt.alpha(Color.mSurface, Settings.data.ui.panelBackgroundOpacity) border.color: Color.mOutline border.width: Style.borderS z: 1000 @@ -687,11 +687,11 @@ SmartPanel { if (isSelected || mouseArea.containsMouse) { return Qt.alpha(Color.mPrimary, 1.0); } - return Qt.alpha(Color.mSurfaceVariant, 0.65); + return Qt.alpha(Color.mSurfaceVariant, Settings.data.ui.panelBackgroundOpacity); } - border.width: pending ? Style.borderM : (isSelected || mouseArea.containsMouse ? Style.borderM : 0) - border.color: pending ? Color.mPrimary : (isSelected || mouseArea.containsMouse ? Qt.alpha(Color.mPrimary, 0.5) : Color.transparent) + border.width: Style.borderS + border.color: Color.mOutline // Scale transform for hover effect transform: Scale { @@ -788,7 +788,7 @@ SmartPanel { NText { Layout.alignment: Qt.AlignHCenter text: largeButtonRoot.title - font.weight: (largeButtonRoot.isSelected || mouseArea.containsMouse) ? Style.fontWeightBold : Style.fontWeightMedium + font.weight: Style.fontWeightMedium pointSize: Style.fontSizeL color: { if (largeButtonRoot.pending) @@ -806,31 +806,6 @@ SmartPanel { easing.type: Easing.OutCirc } } - - Behavior on font.weight { - PropertyAnimation { - duration: Style.animationFast - } - } - } - - // Pending indicator - Rectangle { - Layout.alignment: Qt.AlignHCenter - Layout.topMargin: -Style.marginM - width: 30 - height: 30 - radius: Math.min(Style.radiusL, width / 2) - color: Color.mPrimary - visible: largeButtonRoot.pending - - NText { - anchors.centerIn: parent - text: Math.ceil(timeRemaining / 1000) - pointSize: Style.fontSizeM - font.weight: Style.fontWeightBold - color: Color.mOnPrimary - } } } diff --git a/Services/Theming/TemplateProcessor.qml b/Services/Theming/TemplateProcessor.qml index 58ae28a99..86c72cc9f 100644 --- a/Services/Theming/TemplateProcessor.qml +++ b/Services/Theming/TemplateProcessor.qml @@ -132,7 +132,10 @@ Singleton { // Uninstall/reinstall with modified vsix to force theme reload var tmpDir = `/tmp/noctalia-vscode-${client.name}`; var modifiedVsix = `${tmpDir}/noctaliatheme.vsix`; - var reinstallVsix = `if command -v ${client.name} >/dev/null 2>&1; then ${client.name} --uninstall-extension undefined_publisher.noctaliatheme 2>&1; rm -rf ${tmpDir} && mkdir -p ${tmpDir} && unzip -q '${Quickshell.shellDir}/Assets/MatugenTemplates/noctaliatheme-0.0.1.vsix' -d ${tmpDir} && cp '${expandedPath}' ${tmpDir}/extension/themes/NoctaliaTheme-color-theme.json && cd ${tmpDir} && zip -q -r ${modifiedVsix} . && ${client.name} --install-extension ${modifiedVsix} 2>&1 && rm -rf ${tmpDir}; fi`; + var reinstallVsix = `if command -v ${client.name} >/dev/null 2>&1; then ${client.name} --uninstall-extension undefined_publisher.noctaliatheme 2>&1; rm -rf ${tmpDir} && mkdir -p ${tmpDir} && unzip -q '${Quickshell.shellDir}/Assets/MatugenTemplates/noctaliatheme-0.0.1.vsix' -d ${tmpDir + } && cp ' + +${expandedPath}' ${tmpDir}/extension/themes/NoctaliaTheme-color-theme.json && cd ${tmpDir} && zip -q -r ${modifiedVsix} . && ${client.name} --install-extension ${modifiedVsix} 2>&1 && rm -rf ${tmpDir}; fi`; var updateSettingsJson = `if command -v ${client.name} >/dev/null 2>&1 && [ -f ${settingsPath} ]; then sed -i 's/\\\\\\"workbench.colorTheme\\\\\\":[[:space:]]*\\\\\\"[^\\\\\\"]*/\\\\\\"workbench.colorTheme\\\\\\": \\\\\\"NoctaliaTheme/' ${settingsPath}; fi`; lines.push(`post_hook = "sh -c \\"${reinstallVsix}; ${updateSettingsJson}\\""`); }