"Modeless/modal" -> "Grab/ungrab keyboard and pointer"

And add an OSD notification.
This commit is contained in:
abakkk 2020-06-29 12:21:21 +02:00
parent 0d42d69f91
commit e50a8c80a7
4 changed files with 16 additions and 4 deletions

View File

@ -35,5 +35,5 @@ Then save your beautiful work by taking a screenshot.
* Screenshot Tool extension: * Screenshot Tool extension:
[Screenshot Tool](https://extensions.gnome.org/extension/1112/screenshot-tool/) is a convenient extension to “create, copy, store and upload screenshots”. To use it while drawing mode is active, toggle the area selection mode thanks to the Screenshot Tool shortcut (`Super + F11` by default, see its preferences) and **hold** the `space` key when selecting the area with pointer to avoid drawing. [Screenshot Tool](https://extensions.gnome.org/extension/1112/screenshot-tool/) is a convenient extension to “create, copy, store and upload screenshots”. In order to select a screenshoot area with your pointer while keeping the drawing in place, you need first to tell DrawOnYourScreen to ungrab the pointer (`Ctrl + Super + Alt + D`).

View File

@ -351,7 +351,7 @@ var AreaManager = new Lang.Class({
} }
}, },
toggleModal: function() { toggleModal: function(source) {
if (!this.activeArea) if (!this.activeArea)
return; return;
@ -359,6 +359,8 @@ var AreaManager = new Lang.Class({
if (Main._findModal(this.activeArea) != -1) { if (Main._findModal(this.activeArea) != -1) {
Main.popModal(this.activeArea); Main.popModal(this.activeArea);
if (source && source == global.display)
this.showOsd(null, 'touchpad-disabled-symbolic', _("Keyboard and pointer released"), null, null, false);
setCursor('DEFAULT'); setCursor('DEFAULT');
this.activeArea.reactive = false; this.activeArea.reactive = false;
this.removeInternalKeybindings(); this.removeInternalKeybindings();
@ -370,6 +372,8 @@ var AreaManager = new Lang.Class({
this.addInternalKeybindings(); this.addInternalKeybindings();
this.activeArea.reactive = true; this.activeArea.reactive = true;
this.activeArea.initPointerCursor(); this.activeArea.initPointerCursor();
if (source && source == global.display)
this.showOsd(null, 'input-touchpad-symbolic', _("Keyboard and pointer grabbed"), null, null, false);
} }
return true; return true;

View File

@ -56,7 +56,8 @@ msgstr ""
msgid "Enter/leave drawing mode" msgid "Enter/leave drawing mode"
msgstr "" msgstr ""
msgid "Toggle modeless/modal" # There is a similar text in GNOME Boxes (https://gitlab.gnome.org/GNOME/gnome-boxes/tree/master/po)
msgid "Grab/ungrab keyboard and pointer"
msgstr "" msgstr ""
msgid "Erase all drawings" msgid "Erase all drawings"
@ -451,6 +452,13 @@ msgstr ""
msgid "Entering drawing mode" msgid "Entering drawing mode"
msgstr "" msgstr ""
# "released" as the opposite of "grabbed"
msgid "Keyboard and pointer released"
msgstr ""
msgid "Keyboard and pointer grabbed"
msgstr ""
# %s is a key label # %s is a key label
msgid "" msgid ""
"Press <i>%s</i> to get\n" "Press <i>%s</i> to get\n"

View File

@ -37,7 +37,7 @@ const MARGIN = 10;
var GLOBAL_KEYBINDINGS = { var GLOBAL_KEYBINDINGS = {
'toggle-drawing': "Enter/leave drawing mode", 'toggle-drawing': "Enter/leave drawing mode",
'toggle-modal': "Toggle modeless/modal", 'toggle-modal': "Grab/ungrab keyboard and pointer",
'erase-drawing': "Erase all drawings" 'erase-drawing': "Erase all drawings"
}; };