Bug 465073 - GlobalDrawer gets hidden by Esc. even when in non-modal Sidebar mode.
Summary: GlobalDrawer gets hidden by Esc. even when in non-modal Sidebar mode.
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.102.0
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-31 07:34 UTC by Will Chen
Modified: 2023-02-01 10:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will Chen 2023-01-31 07:34:34 UTC
SUMMARY

The GlobalDrawer component can be set to always show as a persistent sidebar of icons even when collapsed.

This is officially recommended for some Desktop applications in the HIG:

https://develop.kde.org/hig/components/navigation/globaldrawer/#collapsible

However, with a recent change, even when the GlobalDrawer is configured as such, pressing [Esc.] will still make it disappear completely.

There's a couple problems with this:
- There's no GUI element to completely hide the drawer when it's serving as a sidebar. So this creates a secret state that can be reached only with the keyboard.
- The icon-sidebar view is *already* the "collapsed" state when it's set to be used. A completely hidden state is superfluous.
- Depending on the application, there may not be a way to get the drawer back.


STEPS TO REPRODUCE

1. Open Kirigami Gallery.
2. In the Global Drawer, set the mode to "Collapsible Sidebar Drawer".
3. The drawer should now be a persistent sidebar, similar to the example described in the HIG.

4. Press [Esc].


OBSERVED RESULT

Oh No! The drawer is gone!

I'm pretty sure this is new/a regression. I've been developing an application that relies on the sidebar mode pretty heavily, and I would have noticed if pressing Esc. made my main sidebar disappear every time.


EXPECTED RESULT

The drawer should not disappear when used as a sidebar.


SOFTWARE/OS VERSIONS

KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8


ADDITIONAL INFORMATION

I suspect this may have been introduced in MR #798, as that does touch the shortcuts and back button, and nothing else has for a couple years.

https://invent.kde.org/frameworks/kirigami/-/merge_requests/798

Separate issue:

I'm pretty sure `enabled: !isMenu` is also new, but the code makes it much clearer that that's supposed to happen, so I suppose that was broken before.
Comment 1 Will Chen 2023-01-31 08:05:00 UTC
Okay. Looks like this is just the default behaviour of `Controls.Popup.closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside`, and setting it to `Popup.NoAutoClose` restores the previous behaviour— Which presumably was itself actually broken?

https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#closePolicy-prop

…Idk. I don't see how this would be caused by the import namespace refactor in Kirigami, so maybe I also changed something else in the meantime, but I also have three different builds for different repositories and only one of them changed.

Either way, this ticket can be closed I think. I will leave it open however in case anyone else thinks of any applications that might be affected by the difference.

Also, even currently, the HIG and QT docs both say this: "Pressing the close button **or anywhere outside of it** collapses it". That is still broken.