Files
glassMxrph/quickshell/settings/pages/Dock.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

212 lines
6.8 KiB
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import Quickshell
import "../controls"
import "../../components"
import "../../services"
import "../../dock"
SettingsPage {
id: root
readonly property var options: DockModel.options
SettingNote {
warning: true
text: ApplicationsService.error
}
SettingsSection {
PreferenceToggle {
label: "Enable dock"
description: "Floating dock with pinned and running applications"
icon: "󱂩"
setting: "dock.enabled"
}
}
SettingsSection {
title: "Placement"
enabled: root.options.enabled
PreferenceChoice {
label: "Monitor"
icon: "󰍹"
setting: "dock.monitor"
choices: ["primary"].concat(Quickshell.screens.map(s => s.name))
}
PreferenceChoice {
label: "Position"
icon: "󰹑"
setting: "dock.position"
choices: ["bottom", "left", "right"]
}
PreferenceChoice {
label: "Visibility"
description: "Intelligent hides only when a window overlaps the dock"
icon: "󰈈"
setting: "dock.visibility"
choices: ["always", "auto", "intelligent"]
}
}
SettingsSection {
title: "Appearance"
enabled: root.options.enabled
PreferenceSlider {
label: "Icon size"
icon: "󰀻"
setting: "dock.iconSize"
from: 24
to: 80
step: 1
unit: " px"
}
PreferenceSlider {
label: "Spacing"
icon: "󰡏"
setting: "dock.spacing"
from: 0
to: 24
step: 1
unit: " px"
}
PreferenceSlider {
label: "Margin"
icon: "󰹑"
setting: "dock.margin"
from: 0
to: 80
step: 1
unit: " px"
}
PreferenceToggle {
label: "Magnification"
description: "Enlarge icons near the pointer"
icon: "󰍉"
setting: "dock.magnification"
}
PreferenceSlider {
label: "Magnification strength"
icon: "󰍉"
setting: "dock.magnificationStrength"
enabled: root.options.magnification
from: 0
to: 0.8
step: 0.05
}
PreferenceSlider {
label: "Animation speed"
icon: "󰔟"
setting: "dock.animationSpeed"
from: 0.25
to: 3
step: 0.05
unit: "×"
}
}
SettingsSection {
title: "Behaviour"
enabled: root.options.enabled
PreferenceToggle {
label: "Show running apps"
description: "Include unpinned applications with open windows"
icon: "󰖯"
setting: "dock.showRunningApps"
}
PreferenceToggle {
label: "Running indicators"
icon: "󰧞"
setting: "dock.runningIndicators"
}
PreferenceToggle {
label: "Tooltips"
icon: "󰍡"
setting: "dock.tooltips"
}
SettingRow {
title: "Terminal launcher"
description: "JSON argument array for Terminal=true apps: your terminal executable and its execute flag. No terminal is assumed."
icon: "󰆍"
setting: "dock.terminalCommand"
GlassTextField {
Layout.preferredWidth: 240
text: JSON.stringify(root.options.terminalCommand)
placeholderText: "[]"
onEditingFinished: {
try {
ConfigService.setValue("dock.terminalCommand", JSON.parse(text));
} catch (error) {
ApplicationsService.error = "Terminal launcher must be a JSON argument array.";
}
}
}
}
}
SettingsSection {
title: "Pinned applications"
description: "Drag pinned icons in the dock, or use the arrows below."
Repeater {
model: root.options.pinnedApps
SettingRow {
id: pinned
required property string modelData
required property int index
readonly property var entry: ApplicationsService.byId(modelData)
title: entry ? entry.name : modelData + " (unavailable)"
Image {
source: ApplicationsService.icon(pinned.entry)
sourceSize.width: 28
sourceSize.height: 28
Layout.preferredWidth: 28
Layout.preferredHeight: 28
Layout.rightMargin: 4
}
GlassIconButton {
text: "↑"
enabled: pinned.index > 0
onClicked: DockModel.reorder(pinned.modelData, root.options.pinnedApps[pinned.index - 1])
}
GlassIconButton {
text: "↓"
enabled: pinned.index < root.options.pinnedApps.length - 1
onClicked: DockModel.reorder(pinned.modelData, root.options.pinnedApps[pinned.index + 1])
}
GlassButton {
text: "Unpin"
onClicked: DockModel.unpin(pinned.modelData)
}
}
}
SettingNote {
visible: root.options.pinnedApps.length === 0
text: "No pinned applications yet."
}
}
SettingsSection {
title: "Pin an application"
GlassTextField {
id: search
placeholderText: "Find an application to pin…"
Layout.fillWidth: true
Layout.margins: 8
}
Repeater {
model: ApplicationsService.launchable.filter(e => e.name.toLowerCase().includes(search.text.toLowerCase()) && !root.options.pinnedApps.some(id => id.replace(/\.desktop$/i, "") === e.id.replace(/\.desktop$/i, ""))).slice(0, 30)
SettingRow {
id: app
required property var modelData
title: modelData.name
description: modelData.comment || ""
Image {
source: ApplicationsService.icon(app.modelData)
sourceSize.width: 28
sourceSize.height: 28
Layout.preferredWidth: 28
Layout.preferredHeight: 28
Layout.rightMargin: 4
}
GlassButton {
text: "Pin"
onClicked: DockModel.pin(app.modelData.id)
}
}
}
}
}