refactor: more nicely get the data for panelBox in #orderTopBarItems

This commit is contained in:
June 2025-06-12 03:24:18 +02:00
commit 0d51b81041
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -121,18 +121,7 @@ export default class TopBarOrganizerExtension extends Extension {
const validBoxOrder = this._boxOrderManager.getValidBoxOrder(box);
// Get the relevant box of `Main.panel`.
let panelBox;
switch (box) {
case "left":
panelBox = (Main.panel as CustomPanel)._leftBox;
break;
case "center":
panelBox = (Main.panel as CustomPanel)._centerBox;
break;
case "right":
panelBox = (Main.panel as CustomPanel)._rightBox;
break;
}
let panelBox = (Main.panel as CustomPanel)[`_${box}Box`];
/// Go through the items of the validBoxOrder and order the GNOME Shell
/// top bar box accordingly.