extensions: Stop using ClutterContainer API
The methods have long been deprecated in favor of the equivalent ClutterActor methods, so use the latter instead. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/288>
This commit is contained in:
committed by
Marge Bot
parent
8b7cfff558
commit
d10b98c4fc
@@ -385,7 +385,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
|
||||
this.add_actor(this._label);
|
||||
this.add_child(this._label);
|
||||
this.name = 'panelApplications';
|
||||
this.label_actor = this._label;
|
||||
|
||||
@@ -578,14 +578,14 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
this.leftBox.add_child(this.categoriesScrollBox);
|
||||
|
||||
this.applicationsBox = new St.BoxLayout({vertical: true});
|
||||
this.applicationsScrollBox.add_actor(this.applicationsBox);
|
||||
this.applicationsScrollBox.set_child(this.applicationsBox);
|
||||
this.categoriesBox = new St.BoxLayout({vertical: true});
|
||||
this.categoriesScrollBox.add_actor(this.categoriesBox);
|
||||
this.categoriesScrollBox.set_child(this.categoriesBox);
|
||||
|
||||
this.mainBox.add(this.leftBox);
|
||||
this.mainBox.add_child(this.leftBox);
|
||||
this.mainBox.add_child(this._createVertSeparator());
|
||||
this.mainBox.add_child(this.applicationsScrollBox);
|
||||
section.actor.add_actor(this.mainBox);
|
||||
section.actor.add_child(this.mainBox);
|
||||
}
|
||||
|
||||
_display() {
|
||||
@@ -598,7 +598,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
this._tree.load_sync();
|
||||
let root = this._tree.get_root_directory();
|
||||
let categoryMenuItem = new CategoryMenuItem(this, null);
|
||||
this.categoriesBox.add_actor(categoryMenuItem);
|
||||
this.categoriesBox.add_child(categoryMenuItem);
|
||||
let iter = root.iter();
|
||||
let nextType;
|
||||
while ((nextType = iter.next()) !== GMenu.TreeItemType.INVALID) {
|
||||
@@ -614,7 +614,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
this._loadCategory(categoryId, dir);
|
||||
if (this.applicationsByCategory[categoryId].length > 0) {
|
||||
categoryMenuItem = new CategoryMenuItem(this, dir);
|
||||
this.categoriesBox.add_actor(categoryMenuItem);
|
||||
this.categoriesBox.add_child(categoryMenuItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -633,7 +633,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
if (c._delegate instanceof PopupMenu.PopupSeparatorMenuItem)
|
||||
c._delegate.destroy();
|
||||
else
|
||||
this.applicationsBox.remove_actor(c);
|
||||
this.applicationsBox.remove_child(c);
|
||||
});
|
||||
|
||||
if (dir)
|
||||
@@ -656,7 +656,7 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
this._applicationsButtons.set(app, item);
|
||||
}
|
||||
if (!item.get_parent())
|
||||
this.applicationsBox.add_actor(item);
|
||||
this.applicationsBox.add_child(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
|
||||
style_class: 'button',
|
||||
});
|
||||
ejectButton.connect('clicked', this._eject.bind(this));
|
||||
this.add(ejectButton);
|
||||
this.add_child(ejectButton);
|
||||
|
||||
this.hide();
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class PlacesMenu extends PanelMenu.Button {
|
||||
y_expand: true,
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
this.add_actor(label);
|
||||
this.add_child(label);
|
||||
|
||||
this.placesManager = new PlacesManager();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class ScreenshotWindowSizerExtension extends Extension {
|
||||
_flashMessage(message) {
|
||||
if (!this._text) {
|
||||
this._text = new St.Label({style_class: 'screenshot-sizer-message'});
|
||||
Main.uiGroup.add_actor(this._text);
|
||||
Main.uiGroup.add_child(this._text);
|
||||
}
|
||||
|
||||
this._text.remove_all_transitions();
|
||||
|
||||
@@ -121,10 +121,10 @@ class WindowTitle extends St.BoxLayout {
|
||||
this._metaWindow = metaWindow;
|
||||
|
||||
this._icon = new St.Bin({style_class: 'window-button-icon'});
|
||||
this.add(this._icon);
|
||||
this.add_child(this._icon);
|
||||
this.label_actor = new St.Label({y_align: Clutter.ActorAlign.CENTER});
|
||||
this.label_actor.clutter_text.single_line_mode = true;
|
||||
this.add(this.label_actor);
|
||||
this.add_child(this.label_actor);
|
||||
|
||||
this._textureCache = St.TextureCache.get_default();
|
||||
this._textureCache.connectObject('icon-theme-changed',
|
||||
@@ -410,7 +410,7 @@ class WindowButton extends BaseButton {
|
||||
this._onMenuStateChanged.bind(this));
|
||||
this._contextMenu.actor.hide();
|
||||
this._contextMenuManager.addMenu(this._contextMenu);
|
||||
Main.uiGroup.add_actor(this._contextMenu.actor);
|
||||
Main.uiGroup.add_child(this._contextMenu.actor);
|
||||
|
||||
global.display.connectObject('notify::focus-window',
|
||||
() => this._updateStyle(), this);
|
||||
@@ -536,25 +536,25 @@ class AppButton extends BaseButton {
|
||||
this._singleWindowTitle = new St.Bin({
|
||||
x_expand: true,
|
||||
});
|
||||
stack.add_actor(this._singleWindowTitle);
|
||||
stack.add_child(this._singleWindowTitle);
|
||||
|
||||
this._multiWindowTitle = new St.BoxLayout({
|
||||
style_class: 'window-button-box',
|
||||
x_expand: true,
|
||||
});
|
||||
stack.add_actor(this._multiWindowTitle);
|
||||
stack.add_child(this._multiWindowTitle);
|
||||
|
||||
this._icon = new St.Bin({
|
||||
style_class: 'window-button-icon',
|
||||
child: app.create_icon_texture(ICON_TEXTURE_SIZE),
|
||||
});
|
||||
this._multiWindowTitle.add(this._icon);
|
||||
this._multiWindowTitle.add_child(this._icon);
|
||||
|
||||
let label = new St.Label({
|
||||
text: app.get_name(),
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
this._multiWindowTitle.add(label);
|
||||
this._multiWindowTitle.add_child(label);
|
||||
this._multiWindowTitle.label_actor = label;
|
||||
|
||||
this._menuManager = new PopupMenu.PopupMenuManager(this);
|
||||
@@ -564,13 +564,13 @@ class AppButton extends BaseButton {
|
||||
this._menu.actor.hide();
|
||||
this._menu.connect('activate', this._onMenuActivate.bind(this));
|
||||
this._menuManager.addMenu(this._menu);
|
||||
Main.uiGroup.add_actor(this._menu.actor);
|
||||
Main.uiGroup.add_child(this._menu.actor);
|
||||
|
||||
this._appContextMenu = new AppContextMenu(this);
|
||||
this._appContextMenu.connect('open-state-changed',
|
||||
this._onMenuStateChanged.bind(this));
|
||||
this._appContextMenu.actor.hide();
|
||||
Main.uiGroup.add_actor(this._appContextMenu.actor);
|
||||
Main.uiGroup.add_child(this._appContextMenu.actor);
|
||||
|
||||
this._textureCache = St.TextureCache.get_default();
|
||||
this._textureCache.connectObject('icon-theme-changed', () => {
|
||||
@@ -635,7 +635,7 @@ class AppButton extends BaseButton {
|
||||
this._windowContextMenu = new WindowContextMenu(this, this.metaWindow);
|
||||
this._windowContextMenu.connect(
|
||||
'open-state-changed', this._onMenuStateChanged.bind(this));
|
||||
Main.uiGroup.add_actor(this._windowContextMenu.actor);
|
||||
Main.uiGroup.add_child(this._windowContextMenu.actor);
|
||||
this._windowContextMenu.actor.hide();
|
||||
this._contextMenuManager.addMenu(this._windowContextMenu);
|
||||
}
|
||||
@@ -680,7 +680,7 @@ class AppButton extends BaseButton {
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
let windowTitle = new WindowTitle(windows[i]);
|
||||
let item = new PopupMenu.PopupBaseMenuItem();
|
||||
item.add_actor(windowTitle);
|
||||
item.add_child(windowTitle);
|
||||
item._window = windows[i];
|
||||
this._menu.addMenuItem(item);
|
||||
}
|
||||
@@ -726,7 +726,7 @@ class WindowList extends St.Widget {
|
||||
this._monitor = monitor;
|
||||
|
||||
let box = new St.BoxLayout({x_expand: true, y_expand: true});
|
||||
this.add_actor(box);
|
||||
this.add_child(box);
|
||||
|
||||
let layout = new Clutter.BoxLayout({homogeneous: true});
|
||||
this._windowList = new St.Widget({
|
||||
@@ -747,7 +747,7 @@ class WindowList extends St.Widget {
|
||||
this._windowList.connect('scroll-event', this._onScrollEvent.bind(this));
|
||||
|
||||
let indicatorsBox = new St.BoxLayout({x_align: Clutter.ActorAlign.END});
|
||||
box.add(indicatorsBox);
|
||||
box.add_child(indicatorsBox);
|
||||
|
||||
this._workspaceIndicator = new WorkspaceIndicator();
|
||||
indicatorsBox.add_child(this._workspaceIndicator.container);
|
||||
|
||||
@@ -264,7 +264,7 @@ export class WorkspaceIndicator extends PanelMenu.Button {
|
||||
x_expand: true,
|
||||
y_expand: true,
|
||||
});
|
||||
this.add_actor(container);
|
||||
this.add_child(container);
|
||||
|
||||
let workspaceManager = global.workspace_manager;
|
||||
|
||||
@@ -277,7 +277,7 @@ export class WorkspaceIndicator extends PanelMenu.Button {
|
||||
y_expand: true,
|
||||
child: this._statusLabel,
|
||||
});
|
||||
container.add_actor(this._statusBin);
|
||||
container.add_child(this._statusBin);
|
||||
|
||||
this._thumbnailsBox = new St.BoxLayout({
|
||||
style_class: 'workspaces-box',
|
||||
@@ -286,7 +286,7 @@ export class WorkspaceIndicator extends PanelMenu.Button {
|
||||
});
|
||||
this._thumbnailsBox.connect('scroll-event',
|
||||
this._onScrollEvent.bind(this));
|
||||
container.add_actor(this._thumbnailsBox);
|
||||
container.add_child(this._thumbnailsBox);
|
||||
|
||||
this._workspacesItems = [];
|
||||
|
||||
@@ -400,7 +400,7 @@ export class WorkspaceIndicator extends PanelMenu.Button {
|
||||
|
||||
for (let i = 0; i < workspaceManager.n_workspaces; i++) {
|
||||
let thumb = new WorkspaceThumbnail(i);
|
||||
this._thumbnailsBox.add_actor(thumb);
|
||||
this._thumbnailsBox.add_child(thumb);
|
||||
}
|
||||
this._updateActiveThumbnail();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ export default class Extension {
|
||||
style_class: 'extension-windowsNavigator-window-tooltip',
|
||||
visible: false,
|
||||
});
|
||||
this.add_actor(this._tip);
|
||||
this.add_child(this._tip);
|
||||
|
||||
this.connect('notify::scale-x', () => {
|
||||
this._tip.set_scale(1 / this.scale_x, 1 / this.scale_x);
|
||||
|
||||
@@ -266,7 +266,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
|
||||
x_expand: true,
|
||||
y_expand: true,
|
||||
});
|
||||
this.add_actor(container);
|
||||
this.add_child(container);
|
||||
|
||||
let workspaceManager = global.workspace_manager;
|
||||
|
||||
@@ -277,7 +277,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
|
||||
text: this._labelText(),
|
||||
});
|
||||
|
||||
container.add_actor(this._statusLabel);
|
||||
container.add_child(this._statusLabel);
|
||||
|
||||
this._thumbnailsBox = new St.BoxLayout({
|
||||
style_class: 'panel-workspace-indicator-box',
|
||||
@@ -285,7 +285,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
|
||||
reactive: true,
|
||||
});
|
||||
|
||||
container.add_actor(this._thumbnailsBox);
|
||||
container.add_child(this._thumbnailsBox);
|
||||
|
||||
this._workspacesItems = [];
|
||||
this._workspaceSection = new PopupMenu.PopupMenuSection();
|
||||
@@ -408,7 +408,7 @@ class WorkspaceIndicator extends PanelMenu.Button {
|
||||
|
||||
for (let i = 0; i < workspaceManager.n_workspaces; i++) {
|
||||
let thumb = new WorkspaceThumbnail(i);
|
||||
this._thumbnailsBox.add_actor(thumb);
|
||||
this._thumbnailsBox.add_child(thumb);
|
||||
}
|
||||
this._updateActiveThumbnail();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user