Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GNOME 43 #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion [email protected]/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "Mpris Indicator Button",
"description": "A full featured MPRIS indicator.",
"original-author": "[email protected]",
"shell-version": ["3.38", "40", "41", "42"],
"shell-version": ["3.38", "40", "41", "42","43"],
"url": "https://github.com/JasonLG1979/gnome-shell-extension-mpris-indicator-button/"
}
31 changes: 30 additions & 1 deletion [email protected]/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// No translatable strings in this file.
const { Atk, Clutter, Gio, GObject, St } = imports.gi;

const { AggregateLayout } = imports.ui.panel;
const { Button } = imports.ui.panelMenu;
const { PopupBaseMenuItem, PopupSubMenuMenuItem, PopupMenuSection, PopupSeparatorMenuItem, Ornament} = imports.ui.popupMenu;
const { Slider } = imports.ui.slider;
Expand Down Expand Up @@ -1632,3 +1631,33 @@ var MprisIndicatorButton = GObject.registerClass({
return Clutter.EVENT_PROPAGATE;
}
});

var AggregateLayout = GObject.registerClass(
class AggregateLayout extends Clutter.BoxLayout {
_init(params = {}) {
params['orientation'] = Clutter.Orientation.VERTICAL;
super._init(params);

this._sizeChildren = [];
}

addSizeChild(actor) {
this._sizeChildren.push(actor);
this.layout_changed();
}

vfunc_get_preferred_width(container, forHeight) {
let themeNode = container.get_theme_node();
let minWidth = themeNode.get_min_width();
let natWidth = minWidth;

for (let i = 0; i < this._sizeChildren.length; i++) {
let child = this._sizeChildren[i];
let [childMin, childNat] = child.get_preferred_width(forHeight);
minWidth = Math.max(minWidth, childMin);
natWidth = Math.max(natWidth, childNat);
}
return [minWidth, natWidth];
}
});