diff options
author | Automeris naranja <automerisnaranja@tutanota.com> | 2023-03-06 19:44:43 -0300 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-04-25 10:33:58 +0000 |
commit | 65ec7b3fa894fc7e8412e18f80767b178aa84549 (patch) | |
tree | 2013e416d557295665b0ee1a7bb9dce58e72bcf4 | |
parent | 9168e2fc63f7e0384e6d4d6cf4c568544c3e41a0 (diff) | |
download | gnome-shell-65ec7b3fa894fc7e8412e18f80767b178aa84549.tar.gz |
screenshot: Use independent tooltips for the Screenshot/Screencast buttons
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6189
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2683>
-rw-r--r-- | js/ui/screenshot.js | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index d25744e87..9acc07494 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -1226,6 +1226,12 @@ var ScreenshotUI = GObject.registerClass({ this._onShotButtonToggled.bind(this)); this._shotCastContainer.add_child(this._shotButton); + this.add_child(new Tooltip(this._shotButton, { + text: _('Take Screenshot'), + style_class: 'screenshot-ui-tooltip', + visible: false, + })); + this._castButton = new St.Button({ style_class: 'screenshot-ui-shot-cast-button', icon_name: 'camera-web-symbolic', @@ -1236,23 +1242,14 @@ var ScreenshotUI = GObject.registerClass({ this._onCastButtonToggled.bind(this)); this._shotCastContainer.add_child(this._castButton); - this._shotButton.bind_property('checked', this._castButton, 'checked', - GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.INVERT_BOOLEAN); - - this._shotCastTooltip = new Tooltip(this._shotCastContainer, { - text: _('Screenshot / Screencast'), + this.add_child(new Tooltip(this._castButton, { + text: _('Record Screen'), style_class: 'screenshot-ui-tooltip', visible: false, - }); - const shotCastCallback = () => { - if (this._shotButton.hover || this._castButton.hover) - this._shotCastTooltip.open(); - else - this._shotCastTooltip.close(); - }; - this._shotButton.connect('notify::hover', shotCastCallback); - this._castButton.connect('notify::hover', shotCastCallback); - this.add_child(this._shotCastTooltip); + })); + + this._shotButton.bind_property('checked', this._castButton, 'checked', + GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.INVERT_BOOLEAN); this._captureButton = new St.Button({ style_class: 'screenshot-ui-capture-button' }); this._captureButton.set_child(new St.Widget({ |