mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 07:09:07 +00:00
Refactor: Reorder enable code and comment it, to make it more clear
This commit is contained in:
parent
d01fb434ee
commit
8586f095fc
@ -18,29 +18,28 @@ class Extension {
|
||||
|
||||
this._boxOrderManager = new BoxOrderManager.BoxOrderManager();
|
||||
|
||||
// Stuff to do on startup(extension enable).
|
||||
/// Stuff to do on startup(extension enable).
|
||||
// Initially handle new top bar items and order top bar boxes.
|
||||
this.#handleNewItemsAndOrderTopBar();
|
||||
|
||||
// Overwrite `Panel._addToPanelBox` method with one handling new items
|
||||
// and also handle AppIndicators getting ready, to handle new items.
|
||||
this.#overwritePanelAddToPanelBox();
|
||||
this._boxOrderManager.connect("appIndicatorReady", () => {
|
||||
this.#handleNewItemsAndOrderTopBar();
|
||||
});
|
||||
|
||||
// Handle changes of configured box orders.
|
||||
this._settingsHandlerIds = [];
|
||||
|
||||
const addConfiguredBoxOrderChangeHandler = (box) => {
|
||||
let handlerId = this.settings.connect(`changed::${box}-box-order`, () => {
|
||||
this.#handleNewItemsAndOrderTopBar();
|
||||
});
|
||||
this._settingsHandlerIds.push(handlerId);
|
||||
};
|
||||
|
||||
addConfiguredBoxOrderChangeHandler("left");
|
||||
addConfiguredBoxOrderChangeHandler("center");
|
||||
addConfiguredBoxOrderChangeHandler("right");
|
||||
|
||||
// Handle AppIndicators getting ready.
|
||||
this._boxOrderManager.connect("appIndicatorReady", () => {
|
||||
this.#handleNewItemsAndOrderTopBar();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
disable() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user