remind system screenshort shortcuts in helper

This commit is contained in:
abakkk 2019-03-07 19:22:19 +01:00
parent dbdb35a677
commit 0de553c748
2 changed files with 36 additions and 0 deletions

21
draw.js
View File

@ -766,6 +766,13 @@ function getAngle(xO, yO, xA, yA, xB, yB) {
} }
var HELPER_ANIMATION_TIME = 0.25; 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) // DrawingHelper provides the "help osd" (Ctrl + F1)
// It uses the same texts as in prefs // 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 }); hbox.add(new St.Label({ text: Gtk.accelerator_get_label(keyval, mods) }), { expand: true });
this.vbox.add(hbox); 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() { showHelp: function() {

View File

@ -54,6 +54,21 @@ msgid ""
"and press Enter" "and press Enter"
msgstr "" msgstr ""
msgid "Screenshot"
msgstr ""
msgid "Screenshot to clipboard"
msgstr ""
msgid "Area screenshot"
msgstr ""
msgid "Area screenshot to clipboard"
msgstr ""
msgid "System"
msgstr ""
#: prefs.js #: prefs.js
# GLOBAL_KEYBINDINGS # GLOBAL_KEYBINDINGS