This commit is contained in:
abakkk 2019-03-05 22:00:14 +01:00
parent c59f499b4c
commit 9594ec3c69
3 changed files with 19 additions and 19 deletions

View File

@ -661,14 +661,14 @@ var DrawingHelper = new Lang.Class({
this.vbox.add(new St.Label({ text: _("Internal") })); this.vbox.add(new St.Label({ text: _("Internal") }));
for (let desc in Prefs.OTHER_SHORTCUTS) { for (let i = 0; i < Prefs.OTHER_SHORTCUTS.length; i++) {
if (desc.indexOf('-separator-') != -1) { if (Prefs.OTHER_SHORTCUTS[i].desc.indexOf('-separator-') != -1) {
this.vbox.add(new St.BoxLayout({ vertical: false, style_class: 'draw-on-your-screen-separator' })); this.vbox.add(new St.BoxLayout({ vertical: false, style_class: 'draw-on-your-screen-separator' }));
continue; continue;
} }
let hbox = new St.BoxLayout({ vertical: false }); let hbox = new St.BoxLayout({ vertical: false });
hbox.add(new St.Label({ text: _(desc) })); hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[i].desc) }));
hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[desc]) }), { expand: true }); hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[i].shortcut) }), { expand: true });
this.vbox.add(hbox); this.vbox.add(hbox);
} }

View File

@ -91,8 +91,8 @@ msgstr ""
msgid "Change linecap" msgid "Change linecap"
msgstr "" msgstr ""
msgid "Dashed line" #msgid "Dashed line"
msgstr "" #msgstr ""
msgid "Select line" msgid "Select line"
msgstr "" msgstr ""

View File

@ -69,15 +69,15 @@ var INTERNAL_KEYBINDINGS = {
'toggle-help': "Show help" 'toggle-help': "Show help"
}; };
var OTHER_SHORTCUTS = { var OTHER_SHORTCUTS = [
"Draw": "Left click", { desc: "Draw", shortcut: "Left click" },
"Draw by filling in": "Right click", { desc: "Draw by filling in", shortcut: "Right click" },
"Toggle shape": "Center click", { desc: "Toggle shape", shortcut: "Center click" },
"Increment/decrement line width": "Scroll", { desc: "Increment/decrement line width", shortcut: "Scroll" },
"Select color": "Ctrl+1...9", { desc: "Select color", shortcut: "Ctrl+1...9" },
"Select eraser": "Shift key held", { desc: "Select eraser", shortcut: "Shift key held" },
"Leave and erase all drawings": "Escape key" { desc: "Leave and erase all drawings", shortcut: "Escape key" }
}; ];
function init() { function init() {
Convenience.initTranslations(); Convenience.initTranslations();
@ -133,15 +133,15 @@ const PrefsPage = new GObject.Class({
listBox.add(new Gtk.Box({ margin_top: MARGIN/2, margin_left: MARGIN, margin_right: MARGIN })); listBox.add(new Gtk.Box({ margin_top: MARGIN/2, margin_left: MARGIN, margin_right: MARGIN }));
for (let desc in OTHER_SHORTCUTS) { for (let i = 0; i < OTHER_SHORTCUTS.length; i++) {
if (desc.indexOf('-separator-') != -1) { if (OTHER_SHORTCUTS[i].desc.indexOf('-separator-') != -1) {
listBox.add(new Gtk.Box({ margin_top: MARGIN, margin_left: MARGIN, margin_right: MARGIN })); listBox.add(new Gtk.Box({ margin_top: MARGIN, margin_left: MARGIN, margin_right: MARGIN }));
continue; continue;
} }
let otherBox = new Gtk.Box({ margin_left: MARGIN, margin_right: MARGIN }); let otherBox = new Gtk.Box({ margin_left: MARGIN, margin_right: MARGIN });
let otherLabel = new Gtk.Label({ label: _(desc) }); let otherLabel = new Gtk.Label({ label: _(OTHER_SHORTCUTS[i].desc) });
otherLabel.set_halign(1); otherLabel.set_halign(1);
let otherLabel2 = new Gtk.Label({ label: _(OTHER_SHORTCUTS[desc]) }); let otherLabel2 = new Gtk.Label({ label: _(OTHER_SHORTCUTS[i].shortcut) });
otherBox.pack_start(otherLabel, true, true, 4); otherBox.pack_start(otherLabel, true, true, 4);
otherBox.pack_start(otherLabel2, false, false, 4); otherBox.pack_start(otherLabel2, false, false, 4);
listBox.add(otherBox); listBox.add(otherBox);