aboutsummaryrefslogtreecommitdiffstats
path: root/mail-overview/MailPanel.qml
blob: 7e81a3349f8ccfeeaa332e43441c044a807e5bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

import Quickshell
import Quickshell.Wayland
import QtQuick

Scope {
    id: root

    // Waybar runs on this screen, so the drawer belongs here too.
    property string monitor: "DP-1"
    property bool open: false

    readonly property var screenObj:
        Quickshell.screens.find(s => s.name === root.monitor) ?? Quickshell.screens[0]

    function show() { root.open = true; }
    function close() { root.open = false; }
    function toggle() { root.open ? close() : show(); }

    // Quickshell exits once no window is visible, and this drawer is closed
    // most of the time. See AGENTS.md.
    PanelWindow {
        visible: true
        implicitWidth: 1
        implicitHeight: 1
        color: "transparent"
        exclusionMode: ExclusionMode.Ignore
        mask: Region {}
        WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
    }
}