From 9594ec3c696d4af5604e18956bb4beb806b5edbb Mon Sep 17 00:00:00 2001 From: abakkk Date: Tue, 5 Mar 2019 22:00:14 +0100 Subject: [PATCH] minor --- draw.js | 8 ++++---- locale/draw-on-your-screen.pot | 4 ++-- prefs.js | 26 +++++++++++++------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/draw.js b/draw.js index 7f33741..ef27dc1 100644 --- a/draw.js +++ b/draw.js @@ -661,14 +661,14 @@ var DrawingHelper = new Lang.Class({ this.vbox.add(new St.Label({ text: _("Internal") })); - for (let desc in Prefs.OTHER_SHORTCUTS) { - if (desc.indexOf('-separator-') != -1) { + for (let i = 0; i < Prefs.OTHER_SHORTCUTS.length; i++) { + if (Prefs.OTHER_SHORTCUTS[i].desc.indexOf('-separator-') != -1) { this.vbox.add(new St.BoxLayout({ vertical: false, style_class: 'draw-on-your-screen-separator' })); continue; } let hbox = new St.BoxLayout({ vertical: false }); - hbox.add(new St.Label({ text: _(desc) })); - hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[desc]) }), { expand: true }); + hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[i].desc) })); + hbox.add(new St.Label({ text: _(Prefs.OTHER_SHORTCUTS[i].shortcut) }), { expand: true }); this.vbox.add(hbox); } diff --git a/locale/draw-on-your-screen.pot b/locale/draw-on-your-screen.pot index 1f7af00..1bf09b6 100644 --- a/locale/draw-on-your-screen.pot +++ b/locale/draw-on-your-screen.pot @@ -91,8 +91,8 @@ msgstr "" msgid "Change linecap" msgstr "" -msgid "Dashed line" -msgstr "" +#msgid "Dashed line" +#msgstr "" msgid "Select line" msgstr "" diff --git a/prefs.js b/prefs.js index 21b40ca..e308a0e 100644 --- a/prefs.js +++ b/prefs.js @@ -69,15 +69,15 @@ var INTERNAL_KEYBINDINGS = { 'toggle-help': "Show help" }; -var OTHER_SHORTCUTS = { - "Draw": "Left click", - "Draw by filling in": "Right click", - "Toggle shape": "Center click", - "Increment/decrement line width": "Scroll", - "Select color": "Ctrl+1...9", - "Select eraser": "Shift key held", - "Leave and erase all drawings": "Escape key" -}; +var OTHER_SHORTCUTS = [ + { desc: "Draw", shortcut: "Left click" }, + { desc: "Draw by filling in", shortcut: "Right click" }, + { desc: "Toggle shape", shortcut: "Center click" }, + { desc: "Increment/decrement line width", shortcut: "Scroll" }, + { desc: "Select color", shortcut: "Ctrl+1...9" }, + { desc: "Select eraser", shortcut: "Shift key held" }, + { desc: "Leave and erase all drawings", shortcut: "Escape key" } +]; function init() { 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 })); - for (let desc in OTHER_SHORTCUTS) { - if (desc.indexOf('-separator-') != -1) { + for (let i = 0; i < OTHER_SHORTCUTS.length; i++) { + if (OTHER_SHORTCUTS[i].desc.indexOf('-separator-') != -1) { listBox.add(new Gtk.Box({ margin_top: MARGIN, margin_left: MARGIN, margin_right: MARGIN })); continue; } 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); - 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(otherLabel2, false, false, 4); listBox.add(otherBox);