From 3223a6fdcaea0ce6c818118b3639e0388f67a6ef Mon Sep 17 00:00:00 2001 From: abakkk Date: Wed, 17 Feb 2021 12:00:23 +0100 Subject: [PATCH] return to start a new text line `Shift + Return` was not compatible with the ibusCandidatePopup. So the only way to "validate" a text element is to click outside the text area. Related to #56. --- area.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/area.js b/area.js index d447ae7..b1975e8 100644 --- a/area.js +++ b/area.js @@ -808,7 +808,7 @@ var DrawingArea = new Lang.Class({ this.currentElement.cursorPosition = 0; // Translators: %s is a key label this.emit('show-osd', Files.Icons.TOOL_TEXT, _("Press %s\nto start a new line") - .format(Gtk.accelerator_get_label(Clutter.KEY_Return, 1)), "", -1, true); + .format(Gtk.accelerator_get_label(Clutter.KEY_Return, 0)), "", -1, true); this._updateTextCursorTimeout(); this.textHasCursor = true; this._redisplay(); @@ -835,6 +835,7 @@ var DrawingArea = new Lang.Class({ } this.textEntry.clutterText.set_single_line_mode(false); + this.textEntry.clutterText.set_activatable(false); this.textEntry.clutterText.connect('activate', (clutterText) => { this._stopWriting(); }); @@ -861,11 +862,6 @@ var DrawingArea = new Lang.Class({ this.currentElement.text = ""; this._stopWriting(); return Clutter.EVENT_STOP; - } else if (event.has_shift_modifier() && - (event.get_key_symbol() == Clutter.KEY_Return || - event.get_key_symbol() == Clutter.KEY_KP_Enter)) { - clutterText.insert_unichar('\n'); - return Clutter.EVENT_STOP; } return Clutter.EVENT_PROPAGATE;