https://bugs.kde.org/show_bug.cgi?id=454119

            Bug ID: 454119
           Summary: Kirigami Overlay Drawers by default set the
                    interactive policy to false on non mobile, causing
                    escape key to not close the drawer or follow
                    closePolicy
           Product: frameworks-kirigami
           Version: 5.94.0
          Platform: Neon Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: notm...@gmail.com
          Reporter: ai...@outlook.com
  Target Milestone: Not decided

SUMMARY
- Kirigami Overlay Drawers do not close when the escape key is pressed.
explicitly adding the closePolicy does not seem to help either. 
- Escape Key and closePolicy only works when setting the interactive property
explicitly to true in non mobile environment 
- Interactive property of the overlay drawer seems to be set to false by
default on non mobile platforms or touch enabled platforms.

STEPS TO REPRODUCE:
Sample Code:
- The overlay drawer has been given a closePolicy, but does not react to escape
key press unless interactive property is set to true

Kirigami.AbstractApplicationWindow {
    width: 640
    height: 480
    visible: true

    Button {
        anchors.bottom: parent.bottom
        width: parent.width
        height: Kirigami.Units.gridUnit * 2
        text: "Open Drawer"

        onClicked: {
            exampleOverlayDrawer.open()
        }
    }

    Kirigami.OverlayDrawer {
        id: exampleOverlayDrawer
        width: parent.width
        height: parent.height * 0.5
        edge: Qt.TopEdge
        closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
        dim: true
        // if this property is not set to true explicitly on non mobile
platforms closePolicy does not apply and escape key is not caught
        // interactive: true 

        onOpened: {
            sampleButton.forceActiveFocus()
        }

        contentItem: Item {
            Button {
                id: sampleButton
                width: parent.width
                height: Kirigami.Units.gridUnit * 2
                text: "Close Drawer"

                background: Rectangle {
                    color: sampleButton.activeFocus ?
Kirigami.Theme.highlightColor : "white"
                }

                onClicked: {
                    exampleOverlayDrawer.close()
                }
            }
        }
    }
}

SOFTWARE/OS VERSIONS
Distribution: KDE Neon
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Graphics Platform: X11

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to