mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(dock): add customization settings for indicator thickness, color, and opacity
This commit is contained in:
@@ -1064,6 +1064,12 @@
|
|||||||
"appearance-floating-distance-label": "Dock floating distance",
|
"appearance-floating-distance-label": "Dock floating distance",
|
||||||
"appearance-dock-indicator-description": "Show a small indicator when the dock is hidden.",
|
"appearance-dock-indicator-description": "Show a small indicator when the dock is hidden.",
|
||||||
"appearance-dock-indicator-label": "Dock indicator",
|
"appearance-dock-indicator-label": "Dock indicator",
|
||||||
|
"appearance-indicator-thickness-description": "Toggle a thicker hidden dock indicator (6px instead of 3px).",
|
||||||
|
"appearance-indicator-thickness-label": "Thicker indicator",
|
||||||
|
"appearance-indicator-color-description": "Choose the color of the hidden dock indicator.",
|
||||||
|
"appearance-indicator-color-label": "Indicator color",
|
||||||
|
"appearance-indicator-opacity-description": "Adjust the opacity of the hidden dock indicator.",
|
||||||
|
"appearance-indicator-opacity-label": "Indicator opacity",
|
||||||
"appearance-group-apps-description": "Group multiple windows from the same app into one dock entry.",
|
"appearance-group-apps-description": "Group multiple windows from the same app into one dock entry.",
|
||||||
"appearance-group-apps-label": "Group same apps",
|
"appearance-group-apps-label": "Group same apps",
|
||||||
"appearance-group-click-action-cycle": "Cycle windows",
|
"appearance-group-click-action-cycle": "Cycle windows",
|
||||||
|
|||||||
@@ -345,7 +345,10 @@
|
|||||||
"deadOpacity": 0.6,
|
"deadOpacity": 0.6,
|
||||||
"animationSpeed": 1,
|
"animationSpeed": 1,
|
||||||
"sitOnFrame": false,
|
"sitOnFrame": false,
|
||||||
"showDockIndicator": true
|
"showDockIndicator": false,
|
||||||
|
"indicatorThickness": 3,
|
||||||
|
"indicatorColor": "primary",
|
||||||
|
"indicatorOpacity": 0.6
|
||||||
},
|
},
|
||||||
"network": {
|
"network": {
|
||||||
"wifiEnabled": true,
|
"wifiEnabled": true,
|
||||||
|
|||||||
@@ -672,6 +672,33 @@
|
|||||||
"subTab": 0,
|
"subTab": 0,
|
||||||
"subTabLabel": "common.appearance"
|
"subTabLabel": "common.appearance"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"labelKey": "panels.dock.appearance-indicator-thickness-label",
|
||||||
|
"descriptionKey": "panels.dock.appearance-indicator-thickness-description",
|
||||||
|
"widget": "NToggle",
|
||||||
|
"tab": 5,
|
||||||
|
"tabLabel": "panels.dock.title",
|
||||||
|
"subTab": 0,
|
||||||
|
"subTabLabel": "common.appearance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labelKey": "panels.dock.appearance-indicator-color-label",
|
||||||
|
"descriptionKey": "panels.dock.appearance-indicator-color-description",
|
||||||
|
"widget": "NColorChoice",
|
||||||
|
"tab": 5,
|
||||||
|
"tabLabel": "panels.dock.title",
|
||||||
|
"subTab": 0,
|
||||||
|
"subTabLabel": "common.appearance"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"labelKey": "panels.dock.appearance-indicator-opacity-label",
|
||||||
|
"descriptionKey": "panels.dock.appearance-indicator-opacity-description",
|
||||||
|
"widget": "NValueSlider",
|
||||||
|
"tab": 5,
|
||||||
|
"tabLabel": "panels.dock.title",
|
||||||
|
"subTab": 0,
|
||||||
|
"subTabLabel": "common.appearance"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"labelKey": "panels.osd.background-opacity-label",
|
"labelKey": "panels.osd.background-opacity-label",
|
||||||
"descriptionKey": "panels.dock.appearance-background-opacity-description",
|
"descriptionKey": "panels.dock.appearance-background-opacity-description",
|
||||||
|
|||||||
@@ -546,7 +546,10 @@ Singleton {
|
|||||||
property double deadOpacity: 0.6
|
property double deadOpacity: 0.6
|
||||||
property real animationSpeed: 1.0 // Speed multiplier for hide/show animations (0.1 = slowest, 2.0 = fastest)
|
property real animationSpeed: 1.0 // Speed multiplier for hide/show animations (0.1 = slowest, 2.0 = fastest)
|
||||||
property bool sitOnFrame: false
|
property bool sitOnFrame: false
|
||||||
property bool showDockIndicator: true
|
property bool showDockIndicator: false
|
||||||
|
property int indicatorThickness: 3
|
||||||
|
property string indicatorColor: "primary"
|
||||||
|
property real indicatorOpacity: 0.6
|
||||||
}
|
}
|
||||||
|
|
||||||
// network
|
// network
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ Loader {
|
|||||||
readonly property int hideAnimationDuration: Math.max(0, Math.round(Style.animationFast / (Settings.data.dock.animationSpeed || 1.0)))
|
readonly property int hideAnimationDuration: Math.max(0, Math.round(Style.animationFast / (Settings.data.dock.animationSpeed || 1.0)))
|
||||||
readonly property int showAnimationDuration: Math.max(0, Math.round(Style.animationFast / (Settings.data.dock.animationSpeed || 1.0)))
|
readonly property int showAnimationDuration: Math.max(0, Math.round(Style.animationFast / (Settings.data.dock.animationSpeed || 1.0)))
|
||||||
readonly property int peekThickness: 1
|
readonly property int peekThickness: 1
|
||||||
readonly property int indicatorThickness: 3
|
readonly property int indicatorThickness: Settings.data.dock.indicatorThickness || 3
|
||||||
|
readonly property string indicatorColorKey: Settings.data.dock.indicatorColor || "primary"
|
||||||
|
readonly property real indicatorOpacity: Settings.data.dock.indicatorOpacity !== undefined ? Settings.data.dock.indicatorOpacity : 0.6
|
||||||
readonly property int iconSize: Math.round(12 + 24 * (Settings.data.dock.size ?? 1))
|
readonly property int iconSize: Math.round(12 + 24 * (Settings.data.dock.size ?? 1))
|
||||||
readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL
|
readonly property int floatingMargin: Settings.data.dock.floatingRatio * Style.marginL
|
||||||
readonly property int maxWidth: modelData ? modelData.width * 0.8 : 1000
|
readonly property int maxWidth: modelData ? modelData.width * 0.8 : 1000
|
||||||
@@ -768,7 +770,7 @@ Loader {
|
|||||||
id: indicatorRect
|
id: indicatorRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: indicatorThickness
|
radius: indicatorThickness
|
||||||
color: Qt.alpha(Color.mPrimary, 0.6)
|
color: Qt.alpha(Color.resolveColorKey(indicatorColorKey), indicatorOpacity)
|
||||||
opacity: indicatorVisible ? 1 : 0
|
opacity: indicatorVisible ? 1 : 0
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,41 @@ ColumnLayout {
|
|||||||
onToggled: checked => Settings.data.dock.showDockIndicator = checked
|
onToggled: checked => Settings.data.dock.showDockIndicator = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NToggle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: Settings.data.dock.showDockIndicator
|
||||||
|
label: I18n.tr("panels.dock.appearance-indicator-thickness-label")
|
||||||
|
description: I18n.tr("panels.dock.appearance-indicator-thickness-description")
|
||||||
|
checked: (Settings.data.dock.indicatorThickness || 3) >= 6
|
||||||
|
defaultValue: (Settings.getDefaultValue("dock.indicatorThickness") || 3) >= 6
|
||||||
|
onToggled: checked => Settings.data.dock.indicatorThickness = checked ? 6 : 3
|
||||||
|
}
|
||||||
|
|
||||||
|
NColorChoice {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: Settings.data.dock.showDockIndicator
|
||||||
|
label: I18n.tr("panels.dock.appearance-indicator-color-label")
|
||||||
|
description: I18n.tr("panels.dock.appearance-indicator-color-description")
|
||||||
|
currentKey: Settings.data.dock.indicatorColor || "primary"
|
||||||
|
defaultValue: Settings.getDefaultValue("dock.indicatorColor")
|
||||||
|
onSelected: key => Settings.data.dock.indicatorColor = key
|
||||||
|
}
|
||||||
|
|
||||||
|
NValueSlider {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: Settings.data.dock.showDockIndicator
|
||||||
|
label: I18n.tr("panels.dock.appearance-indicator-opacity-label")
|
||||||
|
description: I18n.tr("panels.dock.appearance-indicator-opacity-description")
|
||||||
|
from: 0.1
|
||||||
|
to: 1
|
||||||
|
stepSize: 0.01
|
||||||
|
showReset: true
|
||||||
|
value: Settings.data.dock.indicatorOpacity
|
||||||
|
defaultValue: Settings.getDefaultValue("dock.indicatorOpacity")
|
||||||
|
onMoved: value => Settings.data.dock.indicatorOpacity = value
|
||||||
|
text: Math.floor(Settings.data.dock.indicatorOpacity * 100) + "%"
|
||||||
|
}
|
||||||
|
|
||||||
NValueSlider {
|
NValueSlider {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
label: I18n.tr("panels.osd.background-opacity-label")
|
label: I18n.tr("panels.osd.background-opacity-label")
|
||||||
|
|||||||
Reference in New Issue
Block a user