change middle click

middle click: toggle fill
remove toggleShape method
update prefs and .pot
This commit is contained in:
abakkk 2019-03-28 22:15:31 +01:00
parent d2c285154b
commit ec2408043f
3 changed files with 8 additions and 12 deletions

View File

@ -165,7 +165,7 @@ var DrawingArea = new Lang.Class({
} }
// hide helper // hide helper
if (this.helper.visible && button != 2) { if (this.helper.visible) {
this.helper.hideHelp(); this.helper.hideHelp();
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} }
@ -174,7 +174,7 @@ var DrawingArea = new Lang.Class({
this._startDrawing(x, y, shiftPressed); this._startDrawing(x, y, shiftPressed);
return Clutter.EVENT_STOP; return Clutter.EVENT_STOP;
} else if (button == 2) { } else if (button == 2) {
this.toggleShape(); this.toggleFill();
} else if (button == 3) { } else if (button == 3) {
this._stopDrawing(); this._stopDrawing();
this.menu.open(x, y); this.menu.open(x, y);
@ -437,10 +437,6 @@ var DrawingArea = new Lang.Class({
this.emitter.emit('show-osd', _(ShapeNames[shape]), null); this.emitter.emit('show-osd', _(ShapeNames[shape]), null);
}, },
toggleShape: function() {
this.selectShape((this.currentShape == Object.keys(Shapes).length - 1) ? 0 : this.currentShape + 1);
},
toggleFill: function() { toggleFill: function() {
this.fill = !this.fill; this.fill = !this.fill;
this.emitter.emit('show-osd', this.fill ? _("Fill") : _("Stroke"), null); this.emitter.emit('show-osd', this.fill ? _("Fill") : _("Stroke"), null);

View File

@ -206,13 +206,13 @@ msgstr ""
msgid "Left click" msgid "Left click"
msgstr "" msgstr ""
msgid "Draw by filling in" msgid "Menu"
msgstr "" msgstr ""
msgid "Right click" msgid "Right click"
msgstr "" msgstr ""
msgid "Toggle shape" msgid "Toggle fill/stroke"
msgstr "" msgstr ""
msgid "Center click" msgid "Center click"
@ -299,7 +299,7 @@ msgstr ""
msgid "Smooth stroke during the drawing process" msgid "Smooth stroke during the drawing process"
msgstr "" msgstr ""
msgid "You can smooth the stroke afterward\nSee" msgid "You can also smooth the stroke afterward\nSee"
msgstr "" msgstr ""
msgid "Change the style" msgid "Change the style"

View File

@ -75,8 +75,8 @@ var INTERNAL_KEYBINDINGS = {
var OTHER_SHORTCUTS = [ var OTHER_SHORTCUTS = [
{ desc: "Draw", shortcut: "Left click" }, { desc: "Draw", shortcut: "Left click" },
{ desc: "Draw by filling in", shortcut: "Right click" }, { desc: "Menu", shortcut: "Right click" },
{ desc: "Toggle shape", shortcut: "Center click" }, { desc: "Toggle fill/stroke", shortcut: "Center click" },
{ desc: "Transform shape (when drawing)", shortcut: "Ctrl key" }, { desc: "Transform shape (when drawing)", shortcut: "Ctrl key" },
{ desc: "Increment/decrement line width", shortcut: "Scroll" }, { desc: "Increment/decrement line width", shortcut: "Scroll" },
{ desc: "Select color", shortcut: "Ctrl+1...9" }, { desc: "Select color", shortcut: "Ctrl+1...9" },
@ -287,7 +287,7 @@ var PrefsPage = new GObject.Class({
let smoothBox = new Gtk.Box({ margin: MARGIN }); let smoothBox = new Gtk.Box({ margin: MARGIN });
let smoothLabelBox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL }); let smoothLabelBox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
let smoothLabel1 = new Gtk.Label({label: _("Smooth stroke during the drawing process")}); let smoothLabel1 = new Gtk.Label({label: _("Smooth stroke during the drawing process")});
let smoothLabel2 = new Gtk.Label({ use_markup: true, halign: 1, label: "<small>" + _("You can smooth the stroke afterward\nSee") + " \"" + _("Smooth last brushstroke") + "\"</small>" }); let smoothLabel2 = new Gtk.Label({ use_markup: true, halign: 1, label: "<small>" + _("You can also smooth the stroke afterward\nSee") + " \"" + _("Smooth last brushstroke") + "\"</small>" });
smoothLabel1.set_halign(1); smoothLabel1.set_halign(1);
smoothLabel2.get_style_context().add_class("dim-label"); smoothLabel2.get_style_context().add_class("dim-label");
smoothLabelBox.pack_start(smoothLabel1, true, true, 0); smoothLabelBox.pack_start(smoothLabel1, true, true, 0);