screenshot-ui: Add the control panel
The (currently empty) panel resides on the primary monitor. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>
This commit is contained in:

committed by
Marge Bot

parent
8ebc478f0f
commit
3b4fe9af31
@ -4,6 +4,7 @@
|
||||
const { Clutter, Gio, GObject, GLib, Meta, Shell, St } = imports.gi;
|
||||
|
||||
const GrabHelper = imports.ui.grabHelper;
|
||||
const Layout = imports.ui.layout;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
|
||||
@ -39,6 +40,19 @@ class ScreenshotUI extends St.Widget {
|
||||
actionMode: Shell.ActionMode.POPUP,
|
||||
});
|
||||
|
||||
this._primaryMonitorBin = new St.Widget({ layout_manager: new Clutter.BinLayout() });
|
||||
this._primaryMonitorBin.add_constraint(
|
||||
new Layout.MonitorConstraint({ 'primary': true }));
|
||||
this.add_child(this._primaryMonitorBin);
|
||||
|
||||
this._panel = new St.BoxLayout({
|
||||
style_class: 'screenshot-ui-panel',
|
||||
y_align: Clutter.ActorAlign.END,
|
||||
y_expand: true,
|
||||
vertical: true,
|
||||
});
|
||||
this._primaryMonitorBin.add_child(this._panel);
|
||||
|
||||
Main.layoutManager.connect('monitors-changed', () => {
|
||||
// Nope, not dealing with monitor changes.
|
||||
this.close(true);
|
||||
|
Reference in New Issue
Block a user