fix(mobile): fix alignment for horizontal layout

This commit is contained in:
Elian Doran 2024-11-23 09:29:49 +02:00
parent 23ef2c593e
commit 8a61b58970
No known key found for this signature in database

View File

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