added floating mode

This commit is contained in:
SrGooglo 2022-11-19 04:56:56 +00:00
parent 0ba5383a21
commit a201dcd45a
4 changed files with 17 additions and 1 deletions

View File

@ -227,6 +227,7 @@ export default class Sidebar extends React.Component {
classnames( classnames(
"app_sidebar", "app_sidebar",
{ {
["floating"]: window.app?.settings.get("sidebar.floating"),
["collapsed"]: this.state.visible && this.state.collapsed, ["collapsed"]: this.state.visible && this.state.collapsed,
["elevated"]: this.state.visible && this.state.elevated, ["elevated"]: this.state.visible && this.state.elevated,
["hidden"]: !this.state.visible, ["hidden"]: !this.state.visible,

View File

@ -25,6 +25,10 @@
border-radius: 0 @app_sidebar_borderRadius @app_sidebar_borderRadius 0; border-radius: 0 @app_sidebar_borderRadius @app_sidebar_borderRadius 0;
border: 1px solid var(--sidebar-background-color); border: 1px solid var(--sidebar-background-color);
&.floating {
position: absolute;
}
&.collapsed { &.collapsed {
width: 80px; width: 80px;
min-width: 80px; min-width: 80px;

View File

@ -224,7 +224,12 @@ export default class SidedrawerController extends React.Component {
render() { render() {
return <div return <div
className="sidedrawers-wrapper" className={classnames(
"sidedrawers-wrapper",
{
["floating-sidebar"]: window.app?.settings.get("sidebar.floating")
}
)}
> >
{this.state.drawers} {this.state.drawers}
</div> </div>

View File

@ -3,6 +3,12 @@
.sidedrawers-wrapper { .sidedrawers-wrapper {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
&.floating-sidebar {
z-index: 950;
position: absolute;
margin-left: @app_sidebar_collapsed_width;
}
.sidedrawer { .sidedrawer {
position: relative; position: relative;