mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-12 08:42:13 -04:00
popout: anchor height changing popout surfaces to top and bottom
This commit is contained in:
@@ -12,6 +12,7 @@ DankPopout {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
layerNamespace: "dms:control-center"
|
layerNamespace: "dms:control-center"
|
||||||
|
fullHeightSurface: true
|
||||||
|
|
||||||
property string expandedSection: ""
|
property string expandedSection: ""
|
||||||
property var triggerScreen: null
|
property var triggerScreen: null
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ DankPopout {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
layerNamespace: "dms:notification-center-popout"
|
layerNamespace: "dms:notification-center-popout"
|
||||||
|
fullHeightSurface: true
|
||||||
|
|
||||||
property bool notificationHistoryVisible: false
|
property bool notificationHistoryVisible: false
|
||||||
property var triggerScreen: null
|
property var triggerScreen: null
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ Item {
|
|||||||
property var customKeyboardFocus: null
|
property var customKeyboardFocus: null
|
||||||
property bool backgroundInteractive: true
|
property bool backgroundInteractive: true
|
||||||
property bool contentHandlesKeys: false
|
property bool contentHandlesKeys: false
|
||||||
|
property bool fullHeightSurface: false
|
||||||
property bool _resizeActive: false
|
property bool _resizeActive: false
|
||||||
|
property real _surfaceMarginLeft: 0
|
||||||
|
property real _surfaceW: 0
|
||||||
|
|
||||||
property real storedBarThickness: Theme.barHeight - 4
|
property real storedBarThickness: Theme.barHeight - 4
|
||||||
property real storedBarSpacing: 4
|
property real storedBarSpacing: 4
|
||||||
@@ -125,6 +128,10 @@ Item {
|
|||||||
_lastOpenedScreen = screen;
|
_lastOpenedScreen = screen;
|
||||||
|
|
||||||
shouldBeVisible = true;
|
shouldBeVisible = true;
|
||||||
|
if (useBackgroundWindow) {
|
||||||
|
_surfaceMarginLeft = alignedX - shadowBuffer;
|
||||||
|
_surfaceW = alignedWidth + shadowBuffer * 2;
|
||||||
|
}
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (shouldBeVisible && screen) {
|
if (shouldBeVisible && screen) {
|
||||||
if (useBackgroundWindow)
|
if (useBackgroundWindow)
|
||||||
@@ -360,20 +367,38 @@ Item {
|
|||||||
return WlrKeyboardFocus.Exclusive;
|
return WlrKeyboardFocus.Exclusive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property bool _fullHeight: useBackgroundWindow && root.fullHeightSurface
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: true
|
left: true
|
||||||
top: true
|
top: true
|
||||||
right: !useBackgroundWindow
|
right: !useBackgroundWindow
|
||||||
bottom: !useBackgroundWindow
|
bottom: _fullHeight || !useBackgroundWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.margins {
|
WlrLayershell.margins {
|
||||||
left: useBackgroundWindow ? (root.alignedX - shadowBuffer) : 0
|
left: useBackgroundWindow ? root._surfaceMarginLeft : 0
|
||||||
top: useBackgroundWindow ? (root.alignedY - shadowBuffer) : 0
|
top: (useBackgroundWindow && !_fullHeight) ? (root.alignedY - shadowBuffer) : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: useBackgroundWindow ? (root.alignedWidth + (shadowBuffer * 2)) : 0
|
implicitWidth: useBackgroundWindow ? root._surfaceW : 0
|
||||||
implicitHeight: useBackgroundWindow ? (root.alignedHeight + (shadowBuffer * 2)) : 0
|
implicitHeight: (useBackgroundWindow && !_fullHeight) ? (root.alignedHeight + shadowBuffer * 2) : 0
|
||||||
|
|
||||||
|
mask: (useBackgroundWindow && _fullHeight) ? contentInputMask : null
|
||||||
|
|
||||||
|
Region {
|
||||||
|
id: contentInputMask
|
||||||
|
item: contentMaskRect
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: contentMaskRect
|
||||||
|
visible: false
|
||||||
|
x: contentContainer.x - root.shadowBuffer
|
||||||
|
y: contentContainer.y - root.shadowBuffer
|
||||||
|
width: root.alignedWidth + root.shadowBuffer * 2
|
||||||
|
height: root.alignedHeight + root.shadowBuffer * 2
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -393,7 +418,7 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
id: contentContainer
|
id: contentContainer
|
||||||
x: useBackgroundWindow ? shadowBuffer : root.alignedX
|
x: useBackgroundWindow ? shadowBuffer : root.alignedX
|
||||||
y: useBackgroundWindow ? shadowBuffer : root.alignedY
|
y: (useBackgroundWindow && !contentWindow._fullHeight) ? shadowBuffer : root.alignedY
|
||||||
width: root.alignedWidth
|
width: root.alignedWidth
|
||||||
height: root.alignedHeight
|
height: root.alignedHeight
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user