From 0de553c748dfff72738af40d13ca2cbc09d1898c Mon Sep 17 00:00:00 2001 From: abakkk Date: Thu, 7 Mar 2019 19:22:19 +0100 Subject: [PATCH] remind system screenshort shortcuts in helper --- draw.js | 21 +++++++++++++++++++++ locale/draw-on-your-screen.pot | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/draw.js b/draw.js index 491467d..fd257c6 100644 --- a/draw.js +++ b/draw.js @@ -766,6 +766,13 @@ function getAngle(xO, yO, xA, yA, xB, yB) { } var HELPER_ANIMATION_TIME = 0.25; +var MEDIA_KEYS_SCHEMA = 'org.gnome.settings-daemon.plugins.media-keys'; +var MEDIA_KEYS_KEYS = { + 'screenshot': "Screenshot", + 'screenshot-clip': "Screenshot to clipboard", + 'area-screenshot': "Area screenshot", + 'area-screenshot-clip': "Area screenshot to clipboard" +}; // DrawingHelper provides the "help osd" (Ctrl + F1) // It uses the same texts as in prefs @@ -821,6 +828,20 @@ var DrawingHelper = new Lang.Class({ hbox.add(new St.Label({ text: Gtk.accelerator_get_label(keyval, mods) }), { expand: true }); this.vbox.add(hbox); } + + let mediaKeysSettings; + try { mediaKeysSettings = Convenience.getSettings(MEDIA_KEYS_SCHEMA); } catch(e) { return; } + this.vbox.add(new St.Label({ text: _("System") })); + + for (let settingKey in MEDIA_KEYS_KEYS) { + if (!mediaKeysSettings.settings_schema.has_key(settingKey)) + return; + let [keyval, mods] = Gtk.accelerator_parse(mediaKeysSettings.get_string(settingKey)); + let hbox = new St.BoxLayout({ vertical: false }); + hbox.add(new St.Label({ text: _(MEDIA_KEYS_KEYS[settingKey]) })); + hbox.add(new St.Label({ text: Gtk.accelerator_get_label(keyval, mods) }), { expand: true }); + this.vbox.add(hbox); + } }, showHelp: function() { diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot index 15b87a1..c262ab2 100644 --- a/locale/draw-on-your-screen.pot +++ b/locale/draw-on-your-screen.pot @@ -54,6 +54,21 @@ msgid "" "and press Enter" msgstr "" +msgid "Screenshot" +msgstr "" + +msgid "Screenshot to clipboard" +msgstr "" + +msgid "Area screenshot" +msgstr "" + +msgid "Area screenshot to clipboard" +msgstr "" + +msgid "System" +msgstr "" + #: prefs.js # GLOBAL_KEYBINDINGS