feat(layout): create toggle button for sidebar

This commit is contained in:
Elian Doran 2025-01-19 20:25:36 +02:00
parent 1480d79a75
commit bebe66a94c
No known key found for this signature in database
2 changed files with 19 additions and 1 deletions

View File

@ -85,6 +85,7 @@ import ScrollPaddingWidget from "../widgets/scroll_padding.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"; import options from "../services/options.js";
import utils from "../services/utils.js"; import utils from "../services/utils.js";
import RightPaneToggleWidget from "../widgets/buttons/right_pane_toggle.js";
export default class DesktopLayout { export default class DesktopLayout {
constructor(customWidgets) { constructor(customWidgets) {
@ -118,6 +119,7 @@ export default class DesktopLayout {
.child(new FlexContainer("row").id("tab-row-left-spacer")) .child(new FlexContainer("row").id("tab-row-left-spacer"))
.optChild(launcherPaneIsHorizontal, new LeftPaneToggleWidget(true)) .optChild(launcherPaneIsHorizontal, new LeftPaneToggleWidget(true))
.child(new TabRowWidget().class("full-width")) .child(new TabRowWidget().class("full-width"))
.child(new RightPaneToggleWidget())
.optChild(customTitleBarButtons, new TitleBarButtonsWidget()) .optChild(customTitleBarButtons, new TitleBarButtonsWidget())
.css("height", "40px") .css("height", "40px")
.css("background-color", "var(--launcher-pane-background-color)") .css("background-color", "var(--launcher-pane-background-color)")
@ -139,7 +141,11 @@ export default class DesktopLayout {
new FlexContainer("column") new FlexContainer("column")
.id("rest-pane") .id("rest-pane")
.css("flex-grow", "1") .css("flex-grow", "1")
.optChild(!fullWidthTabBar, new FlexContainer("row").child(new TabRowWidget()).optChild(customTitleBarButtons, new TitleBarButtonsWidget()).css("height", "40px")) .optChild(!fullWidthTabBar, new FlexContainer("row")
.child(new TabRowWidget())
.optChild(customTitleBarButtons, new TitleBarButtonsWidget())
.child(new RightPaneToggleWidget())
.css("height", "40px"))
.child( .child(
new FlexContainer("row") new FlexContainer("row")
.filling() .filling()

View File

@ -0,0 +1,12 @@
import CommandButtonWidget from "./command_button.js";
export default class RightPaneToggleWidget extends CommandButtonWidget {
constructor() {
super();
this.class("toggle-button");
this.settings.icon = "bx-dock-right";
}
}