[pitivi/1.0] shortcuts: Only show one accelerator for every action
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/1.0] shortcuts: Only show one accelerator for every action
- Date: Sun, 21 Jan 2018 14:41:29 +0000 (UTC)
commit 21677d4a1a0158db5a6337ef433070fa049e9f9a
Author: yatinmaan <yatinmaan1 gmail com>
Date: Sun Jan 21 14:31:32 2018 +0100
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
pitivi/shortcuts.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/shortcuts.py b/pitivi/shortcuts.py
index a5b58c2..1ec1d6b 100644
--- a/pitivi/shortcuts.py
+++ b/pitivi/shortcuts.py
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]