Commit cf98a2d2 authored by yatinmaan's avatar yatinmaan Committed by Alexandru Băluț

shortcuts: Only show one accelerator for every action

summary_:
Fixes the dialog width issue in T7854

Depends on D1934

Reviewers: thiblahute, aleb

Maniphest Tasks: T7854

Differential Revision: https://phabricator.freedesktop.org/D1935
parent 34be2d3c
......@@ -203,8 +203,13 @@ class ShortcutsWindow(Gtk.ShortcutsWindow):
group = Gtk.ShortcutsGroup(title=self.app.shortcuts.group_titles[group_id])
group.show()
for action, title in self.app.shortcuts.group_actions[group_id]:
accelerators = " ".join(self.app.get_accels_for_action(action))
short = Gtk.ShortcutsShortcut(title=title, accelerator=accelerators)
# Show only the first accelerator which is the main one.
# Don't bother with the others, to keep the dialog pretty.
try:
accelerator = self.app.get_accels_for_action(action)[0]
except IndexError:
accelerator = ""
short = Gtk.ShortcutsShortcut(title=title, accelerator=accelerator)
short.show()
group.add(short)
section.add(group)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment