mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat: settings is now json, refactor panels to be able to dismiss by clicking outside
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Settings
|
||||
|
||||
PanelWindow {
|
||||
id: outerPanel
|
||||
property bool showOverlay: true
|
||||
property int topMargin: 36
|
||||
property color overlayColor: showOverlay ? Theme.overlay : "transparent"
|
||||
|
||||
function dismiss() {
|
||||
visible = false;
|
||||
}
|
||||
|
||||
function show() {
|
||||
visible = true;
|
||||
}
|
||||
|
||||
implicitWidth: screen.width
|
||||
implicitHeight: screen.height
|
||||
color: visible ? overlayColor : "transparent"
|
||||
visible: false
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.keyboardFocus: visible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||
screen: (typeof modelData !== 'undefined' ? modelData : null)
|
||||
anchors.top: true
|
||||
anchors.left: true
|
||||
anchors.right: true
|
||||
anchors.bottom: true
|
||||
margins.top: topMargin
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: outerPanel.dismiss()
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 350
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user