Add shortcut for closing pages
Needs ReviewPublic

Authored by nicolasfella on Dec 23 2019, 10:50 PM.

Details

Reviewers
mart
ngraham
Group Reviewers
Kirigami
Summary

The lack of standard way to close a page has always bothered me, particularly on the desktop. On mobile this is less of an issue since there is always only one page visible. Discover and Calindori have implemented Esc as shortcut for closing a page already.

Test Plan

Closed some pages in plasma-phonebook by pressing Esc

Diff Detail

Repository
R169 Kirigami
Branch
close
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 20230
Build 20248: arc lint + arc unit
nicolasfella created this revision.Dec 23 2019, 10:50 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptDec 23 2019, 10:50 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nicolasfella requested review of this revision.Dec 23 2019, 10:50 PM
nicolasfella edited the test plan for this revision. (Show Details)Dec 23 2019, 10:50 PM

Hmm, does not work for me with Discover.

apol added a subscriber: apol.Dec 24 2019, 11:48 AM

Shouldn't the application control whether its pages get closed and under which condition it happens?

Maybe, but I think there is some value to having this handled by the toolkit to ensure behavioral consistency across apps.

mart added a comment.Jan 7 2020, 9:12 AM

hmm, not sure about it.
it would probably be ok for most of the cases, but i'm pretty sure it may break some existing app.
an app may want at least two pages always loaded for instance (if uses one for sidebar, one for main content)

In D26200#589355, @mart wrote:

hmm, not sure about it.
it would probably be ok for most of the cases, but i'm pretty sure it may break some existing app.
an app may want at least two pages always loaded for instance (if uses one for sidebar, one for main content)

We could handle that by having the keystroke only get passed to the page with implicit focus, right?