Skip to content

Commit

Permalink
Clutter.Container was removed
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLauinger77 committed Feb 29, 2024
1 parent 6ec2062 commit bea52a2
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/helpers/shell/PanelButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,13 @@ class PanelButton extends PanelMenu.Button {
const tapAction = new Clutter.TapAction();
tapAction.connect("tap", onClick);
icon.add_action(tapAction);

const oldIcon = this.menuControls.find_child_by_name(options.name);
let oldIcon;
if (Clutter.Container === undefined) {
debugLog('No Clutter Container');
oldIcon = this.menuControls.get_child_at_index(options.menuProps.index);
} else {
oldIcon = this.menuControls.find_child_by_name(options.name);
}

if (oldIcon?.get_parent() === this.menuControls) {
this.menuControls.replace_child(oldIcon, icon);
Expand Down Expand Up @@ -715,9 +720,13 @@ class PanelButton extends PanelMenu.Button {
tapAction.connect("tap", onClick);

icon.add_action(tapAction);

const oldIcon = this.buttonControls.find_child_by_name(options.name);

let oldIcon;
if (Clutter.Container === undefined) {
debugLog('No Clutter Container');
oldIcon = this.buttonControls.get_child_at_index(options.panelProps.index);
} else {
oldIcon = this.buttonControls.find_child_by_name(options.name);
}
if (oldIcon != null) {
this.buttonControls.replace_child(oldIcon, icon);
} else {
Expand All @@ -726,7 +735,13 @@ class PanelButton extends PanelMenu.Button {
}

private removeButtonControlIcon(options: ControlIconOptions) {
const icon = this.buttonControls.find_child_by_name(options.name);
let icon;
if (Clutter.Container === undefined) {
debugLog('No Clutter Container');
icon = this.buttonControls.get_child_at_index(options.menuProps.index);
} else {
icon = this.buttonControls.find_child_by_name(options.name);
}

if (icon != null) {
this.buttonControls.remove_child(icon);
Expand Down

0 comments on commit bea52a2

Please sign in to comment.