Fix bg tracking, use slow spatial for detach, default spatial for everything else, adjust deform, move instead of width scale
164 lines
4.5 KiB
QML
164 lines
4.5 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import qs.components
|
|
import qs.config
|
|
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.leftMargin: bar.implicitWidth
|
|
|
|
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
|
|
|
|
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
|
|
|
|
x: content.isDetached ? (root.width - content.nonAnimWidth) / 2 : 0
|
|
y: {
|
|
if (content.isDetached)
|
|
return (root.height - content.nonAnimHeight) / 2;
|
|
|
|
const off = content.currentCenter - root.borderThickness - content.nonAnimHeight / 2;
|
|
const diff = root.height - Math.floor(off + content.nonAnimHeight);
|
|
if (diff < 0)
|
|
return off + diff;
|
|
return Math.max(off, 0);
|
|
}
|
|
}
|
|
|
|
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: Appearance.padding.normal
|
|
}
|
|
|
|
Sidebar.Wrapper {
|
|
id: sidebar
|
|
|
|
visibilities: root.visibilities
|
|
|
|
anchors.top: notifications.bottom
|
|
anchors.bottom: utilities.top
|
|
anchors.right: parent.right
|
|
}
|
|
}
|