Skip to content

Build your personal knowledge base with Trilium Notes

Merge remote-tracking branch 'origin/develop' into feature/improved_promoted_attributes

Elian Doranbb4164f10f8e
diff --cc src/public/app/layouts/desktop_layout.js
index 35087fb310,612f3bfad1..ea6bc3dfc1
--- a/src/public/app/layouts/desktop_layout.js
+++ b/src/public/app/layouts/desktop_layout.js
@@@ -92,112 -93,120 +93,120 @@@ export default class DesktopLayout
getRootWidget(appContext) {
appContext.noteTreeWidget = new NoteTreeWidget();
- return new RootContainer()
+ const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal");
+ const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal);
+
+ return new RootContainer(launcherPaneIsHorizontal)
.setParent(appContext)
- .child(new FlexContainer("column")
- .id("launcher-pane")
- .css("width", "53px")
- .child(new GlobalMenuWidget())
- .child(new LauncherContainer())
- .child(new LeftPaneToggleWidget())
- )
- .child(new LeftPaneContainer()
- .child(new QuickSearchWidget())
- .child(appContext.noteTreeWidget)
- .child(...this.customWidgets.get('left-pane'))
+ .optChild(launcherPaneIsHorizontal, new FlexContainer('row')
+ .child(new TabRowWidget().class("full-width"))
+ .child(new TitleBarButtonsWidget())
+ .css('height', '40px')
+ .css('background-color', 'var(--launcher-pane-background-color)')
+ .setParent(appContext)
)
- .child(new FlexContainer('column')
- .id('rest-pane')
+ .optChild(launcherPaneIsHorizontal, launcherPane)
+ .child(new FlexContainer('row')
.css("flex-grow", "1")
- .child(new FlexContainer('row')
- .child(new TabRowWidget())
- .child(new TitleBarButtonsWidget())
- .css('height', '40px')
+ .optChild(!launcherPaneIsHorizontal, launcherPane)
+ .child(new LeftPaneContainer()
+ .optChild(!launcherPaneIsHorizontal, new QuickSearchWidget())
+ .child(appContext.noteTreeWidget)
+ .child(...this.customWidgets.get('left-pane'))
)
- .child(new FlexContainer('row')
- .filling()
- .collapsible()
- .child(new FlexContainer('column')
+ .child(new FlexContainer('column')
+ .id('rest-pane')
+ .css("flex-grow", "1")
+ .optChild(!launcherPaneIsHorizontal, new FlexContainer('row')
+ .child(new TabRowWidget())
+ .child(new TitleBarButtonsWidget())
+ .css('height', '40px')
+ )
+ .child(new FlexContainer('row')
.filling()
.collapsible()
- .id('center-pane')
- .child(new SplitNoteContainer(() =>
- new NoteWrapperWidget()
- .child(new FlexContainer('row').class('title-row')
- .css("height", "50px")
- .css("min-height", "50px")
- .css('align-items', "center")
- .cssBlock('.title-row > * { margin: 5px; }')
- .child(new NoteIconWidget())
- .child(new NoteTitleWidget())
- .child(new SpacerWidget(0, 1))
- .child(new MovePaneButton(true))
- .child(new MovePaneButton(false))
- .child(new ClosePaneButton())
- .child(new CreatePaneButton())
- )
- .child(
- new RibbonContainer()
- // the order of the widgets matter. Some of these want to "activate" themselves
- // when visible. When this happens to multiple of them, the first one "wins".
- // promoted attributes should always win.
- .ribbon(new ClassicEditorToolbar())
- .ribbon(new ScriptExecutorWidget())
- .ribbon(new SearchDefinitionWidget())
- .ribbon(new EditedNotesWidget())
- .ribbon(new BookPropertiesWidget())
- .ribbon(new NotePropertiesWidget())
- .ribbon(new FilePropertiesWidget())
- .ribbon(new ImagePropertiesWidget())
- .ribbon(new BasicPropertiesWidget())
- .ribbon(new OwnedAttributeListWidget())
- .ribbon(new InheritedAttributesWidget())
- .ribbon(new NotePathsWidget())
- .ribbon(new NoteMapRibbonWidget())
- .ribbon(new SimilarNotesWidget())
- .ribbon(new NoteInfoWidget())
- .button(new RevisionsButton())
- .button(new NoteActionsWidget())
- )
- .child(new SharedInfoWidget())
- .child(new WatchedFileUpdateStatusWidget())
- .child(new FloatingButtons()
- .child(new EditButton())
- .child(new ShowTocWidgetButton())
- .child(new ShowHighlightsListWidgetButton())
- .child(new CodeButtonsWidget())
- .child(new RelationMapButtons())
- .child(new CopyImageReferenceButton())
- .child(new SvgExportButton())
- .child(new BacklinksWidget())
- .child(new HideFloatingButtonsButton())
- )
- .child(new MermaidWidget())
- .child(
- new ScrollingContainer()
- .filling()
- .child(new PromotedAttributesWidget())
- .child(new SqlTableSchemasWidget())
- .child(new NoteDetailWidget())
- .child(new NoteListWidget())
- .child(new SearchResultWidget())
- .child(new SqlResultWidget())
- .child(new ScrollPaddingWidget())
- )
- .child(new ApiLogWidget())
- .child(new FindWidget())
- .child(
- ...this.customWidgets.get('node-detail-pane'), // typo, let's keep it for a while as BC
- ...this.customWidgets.get('note-detail-pane')
- )
+ .child(new FlexContainer('column')
+ .filling()
+ .collapsible()
+ .id('center-pane')
+ .child(new SplitNoteContainer(() =>
+ new NoteWrapperWidget()
+ .child(new FlexContainer('row').class('title-row')
+ .css("height", "50px")
+ .css("min-height", "50px")
+ .css('align-items', "center")
+ .cssBlock('.title-row > * { margin: 5px; }')
+ .child(new NoteIconWidget())
+ .child(new NoteTitleWidget())
+ .child(new SpacerWidget(0, 1))
+ .child(new MovePaneButton(true))
+ .child(new MovePaneButton(false))
+ .child(new ClosePaneButton())
+ .child(new CreatePaneButton())
+ )
+ .child(
+ new RibbonContainer()
+ // the order of the widgets matter. Some of these want to "activate" themselves
+ // when visible. When this happens to multiple of them, the first one "wins".
+ // promoted attributes should always win.
- .ribbon(new ClassicEditorToolbar())
- .ribbon(new PromotedAttributesWidget())
++ .ribbon(new ClassicEditorToolbar())
+ .ribbon(new ScriptExecutorWidget())
+ .ribbon(new SearchDefinitionWidget())
+ .ribbon(new EditedNotesWidget())
+ .ribbon(new BookPropertiesWidget())
+ .ribbon(new NotePropertiesWidget())
+ .ribbon(new FilePropertiesWidget())
+ .ribbon(new ImagePropertiesWidget())
+ .ribbon(new BasicPropertiesWidget())
+ .ribbon(new OwnedAttributeListWidget())
+ .ribbon(new InheritedAttributesWidget())
+ .ribbon(new NotePathsWidget())
+ .ribbon(new NoteMapRibbonWidget())
+ .ribbon(new SimilarNotesWidget())
+ .ribbon(new NoteInfoWidget())
+ .button(new RevisionsButton())
+ .button(new NoteActionsWidget())
+ )
+ .child(new SharedInfoWidget())
+ .child(new WatchedFileUpdateStatusWidget())
+ .child(new FloatingButtons()
+ .child(new EditButton())
+ .child(new ShowTocWidgetButton())
+ .child(new ShowHighlightsListWidgetButton())
+ .child(new CodeButtonsWidget())
+ .child(new RelationMapButtons())
+ .child(new CopyImageReferenceButton())
+ .child(new SvgExportButton())
+ .child(new BacklinksWidget())
+ .child(new HideFloatingButtonsButton())
+ )
+ .child(new MermaidWidget())
+ .child(
+ new ScrollingContainer()
+ .filling()
++ .child(new PromotedAttributesWidget())
+ .child(new SqlTableSchemasWidget())
+ .child(new NoteDetailWidget())
+ .child(new NoteListWidget())
+ .child(new SearchResultWidget())
+ .child(new SqlResultWidget())
+ .child(new ScrollPaddingWidget())
+ )
+ .child(new ApiLogWidget())
+ .child(new FindWidget())
+ .child(
+ ...this.customWidgets.get('node-detail-pane'), // typo, let's keep it for a while as BC
+ ...this.customWidgets.get('note-detail-pane')
+ )
+ )
)
+ .child(...this.customWidgets.get('center-pane'))
+ )
+ .child(new RightPaneContainer()
+ .child(new TocWidget())
+ .child(new HighlightsListWidget())
+ .child(...this.customWidgets.get('right-pane'))
)
- .child(...this.customWidgets.get('center-pane'))
- )
- .child(new RightPaneContainer()
- .child(new TocWidget())
- .child(new HighlightsListWidget())
- .child(...this.customWidgets.get('right-pane'))
)
)
)