Bug 427129

Summary: When using AllActions mode, dynamically show and hide columns as needed
Product: [Frameworks and Libraries] frameworks-kxmlgui Reporter: Nate Graham <nate>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: a.samirh78, bugseforuns, marinescu.gl
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=427072
https://bugs.kde.org/show_bug.cgi?id=474570
Latest Commit: Version Fixed In: 5.95
Sentry Crash Report:

Description Nate Graham 2020-09-29 20:13:08 UTC
KShortcutsEditor can be given an argument to tell it which types of shortcuts to show: local, global, or all (I'm simplifying a bit). The default is all.

Unfortunately "all" is not an ideal default for most apps, because typically apps have tons and tons of local shortcuts but zero global shortcuts. As a result, the shortcuts dialog has two columns for global shortcuts that are totally empty. This wastes space and looks like an error.

However a few apps do set one or two global actions; for example Yakuake has one global action for show/hide and Spectacle sets a number of them. So we can't just change the default setitng to show only local actions, or else, for example, people using Yakuake outside of Plasma will have no GUI to configure the global shortcuts.

I propose that we add a bit of intelligence to the editor: when using the default AllActions mode, it should introspect the models for local and global shortcuts to see what's available. If there are no global shortcuts in the model, it should hide the global shortcuts columns, and if there are no local shortcuts, it should hide the local shortcuts columns.

If the editor is opened with any other mode, this should take priority and only show the shortcuts for that mode, as requested.
Comment 2 Ahmad Samir 2022-06-08 13:14:03 UTC
Git commit 33339de5626242b586db63de88666a31023bcba3 by Ahmad Samir.
Committed on 08/06/2022 at 13:09.
Pushed by ahmadsamir into branch 'master'.

KShortcutsDialog: hide Global columns when there are no Global shortcuts

Most applications don't define Global shortcuts, which meant that the
dialog was showing two empty columns (Global and Global Alternate) most of
the time.
FIXED-IN: 5.95

M  +4    -0    src/kshortcutsdialog.h
M  +5    -0    src/kshortcutsdialog_p.h
M  +24   -13   src/kshortcutseditor.cpp
M  +1    -0    src/kshortcutseditor.h

https://invent.kde.org/frameworks/kxmlgui/commit/33339de5626242b586db63de88666a31023bcba3
Comment 3 Nate Graham 2023-09-30 13:04:34 UTC
*** Bug 238085 has been marked as a duplicate of this bug. ***