Skip to content

Commit 78bb0ab

Browse files
authored
Added zen mode to mobile layout (#6584)
2 parents cbbe845 + 4cd4c2f commit 78bb0ab

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

apps/client/src/layouts/mobile_layout.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import TabRowWidget from "../widgets/tab_row.js";
2626
import RefreshButton from "../widgets/floating_buttons/refresh_button.js";
2727
import MobileEditorToolbar from "../widgets/ribbon_widgets/mobile_editor_toolbar.js";
2828
import { applyModals } from "./layout_commons.js";
29+
import CloseZenButton from "../widgets/close_zen_button.js";
2930

3031
const MOBILE_CSS = `
3132
<style>
@@ -174,7 +175,8 @@ export default class MobileLayout {
174175
.id("mobile-bottom-bar")
175176
.child(new TabRowWidget().css("height", "40px"))
176177
.child(new FlexContainer("row").class("horizontal").css("height", "53px").child(new LauncherContainer(true)).child(new GlobalMenuWidget(true)).id("launcher-pane"))
177-
);
178+
)
179+
.child(new CloseZenButton());
178180
applyModals(rootContainer);
179181
return rootContainer;
180182
}

apps/client/src/stylesheets/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,14 +1886,16 @@ body.zen #launcher-container,
18861886
body.zen #launcher-pane,
18871887
body.zen #left-pane,
18881888
body.zen #right-pane,
1889+
body.zen #mobile-sidebar-wrapper,
18891890
body.zen .tab-row-container,
18901891
body.zen .tab-row-widget,
18911892
body.zen .ribbon-container:not(:has(.classic-toolbar-widget.visible)),
18921893
body.zen .ribbon-container:has(.classic-toolbar-widget.visible) .ribbon-top-row,
18931894
body.zen .ribbon-container .ribbon-body:not(:has(.classic-toolbar-widget.visible)),
18941895
body.zen .note-icon-widget,
18951896
body.zen .title-row .button-widget,
1896-
body.zen .floating-buttons-children > *:not(.bx-edit-alt) {
1897+
body.zen .floating-buttons-children > *:not(.bx-edit-alt),
1898+
body.zen .action-button {
18971899
display: none !important;
18981900
}
18991901

@@ -1935,6 +1937,10 @@ body.zen .note-title-widget input {
19351937
background: transparent !important;
19361938
}
19371939

1940+
body.zen #detail-container {
1941+
width: 100%;
1942+
}
1943+
19381944
/* Content renderer */
19391945

19401946
footer.file-footer,

apps/client/src/widgets/buttons/global_menu.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ export default class GlobalMenuWidget extends BasicWidget {
363363

364364
this.$zoomState = this.$widget.find(".zoom-state");
365365
this.$toggleZenMode = this.$widget.find('[data-trigger-command="toggleZenMode"');
366-
this.$toggleZenMode.toggle(!utils.isMobile());
367366
this.$widget.on("show.bs.dropdown", () => this.#onShown());
368367
if (this.tooltip) {
369368
this.$widget.on("hide.bs.dropdown", () => this.tooltip.enable());

apps/client/src/widgets/close_zen_button.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BasicWidget from "./basic_widget.js";
22
import { t } from "../services/i18n.js";
3+
import utils from "../services/utils.js";
34

45
const TPL = /*html*/`\
56
<div class="close-zen-container">
@@ -28,6 +29,10 @@ const TPL = /*html*/`\
2829
-webkit-app-region: no-drag;
2930
}
3031
32+
body.zen.mobile .close-zen-container {
33+
top: -2px;
34+
}
35+
3136
body.zen.electron:not(.platform-darwin):not(.native-titlebar) .close-zen-container {
3237
left: calc(env(titlebar-area-width) - var(--zen-button-size) - 2px);
3338
right: unset;

0 commit comments

Comments
 (0)