diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 61bd55a8..ce511f49 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -490,6 +490,17 @@ "none": "Keine", "wave": "Welle" }, + "shadow-direction": { + "bottom": "Unten", + "bottom_left": "Unten links", + "bottom_right": "Unten rechts", + "center": "Zentriert", + "left": "Links", + "right": "Rechts", + "top": "Oben", + "top_left": "Oben links", + "top_right": "Oben rechts" + }, "workspace-labels": { "index": "Index", "name": "Name", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Aktiviert Schlagschatten unter Balken und Panels.", - "label": "Schlagschatten" + "label": "Schlagschatten", + "direction": { + "description": "Wählen, aus welcher Richtung der Schatten fällt.", + "label": "Schattenrichtung" + } }, "title": "Benutzeroberfläche", "tooltips": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index d2eee948..5a77e12e 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -490,6 +490,17 @@ "none": "None", "wave": "Wave" }, + "shadow-direction": { + "bottom": "Below", + "bottom_left": "Bottom left", + "bottom_right": "Bottom right", + "center": "Overhead", + "left": "Left", + "right": "Right", + "top": "Above", + "top_left": "Top left", + "top_right": "Top right" + }, "workspace-labels": { "index": "Index", "name": "Name", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Enables drop shadows under bars and panels.", - "label": "Drop shadows" + "label": "Drop shadows", + "direction": { + "description": "Choose where the shadow is cast from.", + "label": "Shadow direction" + } }, "title": "User interface", "tooltips": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index ddcc0b06..6ee4a312 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -490,6 +490,17 @@ "none": "Ninguno", "wave": "Onda" }, + "shadow-direction": { + "bottom": "Inferior", + "bottom_left": "Inferior izquierda", + "bottom_right": "Inferior derecha", + "center": "Centro", + "left": "Izquierda", + "right": "Derecha", + "top": "Superior", + "top_left": "Superior izquierda", + "top_right": "Superior derecha" + }, "workspace-labels": { "index": "Índice", "name": "Nombre", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Habilita sombras paralelas debajo de las barras y los paneles.", - "label": "Sombras paralelas" + "label": "Sombras paralelas", + "direction": { + "description": "Elige desde dónde se proyecta la sombra.", + "label": "Dirección de la sombra" + } }, "title": "Interfaz de usuario", "tooltips": { diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 9f9a87fb..68ee83f0 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -490,6 +490,17 @@ "none": "Aucun", "wave": "Vague" }, + "shadow-direction": { + "bottom": "En bas", + "bottom_left": "En bas à gauche", + "bottom_right": "En bas à droite", + "center": "Au centre", + "left": "Gauche", + "right": "Droite", + "top": "En haut", + "top_left": "En haut à gauche", + "top_right": "En haut à droite" + }, "workspace-labels": { "index": "Index", "name": "Nom", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Active les ombres portées sous les barres et les panneaux.", - "label": "Ombres portées" + "label": "Ombres portées", + "direction": { + "description": "Choisissez d’où vient l’ombre.", + "label": "Direction de l’ombre" + } }, "title": "Interface utilisateur", "tooltips": { diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index f635278b..86fab3f0 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -490,6 +490,17 @@ "none": "Nenhum", "wave": "Onda" }, + "shadow-direction": { + "bottom": "Inferior", + "bottom_left": "Inferior esquerda", + "bottom_right": "Inferior direita", + "center": "Centro", + "left": "Esquerda", + "right": "Direita", + "top": "Superior", + "top_left": "Superior esquerda", + "top_right": "Superior direita" + }, "workspace-labels": { "index": "Índice", "name": "Nome", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Ativa sombras projetadas sob barras e painéis.", - "label": "Sombras projetadas" + "label": "Sombras projetadas", + "direction": { + "description": "Escolha de onde a sombra é projetada.", + "label": "Direção da sombra" + } }, "title": "Interface do usuário", "tooltips": { diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 63da3f02..64276f95 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -490,6 +490,17 @@ "none": "Hiçbiri", "wave": "Dalga" }, + "shadow-direction": { + "bottom": "Alt", + "bottom_left": "Sol alt", + "bottom_right": "Sağ alt", + "center": "Merkez", + "left": "Sol", + "right": "Sağ", + "top": "Üst", + "top_left": "Sol üst", + "top_right": "Sağ üst" + }, "workspace-labels": { "index": "İndeks", "name": "İsim", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Çubukların ve panellerin altında gölgelerin etkinleştirilmesini sağlar.", - "label": "Gölge efektleri" + "label": "Gölge efektleri", + "direction": { + "description": "Gölgenin hangi yönden verileceğini seçin.", + "label": "Gölge yönü" + } }, "title": "Kullanıcı arayüzü", "tooltips": { diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index f8ab0094..a75c70db 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -490,6 +490,17 @@ "none": "Немає", "wave": "Хвиля" }, + "shadow-direction": { + "bottom": "Знизу", + "bottom_left": "Знизу ліворуч", + "bottom_right": "Знизу праворуч", + "center": "По центру", + "left": "Ліворуч", + "right": "Праворуч", + "top": "Згори", + "top_left": "Згори ліворуч", + "top_right": "Згори праворуч" + }, "workspace-labels": { "index": "Індекс", "name": "Назва", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "Увімкнути тіні під панелями та смугами.", - "label": "Тіні" + "label": "Тіні", + "direction": { + "description": "Виберіть, звідки падає тінь.", + "label": "Напрямок тіні" + } }, "title": "Користувацький інтерфейс", "tooltips": { diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index dff7dede..2ac08e2c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -490,6 +490,17 @@ "none": "无", "wave": "波形" }, + "shadow-direction": { + "bottom": "下方", + "bottom_left": "左下", + "bottom_right": "右下", + "center": "居中", + "left": "左侧", + "right": "右侧", + "top": "上方", + "top_left": "左上", + "top_right": "右上" + }, "workspace-labels": { "index": "索引", "name": "名称", @@ -1500,7 +1511,11 @@ }, "shadows": { "description": "启用条形图和面板下的阴影。", - "label": "阴影" + "label": "阴影", + "direction": { + "description": "选择阴影投射的方向。", + "label": "阴影方向" + } }, "title": "用户界面", "tooltips": { diff --git a/Commons/Settings.qml b/Commons/Settings.qml index b85c5f6c..c4fa4757 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -200,6 +200,9 @@ Singleton { property bool compactLockScreen: false property bool lockOnSuspend: true property bool enableShadows: true + property string shadowDirection: "bottom_right" + property int shadowOffsetX: 2 + property int shadowOffsetY: 3 property string language: "" } diff --git a/Modules/Settings/Tabs/UserInterfaceTab.qml b/Modules/Settings/Tabs/UserInterfaceTab.qml index a2aed9be..c3bdee95 100644 --- a/Modules/Settings/Tabs/UserInterfaceTab.qml +++ b/Modules/Settings/Tabs/UserInterfaceTab.qml @@ -47,6 +47,71 @@ ColumnLayout { onToggled: checked => Settings.data.general.enableShadows = checked } + // Shadow direction + NComboBox { + visible: Settings.data.general.enableShadows + label: I18n.tr("settings.user-interface.shadows.direction.label") + description: I18n.tr("settings.user-interface.shadows.direction.description") + Layout.fillWidth: true + + readonly property var shadowOptionsMap: ({ + "top_left": { + "name": I18n.tr("options.shadow-direction.top_left"), + "p": Qt.point(-2, -2) + }, + "top": { + "name": I18n.tr("options.shadow-direction.top"), + "p": Qt.point(0, -3) + }, + "top_right": { + "name": I18n.tr("options.shadow-direction.top_right"), + "p": Qt.point(2, -2) + }, + "left": { + "name": I18n.tr("options.shadow-direction.left"), + "p": Qt.point(-3, 0) + }, + "center": { + "name": I18n.tr("options.shadow-direction.center"), + "p": Qt.point(0, 0) + }, + "right": { + "name": I18n.tr("options.shadow-direction.right"), + "p": Qt.point(3, 0) + }, + "bottom_left": { + "name": I18n.tr("options.shadow-direction.bottom_left"), + "p": Qt.point(-2, 2) + }, + "bottom": { + "name": I18n.tr("options.shadow-direction.bottom"), + "p": Qt.point(0, 3) + }, + "bottom_right": { + "name": I18n.tr("options.shadow-direction.bottom_right"), + "p": Qt.point(2, 3) + } + }) + + model: Object.keys(shadowOptionsMap).map(function (k) { + return { + "key": k, + "name": shadowOptionsMap[k].name + } + }) + + currentKey: Settings.data.general.shadowDirection + + onSelected: function (key) { + var opt = shadowOptionsMap[key] + if (opt) { + Settings.data.general.shadowDirection = key + Settings.data.general.shadowOffsetX = opt.p.x + Settings.data.general.shadowOffsetY = opt.p.y + } + } + } + NToggle { label: I18n.tr("settings.user-interface.panels-overlay.label") description: I18n.tr("settings.user-interface.panels-overlay.description") diff --git a/Widgets/NFullScreenWindow.qml b/Widgets/NFullScreenWindow.qml index 4db7a09e..f298a3bd 100644 --- a/Widgets/NFullScreenWindow.qml +++ b/Widgets/NFullScreenWindow.qml @@ -18,8 +18,8 @@ PanelWindow { // Shadow properties property real shadowOpacity: 1.0 property real shadowBlur: 1.0 - property real shadowHorizontalOffset: 2 - property real shadowVerticalOffset: 3 + property real shadowHorizontalOffset: Settings.data.general.shadowOffsetX + property real shadowVerticalOffset: Settings.data.general.shadowOffsetY property color black: "#000000" property color white: "#ffffff"