Convert the bar from a vertical left-edge strip to a horizontal top bar. The shell had no orientation abstraction, so this flips the geometry across the bar and the drawer/region/interaction layer: - Bar.qml: ColumnLayout -> RowLayout; hit-testing (checkPopout/handleWheel), scroll halves and popout-center anchoring all keyed off x instead of y; first/last padding -> left/right margins. - BarWrapper.qml: the bar's "thickness" is now its height (clampedHeight/ contentHeight/implicitHeight); content anchors left/right/top. - drawers: Exclusions (exclusive zone moved left->top), Panels (content inset topMargin = bar height), Regions + ContentWindow (panel->window coordinate mapping and the thick border flip left->top), Interactions (bar-region check y<barHeight, panel Y-origin uses bar height, scroll passes x, bar drag-reveal is vertical). - widgets: Clock (Row, HH:MM with a colon), StatusIcons (Row), Workspaces + Workspace (Row), Tray (Row, expand chevron at the right) — each sizes to the bar height instead of width. Verified live in the dev VM: top bar renders with centered-clock entries, the exclusion zone keeps windows below the bar, and the dashboard drops down correctly. Popout fly-outs still anchor sideways (Phase B). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
155 lines
4.2 KiB
QML
155 lines
4.2 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Caelestia.Config
|
|
import qs.components
|
|
import qs.modules.bar as Bar
|
|
import qs.modules.dashboard as Dashboard
|
|
import qs.modules.launcher as Launcher
|
|
import qs.modules.notifications as Notifications
|
|
import qs.modules.osd as Osd
|
|
import qs.modules.session as Session
|
|
import qs.modules.sidebar as Sidebar
|
|
import qs.modules.utilities as Utilities
|
|
import qs.modules.bar.popouts as BarPopouts
|
|
import qs.modules.utilities.toasts as Toasts
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property ShellScreen screen
|
|
required property DrawerVisibilities visibilities
|
|
required property Bar.BarWrapper bar
|
|
required property real borderThickness
|
|
|
|
readonly property alias osd: osd
|
|
readonly property alias osdWrapper: osdWrapper
|
|
readonly property alias notifications: notifications
|
|
readonly property alias session: session
|
|
readonly property alias sessionWrapper: sessionWrapper
|
|
readonly property alias launcher: launcher
|
|
readonly property alias dashboard: dashboard
|
|
readonly property alias popouts: popoutsWrapper.content
|
|
readonly property alias popoutsWrapper: popoutsWrapper
|
|
readonly property alias utilities: utilities
|
|
readonly property alias toasts: toasts
|
|
readonly property alias sidebar: sidebar
|
|
|
|
anchors.fill: parent
|
|
anchors.margins: borderThickness
|
|
anchors.topMargin: bar.implicitHeight
|
|
|
|
Item {
|
|
id: osdWrapper
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: sessionWrapper.anchors.rightMargin + session.width * (1 - session.offsetScale)
|
|
clip: sidebar.visible || session.visible
|
|
|
|
implicitWidth: osd.implicitWidth * (1 - osd.offsetScale)
|
|
implicitHeight: osd.implicitHeight
|
|
|
|
Osd.Wrapper {
|
|
id: osd
|
|
|
|
screen: root.screen
|
|
visibilities: root.visibilities
|
|
sidebarOrSessionVisible: sidebar.visible || session.visible
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.right: parent.right
|
|
}
|
|
}
|
|
|
|
Notifications.Wrapper {
|
|
id: notifications
|
|
|
|
visibilities: root.visibilities
|
|
sidebarPanel: sidebar
|
|
osdPanel: osdWrapper
|
|
sessionPanel: sessionWrapper
|
|
utilitiesPanel: utilities
|
|
|
|
anchors.top: parent.top
|
|
anchors.right: parent.right
|
|
}
|
|
|
|
Item {
|
|
id: sessionWrapper
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.right: parent.right
|
|
anchors.rightMargin: sidebar.width * (1 - sidebar.offsetScale)
|
|
clip: sidebar.visible
|
|
|
|
implicitWidth: session.implicitWidth * (1 - session.offsetScale)
|
|
implicitHeight: session.implicitHeight
|
|
|
|
Session.Wrapper {
|
|
id: session
|
|
|
|
visibilities: root.visibilities
|
|
sidebarVisible: sidebar.visible
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.right: parent.right
|
|
}
|
|
}
|
|
|
|
Launcher.Wrapper {
|
|
id: launcher
|
|
|
|
screen: root.screen
|
|
visibilities: root.visibilities
|
|
panels: root
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.bottom: parent.bottom
|
|
}
|
|
|
|
Dashboard.Wrapper {
|
|
id: dashboard
|
|
|
|
visibilities: root.visibilities
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.top: parent.top
|
|
}
|
|
|
|
BarPopouts.ClipWrapper {
|
|
id: popoutsWrapper
|
|
|
|
screen: root.screen
|
|
borderThickness: root.borderThickness
|
|
}
|
|
|
|
Utilities.Wrapper {
|
|
id: utilities
|
|
|
|
visibilities: root.visibilities
|
|
sidebar: sidebar
|
|
popouts: popoutsWrapper.content
|
|
|
|
anchors.bottom: parent.bottom
|
|
anchors.right: parent.right
|
|
}
|
|
|
|
Toasts.Toasts {
|
|
id: toasts
|
|
|
|
anchors.bottom: sidebar.visible ? parent.bottom : utilities.top
|
|
anchors.right: sidebar.left
|
|
anchors.margins: Tokens.padding.medium
|
|
}
|
|
|
|
Sidebar.Wrapper {
|
|
id: sidebar
|
|
|
|
visibilities: root.visibilities
|
|
|
|
anchors.top: notifications.bottom
|
|
anchors.bottom: utilities.top
|
|
anchors.right: parent.right
|
|
anchors.topMargin: -notifications.anchors.topMargin
|
|
}
|
|
}
|