Files
mxandClaude Opus 5.5 eb81d51c07 Preview a workspace live when hovering it in the bar
The bar popout shows the hovered workspace as on its monitor: the
wallpaper and a live capture of each window where it sits. A click on it
switches there. The focused workspace is not previewed. Settings -> Bar
-> Preview on hover turns it off (bar.workspaces.preview).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 00:01:44 +01:00

191 lines
6.8 KiB
QML
Raw Permalink 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 "../../core"
import "../../theme"
import "../../services/SettingsLogic.js" as Logic
import "../../bar/modules" as Bar
SettingsPage {
id: root
// Screen whose bar is being edited; "" is the shared layout.
property string editScreen: ""
readonly property bool ownLayout: BarLayout.hasOwn(editScreen)
readonly property var modules: BarLayout.modulesFor(editScreen)
function edit(id, key, value) {
BarLayout.save(editScreen, Logic.editModule(modules, id, key, value));
}
function move(id, direction) {
BarLayout.save(editScreen, Logic.moveModule(modules, id, direction));
}
SettingsSection {
title: "Layout"
PreferenceSlider {
label: "Bar height"
icon: "󰕮"
setting: "bar.height"
from: 32
to: 80
step: 1
unit: " px"
}
PreferenceSlider {
label: "Margin"
description: "Gap between the bar and the screen edge"
icon: "󰹑"
setting: "bar.margin"
from: 0
to: 100
step: 1
unit: " px"
}
}
SettingsSection {
title: "Modules"
description: "Drag a module by its grip to reorder it or move it between lanes. Keyboard: Ctrl+↑/↓ reorders; Alt+←/→ changes lane."
padded: true
RowLayout {
Layout.fillWidth: true
spacing: 12
Text {
text: "Screen"
color: Theme.textSecondary
font.pixelSize: 12
}
GlassSegmented {
objectName: "barScreenPicker"
model: ["all screens"].concat(Quickshell.screens.map(s => s.name))
currentIndex: root.editScreen ? model.indexOf(root.editScreen) : 0
onActivated: (index, value) => root.editScreen = index === 0 ? "" : value
}
Item {
Layout.fillWidth: true
}
Text {
visible: root.editScreen !== ""
text: "Separate layout"
color: Theme.text
font.pixelSize: 12
}
GlassToggle {
objectName: "barOwnLayout"
visible: root.editScreen !== ""
checked: root.ownLayout
onToggled: BarLayout.setOwn(root.editScreen, checked)
}
}
SettingNote {
Layout.leftMargin: 0
text: root.editScreen === "" ? (Object.keys(BarLayout.screens).length ? "Shared layout, used by every screen without its own: " + Quickshell.screens.map(s => s.name).filter(n => !BarLayout.hasOwn(n)).join(", ") : "One layout for every screen. Pick a screen to give it its own modules.") : root.ownLayout ? root.editScreen + " has its own modules; changes here only affect that bar." : root.editScreen + " uses the shared layout. Turn on Separate layout to change its modules on their own."
}
BarEditor {
Layout.fillWidth: true
screenName: root.editScreen
opacity: root.editScreen === "" || root.ownLayout ? 1 : 0.45
enabled: root.editScreen === "" || root.ownLayout
}
Flow {
Layout.fillWidth: true
spacing: 8
visible: addRepeater.count > 0
Repeater {
id: addRepeater
model: root.editScreen === "" || root.ownLayout ? ModuleRegistry.available.filter(id => !root.modules.some(m => m.id === id)) : []
GlassButton {
required property string modelData
text: "+ " + ModuleRegistry.title(modelData)
onClicked: BarLayout.save(root.editScreen, root.modules.concat([
{
id: modelData,
position: modelData === "activeWindow" ? "center" : "right",
enabled: true
}
]))
}
}
}
SettingNote {
Layout.leftMargin: 0
text: "The system button opens Control Center. Metrics pills share the collector configured under System Metrics."
}
}
SettingsSection {
title: "Clock"
PreferenceToggle {
label: "Show date"
icon: "󰃭"
setting: "bar.clock.showDate"
}
PreferenceToggle {
label: "24-hour time"
icon: "󰥔"
setting: "bar.clock.use24Hour"
}
PreferenceToggle {
label: "Show seconds"
icon: "󰔛"
setting: "bar.clock.showSeconds"
}
}
SettingsSection {
title: "Workspaces"
PreferenceChoice {
label: "Workspace style"
description: "Numbers, roman numerals, kanji, dots (filled when occupied) or Pac-Man"
icon: "󰏘"
setting: "bar.workspaces.style"
choices: ["numbers", "roman", "kanji", "dots", "pacman"]
}
PreferenceToggle {
label: "Preview on hover"
description: "Hovering a workspace shows its windows live; click the preview to go there"
icon: "󰕮"
setting: "bar.workspaces.preview"
}
SettingRow {
title: "Preview"
description: "Live workspaces; the outline marks a workspace shown on another monitor"
icon: "󰈈"
// Below the text with the full card width; scaled down when wider (e.g. 20 roman numerals).
below: Item {
id: previewBox
Layout.fillWidth: true
implicitHeight: preview.height * preview.scale
Bar.WorkspacesModule {
id: preview
objectName: "workspacesPreview"
hoverPreview: false
barScreen: ScreenService.active
transformOrigin: Item.TopLeft
scale: Math.min(1, previewBox.width / width)
}
}
}
PreferenceSlider {
label: "Workspace count"
icon: "󰕰"
setting: "bar.workspaces.count"
from: 1
to: 20
step: 1
}
}
SettingsSection {
SettingRow {
title: "Tray"
description: "Tray icons, hover menus and background"
icon: "󰀻"
clickable: true
onClicked: ShellState.openSettings("tray")
Text {
text: "›"
color: Theme.textSecondary
font.pixelSize: 20
}
}
}
}