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 2184457
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/helpers/shell/PanelButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,14 @@ 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');
// TODO: another way to get the oldIcon
oldIcon = null;
} 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 +721,14 @@ 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');
// TODO: another way to get the oldIcon
oldIcon = null;
} else {
oldIcon = this.buttonControls.find_child_by_name(options.name);
}
if (oldIcon != null) {
this.buttonControls.replace_child(oldIcon, icon);
} else {
Expand All @@ -726,7 +737,14 @@ 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');
// TODO: another way to get the icon
icon = null;
} else {
icon = this.buttonControls.find_child_by_name(options.name);
}

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

0 comments on commit 2184457

Please sign in to comment.