From 23a8023f0bdc4a70f0c22aca70b5b10341849488 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 28 Dec 2024 01:06:02 +0200 Subject: [PATCH] feat(mobile): force horizontal layout on mobile --- src/public/app/layouts/mobile_layout.js | 45 ++++++++----------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/public/app/layouts/mobile_layout.js b/src/public/app/layouts/mobile_layout.js index adb542415..1632e5283 100644 --- a/src/public/app/layouts/mobile_layout.js +++ b/src/public/app/layouts/mobile_layout.js @@ -98,9 +98,9 @@ span.fancytree-expander { border-style: solid; } -.tree-wrapper .collapse-tree-button, -.tree-wrapper .scroll-to-active-note-button, -.tree-wrapper .tree-settings-button { +.tree-wrapper .collapse-tree-button, +.tree-wrapper .scroll-to-active-note-button, +.tree-wrapper .tree-settings-button { position: fixed; margin-right: 16px; display: none; @@ -113,13 +113,18 @@ span.fancytree-expander { export default class MobileLayout { getRootWidget(appContext) { - const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal"); + const launcherPaneIsHorizontal = true; - return new RootContainer(launcherPaneIsHorizontal) + return new RootContainer(true) .setParent(appContext) - .class((launcherPaneIsHorizontal ? "horizontal" : "vertical") + "-layout") + .class("horizontal-layout") .cssBlock(MOBILE_CSS) - .child(this.#buildLauncherPane(launcherPaneIsHorizontal)) + .child(new FlexContainer("row") + .class("horizontal") + .css("height", "53px") + .child(new LauncherContainer(true)) + .child(new GlobalMenuWidget(true)) + .id("launcher-pane")) .child(new FlexContainer("row") .filling() .child(new ScreenContainer("tree", 'column') @@ -139,14 +144,13 @@ export default class MobileLayout { .child(new FlexContainer('row').contentSized() .css('font-size', 'larger') .css('align-items', 'center') - .optChild(!launcherPaneIsHorizontal, new MobileDetailMenuWidget(false).contentSized()) .child(new NoteTitleWidget() .contentSized() .css("position: relative;") .css("top: 5px;") - .optCss(launcherPaneIsHorizontal, "padding-left", "0.5em") + .css("padding-left", "0.5em") ) - .optChild(launcherPaneIsHorizontal, new MobileDetailMenuWidget(true).contentSized()) + .child(new MobileDetailMenuWidget(true).contentSized()) .child(new CloseDetailButtonWidget().contentSized())) .child(new SharedInfoWidget()) .child(new FloatingButtons() @@ -175,25 +179,4 @@ export default class MobileLayout { .child(new ConfirmDialog()) ); } - - #buildLauncherPane(isHorizontal) { - let launcherPane; - - if (isHorizontal) { - launcherPane = new FlexContainer("row") - .class("horizontal") - .css("height", "53px") - .child(new LauncherContainer(true)) - .child(new GlobalMenuWidget(true)); - } else { - launcherPane = new FlexContainer("column") - .class("vertical") - .css("width", "53px") - .child(new GlobalMenuWidget(false)) - .child(new LauncherContainer(false)); - } - - launcherPane.id("launcher-pane"); - return launcherPane; - } }