[gnome-shell] screenshot-ui: Add mode argument to open()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] screenshot-ui: Add mode argument to open()
- Date: Sat, 12 Feb 2022 12:23:53 +0000 (UTC)
commit b757f165a315b7efa10834acef92d0d1f9cb33b1
Author: Ivan Molodetskikh <yalterz gmail com>
Date: Thu Feb 3 22:47:07 2022 +0300
screenshot-ui: Add mode argument to open()
In a subsequent commit we will add a function to open the screenshot UI
in the screencast mode. This argument will allow us to do that without
resorting to accessing private fields from the outside.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107>
js/ui/screenshot.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 3740975b1d..eb9d21a5df 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -988,6 +988,11 @@ class UIWindowSelector extends St.Widget {
}
});
+const UIMode = {
+ SCREENSHOT: 0,
+ SCREENCAST: 1,
+};
+
var ScreenshotUI = GObject.registerClass({
Properties: {
'screencast-in-progress': GObject.ParamSpec.boolean(
@@ -1408,13 +1413,15 @@ var ScreenshotUI = GObject.registerClass({
this._screenSelectors[Main.layoutManager.primaryIndex].checked = true;
}
- async open() {
+ async open(mode = UIMode.SCREENSHOT) {
if (this._openingCoroutineInProgress)
return;
if (this._screencastInProgress)
return;
+ this._castButton.checked = mode === UIMode.SCREENCAST;
+
if (!this.visible) {
// Screenshot UI is opening from completely closed state
// (rather than opening back from in process of closing).
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]