half-fix for notif width when sidebar open

This commit is contained in:
2026-04-29 19:14:36 +02:00
parent 2eb0529e98
commit 14ec888269
5 changed files with 43 additions and 97 deletions
+9 -3
View File
@@ -10,6 +10,7 @@ Item {
readonly property int padding: 6
required property Item panels
required property Item sidebarPanel
required property PersistentProperties visibilities
anchors.bottom: parent.bottom
@@ -43,7 +44,7 @@ Item {
return Math.min((QsWindow.window?.screen?.height ?? 0) - 1 * 2, height + padding * 2);
}
implicitWidth: Config.notifs.sizes.width + padding * 2
implicitWidth: Math.max(sidebarPanel.width * (1 - sidebarPanel.offsetScale), Config.notifs.sizes.width + padding * 2)
Behavior on implicitHeight {
Anim {
@@ -72,8 +73,9 @@ Item {
required property NotifServer.Notif modelData
readonly property alias nonAnimHeight: notif.nonAnimHeight
anchors.left: parent.left
anchors.right: parent.right
implicitHeight: notif.implicitHeight + (idx === 0 ? 0 : 8)
implicitWidth: notif.implicitWidth
ListView.onRemove: removeAnim.start()
onIndexChanged: {
@@ -124,16 +126,20 @@ Item {
}
ClippingRectangle {
// implicitWidth: notif.implicitWidth
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: wrapper.idx === 0 ? 0 : 8
color: "transparent"
implicitHeight: notif.implicitHeight
implicitWidth: notif.implicitWidth
radius: Appearance.rounding.smallest / 2
Notification {
id: notif
anchors.left: parent.left
anchors.right: parent.right
modelData: wrapper.modelData
}
}
+1 -1
View File
@@ -20,9 +20,9 @@ CustomRect {
required property NotifServer.Notif modelData
readonly property int nonAnimHeight: summary.implicitHeight + (root.expanded ? appName.height + body.height + actions.height + actions.anchors.topMargin : bodyPreview.height) + inner.anchors.margins * 2
// implicitWidth: Config.notifs.sizes.width
color: root.modelData.urgency === NotificationUrgency.Critical ? DynamicColors.palette.m3secondaryContainer : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: inner.implicitHeight
implicitWidth: Config.notifs.sizes.width
radius: 6
x: Config.notifs.sizes.width
+5 -7
View File
@@ -7,18 +7,17 @@ import QtQuick
Item {
id: root
property real offsetScale: shouldBeActive ? 0 : 1
required property var panels
readonly property Props props: Props {
}
readonly property bool shouldBeActive: root.visibilities.sidebar && Config.sidebar.enabled
required property var visibilities
readonly property bool shouldBeActive: root.visibilities.sidebar && Config.sidebar.enabled
property real offsetScale: shouldBeActive ? 0 : 1
visible: offsetScale < 1
anchors.rightMargin: (-implicitWidth - 5) * offsetScale
implicitWidth: Config.sidebar.sizes.width
opacity: 1 - offsetScale
visible: offsetScale < 1
Behavior on offsetScale {
Anim {
@@ -30,16 +29,15 @@ Item {
Loader {
id: content
active: root.shouldBeActive || root.visible
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: parent.left
anchors.margins: 8
anchors.top: parent.top
active: root.shouldBeActive || root.visible
sourceComponent: Content {
implicitWidth: Config.sidebar.sizes.width - 8 * 2
implicitWidth: Config.sidebar.sizes.width - Appearance.padding.smaller * 2
props: root.props
visibilities: root.visibilities
}
+2 -1
View File
@@ -10,13 +10,14 @@ Item {
required property var visibilities
implicitHeight: content.implicitHeight
implicitWidth: Math.max(sidebarPanel.width, content.implicitWidth)
implicitWidth: Math.max(sidebarPanel.width * (1 - sidebarPanel.offsetScale), content.implicitWidth)
visible: height > 0
Content {
id: content
panels: root.panels
sidebarPanel: root.sidebarPanel
visibilities: root.visibilities
}
}