From c9f2a2bd6bff9dcdbe938024ccb5d8b04152cc01 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 22 Nov 2024 21:10:49 +0200 Subject: [PATCH] feat(client): reorder buttons on horizontal bar --- src/public/app/layouts/desktop_layout.js | 28 +++++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 68f365172..c394fa4e0 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -93,12 +93,7 @@ export default class DesktopLayout { appContext.noteTreeWidget = new NoteTreeWidget(); const launcherPaneIsHorizontal = true; - const launcherPane = new FlexContainer(launcherPaneIsHorizontal ? "row" : "column") - .id("launcher-pane") - .css(launcherPaneIsHorizontal ? "height" : "width", "53px") - .child(new GlobalMenuWidget()) - .child(new LauncherContainer(launcherPaneIsHorizontal)) - .child(new LeftPaneToggleWidget()); + const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal); return new RootContainer() .setParent(appContext) @@ -231,4 +226,25 @@ export default class DesktopLayout { .child(new ConfirmDialog()) .child(new PromptDialog()); } + + #buildLauncherPane(isHorizontal) { + let launcherPane; + + if (isHorizontal) { + launcherPane = new FlexContainer("row") + .css("height", "53px") + .child(new LeftPaneToggleWidget()) + .child(new LauncherContainer(isHorizontal)) + .child(new GlobalMenuWidget()) + } else { + launcherPane = new FlexContainer("column") + .css("width", "53px") + .child(new GlobalMenuWidget()) + .child(new LauncherContainer(isHorizontal)) + .child(new LeftPaneToggleWidget()); + } + + launcherPane.id("launcher-pane"); + return launcherPane; + } }