half-fix for notif width when sidebar open
This commit is contained in:
@@ -10,6 +10,7 @@ Item {
|
|||||||
|
|
||||||
readonly property int padding: 6
|
readonly property int padding: 6
|
||||||
required property Item panels
|
required property Item panels
|
||||||
|
required property Item sidebarPanel
|
||||||
required property PersistentProperties visibilities
|
required property PersistentProperties visibilities
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
@@ -43,7 +44,7 @@ Item {
|
|||||||
|
|
||||||
return Math.min((QsWindow.window?.screen?.height ?? 0) - 1 * 2, height + padding * 2);
|
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 {
|
Behavior on implicitHeight {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -72,8 +73,9 @@ Item {
|
|||||||
required property NotifServer.Notif modelData
|
required property NotifServer.Notif modelData
|
||||||
readonly property alias nonAnimHeight: notif.nonAnimHeight
|
readonly property alias nonAnimHeight: notif.nonAnimHeight
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
implicitHeight: notif.implicitHeight + (idx === 0 ? 0 : 8)
|
implicitHeight: notif.implicitHeight + (idx === 0 ? 0 : 8)
|
||||||
implicitWidth: notif.implicitWidth
|
|
||||||
|
|
||||||
ListView.onRemove: removeAnim.start()
|
ListView.onRemove: removeAnim.start()
|
||||||
onIndexChanged: {
|
onIndexChanged: {
|
||||||
@@ -124,16 +126,20 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClippingRectangle {
|
ClippingRectangle {
|
||||||
|
// implicitWidth: notif.implicitWidth
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: wrapper.idx === 0 ? 0 : 8
|
anchors.topMargin: wrapper.idx === 0 ? 0 : 8
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
implicitHeight: notif.implicitHeight
|
implicitHeight: notif.implicitHeight
|
||||||
implicitWidth: notif.implicitWidth
|
|
||||||
radius: Appearance.rounding.smallest / 2
|
radius: Appearance.rounding.smallest / 2
|
||||||
|
|
||||||
Notification {
|
Notification {
|
||||||
id: notif
|
id: notif
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
modelData: wrapper.modelData
|
modelData: wrapper.modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ CustomRect {
|
|||||||
required property NotifServer.Notif modelData
|
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
|
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
|
color: root.modelData.urgency === NotificationUrgency.Critical ? DynamicColors.palette.m3secondaryContainer : DynamicColors.tPalette.m3surfaceContainer
|
||||||
implicitHeight: inner.implicitHeight
|
implicitHeight: inner.implicitHeight
|
||||||
implicitWidth: Config.notifs.sizes.width
|
|
||||||
radius: 6
|
radius: 6
|
||||||
x: Config.notifs.sizes.width
|
x: Config.notifs.sizes.width
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,17 @@ import QtQuick
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property real offsetScale: shouldBeActive ? 0 : 1
|
||||||
required property var panels
|
required property var panels
|
||||||
readonly property Props props: Props {
|
readonly property Props props: Props {
|
||||||
}
|
}
|
||||||
|
readonly property bool shouldBeActive: root.visibilities.sidebar && Config.sidebar.enabled
|
||||||
required property var visibilities
|
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
|
anchors.rightMargin: (-implicitWidth - 5) * offsetScale
|
||||||
implicitWidth: Config.sidebar.sizes.width
|
implicitWidth: Config.sidebar.sizes.width
|
||||||
opacity: 1 - offsetScale
|
opacity: 1 - offsetScale
|
||||||
|
visible: offsetScale < 1
|
||||||
|
|
||||||
Behavior on offsetScale {
|
Behavior on offsetScale {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -30,16 +29,15 @@ Item {
|
|||||||
Loader {
|
Loader {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
|
active: root.shouldBeActive || root.visible
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 0
|
anchors.bottomMargin: 0
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.margins: 8
|
anchors.margins: 8
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
||||||
active: root.shouldBeActive || root.visible
|
|
||||||
|
|
||||||
sourceComponent: Content {
|
sourceComponent: Content {
|
||||||
implicitWidth: Config.sidebar.sizes.width - 8 * 2
|
implicitWidth: Config.sidebar.sizes.width - Appearance.padding.smaller * 2
|
||||||
props: root.props
|
props: root.props
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,13 +10,14 @@ Item {
|
|||||||
required property var visibilities
|
required property var visibilities
|
||||||
|
|
||||||
implicitHeight: content.implicitHeight
|
implicitHeight: content.implicitHeight
|
||||||
implicitWidth: Math.max(sidebarPanel.width, content.implicitWidth)
|
implicitWidth: Math.max(sidebarPanel.width * (1 - sidebarPanel.offsetScale), content.implicitWidth)
|
||||||
visible: height > 0
|
visible: height > 0
|
||||||
|
|
||||||
Content {
|
Content {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
panels: root.panels
|
panels: root.panels
|
||||||
|
sidebarPanel: root.sidebarPanel
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-85
@@ -21,7 +21,7 @@ Item {
|
|||||||
readonly property int workspacesShown: workspaces.length
|
readonly property int workspacesShown: workspaces.length
|
||||||
|
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
implicitHeight: Config.barConfig.height + Math.max(Appearance.padding.smaller, Config.barConfig.border) * 2
|
implicitHeight: Config.barConfig.height + Appearance.padding.smaller * 2
|
||||||
implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2
|
implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2
|
||||||
|
|
||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
@@ -39,36 +39,15 @@ Item {
|
|||||||
implicitHeight: root.implicitHeight - ((Appearance.padding.small - 1) * 2)
|
implicitHeight: root.implicitHeight - ((Appearance.padding.small - 1) * 2)
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
|
|
||||||
CustomRect {
|
|
||||||
id: indicator
|
|
||||||
|
|
||||||
property real indicatorLength: (Math.abs(idxPair.idx1 - idxPair.idx2) + 1) * root.workspaceButtonWidth
|
|
||||||
property real indicatorPosition: Math.min(idxPair.idx1, idxPair.idx2) * root.workspaceButtonWidth + root.activeWorkspaceMargin
|
|
||||||
property real indicatorThickness: root.workspaceButtonWidth
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
color: DynamicColors.palette.m3primary
|
|
||||||
implicitHeight: indicatorThickness
|
|
||||||
implicitWidth: indicatorLength
|
|
||||||
radius: Appearance.rounding.full
|
|
||||||
x: indicatorPosition
|
|
||||||
z: 2
|
|
||||||
|
|
||||||
AnimatedTabIndexPair {
|
|
||||||
id: idxPair
|
|
||||||
|
|
||||||
index: root.workspaces.findIndex(w => w.active)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Grid {
|
Grid {
|
||||||
|
id: grid
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: root.activeWorkspaceMargin
|
anchors.margins: root.activeWorkspaceMargin
|
||||||
columnSpacing: 0
|
columnSpacing: 0
|
||||||
columns: root.workspacesShown
|
columns: root.workspacesShown
|
||||||
rowSpacing: 0
|
rowSpacing: 0
|
||||||
rows: 1
|
rows: 1
|
||||||
z: 3
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: root.workspaces
|
model: root.workspaces
|
||||||
@@ -91,12 +70,11 @@ Item {
|
|||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: button.modelData.active ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSecondaryContainer
|
color: DynamicColors.palette.m3onSecondaryContainer
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: button.modelData.name
|
text: button.modelData.name
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
z: 3
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,72 +85,35 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
CustomRect {
|
||||||
id: activeTextSource
|
id: indicator
|
||||||
|
|
||||||
anchors.fill: parent
|
property real indicatorLength: (Math.abs(idxPair.idx1 - idxPair.idx2) + 1) * root.workspaceButtonWidth
|
||||||
anchors.margins: root.activeWorkspaceMargin
|
property real indicatorPosition: Math.min(idxPair.idx1, idxPair.idx2) * root.workspaceButtonWidth + root.activeWorkspaceMargin
|
||||||
layer.enabled: true
|
property real indicatorThickness: root.workspaceButtonWidth
|
||||||
visible: false
|
|
||||||
z: 4
|
|
||||||
|
|
||||||
Grid {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.fill: parent
|
clip: true
|
||||||
columnSpacing: 0
|
color: DynamicColors.palette.m3primary
|
||||||
columns: root.workspacesShown
|
implicitHeight: indicatorThickness
|
||||||
rowSpacing: 0
|
implicitWidth: indicatorLength
|
||||||
rows: 1
|
radius: Appearance.rounding.full
|
||||||
|
x: indicatorPosition
|
||||||
|
|
||||||
Repeater {
|
AnimatedTabIndexPair {
|
||||||
model: root.workspaces
|
id: idxPair
|
||||||
|
|
||||||
Item {
|
index: root.workspaces.findIndex(w => w.active)
|
||||||
id: activeWorkspace
|
|
||||||
|
|
||||||
required property int index
|
|
||||||
required property HyprlandWorkspace modelData
|
|
||||||
|
|
||||||
implicitHeight: indicator.indicatorThickness
|
|
||||||
implicitWidth: indicator.indicatorThickness
|
|
||||||
width: root.workspaceButtonWidth
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color: DynamicColors.palette.m3onPrimary
|
|
||||||
elide: Text.ElideRight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
text: activeWorkspace.modelData.name
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Coloriser {
|
||||||
id: indicatorMask
|
colorizationColor: DynamicColors.palette.m3onPrimary
|
||||||
|
implicitHeight: grid.height
|
||||||
anchors.fill: bgRect
|
implicitWidth: grid.width
|
||||||
layer.enabled: true
|
source: grid
|
||||||
visible: false
|
sourceColor: DynamicColors.palette.m3onSurface
|
||||||
|
x: -indicator.x + 3
|
||||||
CustomRect {
|
|
||||||
color: "white"
|
|
||||||
height: indicator.height
|
|
||||||
radius: indicator.radius
|
|
||||||
width: indicator.width
|
|
||||||
x: indicator.x
|
|
||||||
y: indicator.y
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiEffect {
|
|
||||||
anchors.fill: activeTextSource
|
|
||||||
maskEnabled: true
|
|
||||||
maskInverted: false
|
|
||||||
maskSource: indicatorMask
|
|
||||||
source: activeTextSource
|
|
||||||
z: 5
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user