Skip to content

Build your personal knowledge base with Trilium Notes

fix(mobile): fix alignment for horizontal layout

Elian Doran8a61b58970c3
diff --git a/src/public/app/layouts/mobile_layout.js b/src/public/app/layouts/mobile_layout.js
index dfe5a91f5d..a5691ae110 100644
--- a/src/public/app/layouts/mobile_layout.js
+++ b/src/public/app/layouts/mobile_layout.js
@@ -24,6 +24,7 @@ import RootContainer from "../widgets/containers/root_container.js";
import SharedInfoWidget from "../widgets/shared_info.js";
import PromotedAttributesWidget from "../widgets/ribbon_widgets/promoted_attributes.js";
import ClassicEditorToolbar from "../widgets/ribbon_widgets/classic_editor_toolbar.js";
+import options from "../services/options.js";
const MOBILE_CSS = `
<style>
@@ -112,14 +113,16 @@ span.fancytree-expander {
export default class MobileLayout {
getRootWidget(appContext) {
+ const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
+
return new RootContainer()
.setParent(appContext)
.cssBlock(MOBILE_CSS)
- .child(new FlexContainer("column")
+ .child(new FlexContainer(launcherPaneIsHorizontal ? "row" : "column")
.id("launcher-pane")
- .css("width", "53px")
- .child(new GlobalMenuWidget())
- .child(new LauncherContainer())
+ .css(launcherPaneIsHorizontal ? "height" : "width", "53px")
+ .child(new GlobalMenuWidget(launcherPaneIsHorizontal))
+ .child(new LauncherContainer(launcherPaneIsHorizontal))
)
.child(new FlexContainer("row")
.filling()