mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(dock): scaffolding for static dock mode
Added 'dockType' setting and created initial StaticDockPanel structure.
This commit is contained in:
@@ -993,6 +993,10 @@
|
||||
"appearance-display-auto-hide": "Auto hide",
|
||||
"appearance-display-description": "Choose how the dock behaves.",
|
||||
"appearance-display-exclusive": "Exclusive",
|
||||
"appearance-type-label": "Dock Style",
|
||||
"appearance-type-description": "Choose between a floating pill or a static bar attached to the edge.",
|
||||
"appearance-type-floating": "Floating",
|
||||
"appearance-type-static": "Static",
|
||||
"appearance-floating-distance-description": "Set the distance between the dock and the edge of the screen.",
|
||||
"appearance-floating-distance-label": "Dock floating distance",
|
||||
"appearance-hide-show-speed-description": "Adjust the speed of the dock hide/show animation.",
|
||||
|
||||
@@ -309,6 +309,7 @@
|
||||
"enabled": true,
|
||||
"position": "bottom",
|
||||
"displayMode": "auto_hide",
|
||||
"dockType": "floating",
|
||||
"backgroundOpacity": 1,
|
||||
"floatingRatio": 1,
|
||||
"size": 1,
|
||||
|
||||
@@ -502,6 +502,15 @@
|
||||
"subTab": 0,
|
||||
"subTabLabel": "common.appearance"
|
||||
},
|
||||
{
|
||||
"labelKey": "panels.dock.appearance-type-label",
|
||||
"descriptionKey": "panels.dock.appearance-type-description",
|
||||
"widget": "NComboBox",
|
||||
"tab": 5,
|
||||
"tabLabel": "panels.dock.title",
|
||||
"subTab": 0,
|
||||
"subTabLabel": "common.appearance"
|
||||
},
|
||||
{
|
||||
"labelKey": "panels.osd.background-opacity-label",
|
||||
"descriptionKey": "panels.dock.appearance-background-opacity-description",
|
||||
|
||||
@@ -523,6 +523,7 @@ Singleton {
|
||||
property bool enabled: true
|
||||
property string position: "bottom" // "top", "bottom", "left", "right"
|
||||
property string displayMode: "auto_hide" // "always_visible", "auto_hide", "exclusive"
|
||||
property string dockType: "floating" // "floating", "static"
|
||||
property real backgroundOpacity: 1.0
|
||||
property real floatingRatio: 1.0
|
||||
property real size: 1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import QtQuick
|
||||
|
||||
import qs.Commons
|
||||
import qs.Modules.MainScreen
|
||||
|
||||
SmartPanel {
|
||||
id: root
|
||||
|
||||
property real dockWidth: 0
|
||||
property real dockHeight: 0
|
||||
|
||||
readonly property string dockPosition: Settings.data.dock.position
|
||||
readonly property bool isVertical: dockPosition === "left" || dockPosition === "right"
|
||||
|
||||
panelAnchorTop: dockPosition === "top"
|
||||
panelAnchorBottom: dockPosition === "bottom"
|
||||
panelAnchorLeft: dockPosition === "left"
|
||||
panelAnchorRight: dockPosition === "right"
|
||||
panelAnchorHorizontalCenter: !isVertical
|
||||
panelAnchorVerticalCenter: isVertical
|
||||
|
||||
forceAttachToBar: true
|
||||
exclusiveKeyboard: false
|
||||
|
||||
preferredWidth: Math.max(1, dockWidth)
|
||||
preferredHeight: Math.max(1, dockHeight)
|
||||
|
||||
panelContent: Item {
|
||||
id: panelContent
|
||||
|
||||
property bool allowAttach: true
|
||||
property real contentPreferredWidth: Math.max(1, root.dockWidth)
|
||||
property real contentPreferredHeight: Math.max(1, root.dockHeight)
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,25 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.dock.appearance-type-label")
|
||||
description: I18n.tr("panels.dock.appearance-type-description")
|
||||
model: [
|
||||
{
|
||||
"key": "floating",
|
||||
"name": I18n.tr("panels.dock.appearance-type-floating")
|
||||
},
|
||||
{
|
||||
"key": "static",
|
||||
"name": I18n.tr("panels.dock.appearance-type-static")
|
||||
}
|
||||
]
|
||||
currentKey: Settings.data.dock.dockType
|
||||
defaultValue: Settings.getDefaultValue("dock.dockType")
|
||||
onSelected: key => Settings.data.dock.dockType = key
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.osd.background-opacity-label")
|
||||
|
||||
Reference in New Issue
Block a user