From 0d51b810415b1183b25bbfa1832a9cea79c64dde Mon Sep 17 00:00:00 2001 From: June Date: Thu, 12 Jun 2025 03:24:18 +0200 Subject: [PATCH] refactor: more nicely get the data for panelBox in #orderTopBarItems --- src/extension.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 4d99243..026de7e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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.