js: Cleanup use of StBin

StBins (inc StButton) should have their content managed via :child
rather than add_child()

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
This commit is contained in:
Zander Brown
2023-11-08 10:20:03 +00:00
committed by Marge Bot
parent 49cca32ca5
commit a830edf8cf
7 changed files with 29 additions and 24 deletions

View File

@ -1469,17 +1469,19 @@ class ZoomRegion {
// Private methods //
_createActors() {
// Add a group to clip the contents of the magnified view.
const mainGroup = new Clutter.Actor({clip_to_allocation: true});
// The root actor for the zoom region
this._magView = new St.Bin({style_class: 'magnifier-zoom-region'});
this._magView = new St.Bin({
style_class: 'magnifier-zoom-region',
child: mainGroup,
});
global.stage.add_child(this._magView);
// hide the magnified region from CLUTTER_PICK_ALL
Shell.util_set_hidden_from_pick(this._magView, true);
// Add a group to clip the contents of the magnified view.
let mainGroup = new Clutter.Actor({clip_to_allocation: true});
this._magView.set_child(mainGroup);
// Add a background for when the magnified uiGroup is scrolled
// out of view (don't want to see desktop showing through).
this._background = new Background.SystemBackground();