[gnome-shell/gbsneto/remove-generic-container: 26/38] layoutManager: Stop using Shell.GenericContainer
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/remove-generic-container: 26/38] layoutManager: Stop using Shell.GenericContainer
- Date: Thu, 13 Sep 2018 20:43:33 +0000 (UTC)
commit 1d986619fa8736082d646af0c1ee3126182d8873
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jul 7 13:12:33 2018 +0200
layoutManager: Stop using Shell.GenericContainer
This one was remarkably easy to port. In order to make it,
replace the Shell.GenericContainer handlers by a constraint
and simply replace it by a St.Widget.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
js/ui/layout.js | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 7a3cb227d..7504fb6ba 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -203,21 +203,12 @@ var LayoutManager = new Lang.Class({
global.stage.no_clear_hint = true;
// Set up stage hierarchy to group all UI actors under one container.
- this.uiGroup = new Shell.GenericContainer({ name: 'uiGroup' });
+ this.uiGroup = new St.Widget({ name: 'uiGroup' });
this.uiGroup.set_flags(Clutter.ActorFlags.NO_LAYOUT);
- this.uiGroup.connect('allocate', (actor, box, flags) => {
- let children = actor.get_children();
- for (let i = 0; i < children.length; i++)
- children[i].allocate_preferred_size(flags);
- });
- this.uiGroup.connect('get-preferred-width', (actor, forHeight, alloc) => {
- let width = global.stage.width;
- [alloc.min_size, alloc.natural_size] = [width, width];
- });
- this.uiGroup.connect('get-preferred-height', (actor, forWidth, alloc) => {
- let height = global.stage.height;
- [alloc.min_size, alloc.natural_size] = [height, height];
- });
+ this.uiGroup.add_constraint(new Clutter.BindConstraint({
+ source: global.stage,
+ coordinate: Clutter.BindCoordinate.ALL,
+ }));
global.stage.remove_actor(global.window_group);
this.uiGroup.add_actor(global.window_group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]