mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-16 10:42:06 -04:00
feat:(Notepad): Add blur & update animation track
This commit is contained in:
@@ -52,11 +52,14 @@ PanelWindow {
|
|||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
anchors.right: true
|
anchors.right: true
|
||||||
|
|
||||||
|
// Expandable: fixed max surface width; strip width is slideContainer only (keeps blur/mask aligned).
|
||||||
implicitWidth: expandable ? expandedWidthValue : slideoutWidth
|
implicitWidth: expandable ? expandedWidthValue : slideoutWidth
|
||||||
implicitHeight: modelData ? modelData.height : 800
|
implicitHeight: modelData ? modelData.height : 800
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
readonly property bool slideoutBlurActive: root.visible && BlurService.enabled
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayershell.Top
|
WlrLayershell.layer: WlrLayershell.Top
|
||||||
WlrLayershell.exclusiveZone: 0
|
WlrLayershell.exclusiveZone: 0
|
||||||
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: isVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
@@ -64,12 +67,13 @@ PanelWindow {
|
|||||||
readonly property real dpr: CompositorService.getScreenScale(root.screen)
|
readonly property real dpr: CompositorService.getScreenScale(root.screen)
|
||||||
readonly property real alignedWidth: Theme.px(expandable && expandedWidth ? expandedWidthValue : slideoutWidth, dpr)
|
readonly property real alignedWidth: Theme.px(expandable && expandedWidth ? expandedWidthValue : slideoutWidth, dpr)
|
||||||
readonly property real alignedHeight: Theme.px(modelData ? modelData.height : 800, dpr)
|
readonly property real alignedHeight: Theme.px(modelData ? modelData.height : 800, dpr)
|
||||||
|
readonly property real slideoutSlideSnapX: Theme.snap(slideContainer.slideOffset, dpr)
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: Rectangle {
|
item: Rectangle {
|
||||||
x: root.width - alignedWidth
|
x: root.width - slideContainer.width
|
||||||
y: 0
|
y: 0
|
||||||
width: alignedWidth
|
width: slideContainer.width
|
||||||
height: root.height
|
height: root.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,9 +109,11 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expandable only; mask/blur bind to slideContainer geometry so they track this animation.
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
|
enabled: root.expandable
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 250
|
duration: Theme.popoutAnimationDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,12 +130,14 @@ PanelWindow {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
x: Theme.snap(slideContainer.slideOffset, root.dpr)
|
x: root.slideoutSlideSnapX
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, contentRect.effectiveTransparency)
|
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, contentRect.effectiveTransparency)
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
|
||||||
|
border.width: BlurService.borderWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -206,4 +214,14 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Blur region from slideContainer (not layered contentRect); position uses x + slideoutSlideSnapX, not mapToItem(root).
|
||||||
|
WindowBlur {
|
||||||
|
targetWindow: root
|
||||||
|
blurX: root.slideoutBlurActive ? slideContainer.x + root.slideoutSlideSnapX : 0
|
||||||
|
blurY: root.slideoutBlurActive ? slideContainer.y : 0
|
||||||
|
blurWidth: root.slideoutBlurActive ? slideContainer.width : 0
|
||||||
|
blurHeight: root.slideoutBlurActive ? slideContainer.height : 0
|
||||||
|
blurRadius: Theme.cornerRadius
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user