From 6fcd14c23ebd4fbad1453ad5d53a994ab9f1bac5 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 8 Feb 2025 11:42:25 +0200 Subject: [PATCH] feat(mobile): add calendar button (fixes #1128) --- src/public/stylesheets/style.css | 3 ++- src/services/hidden_subtree_launcherbar.ts | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index c9ad3c7c9..e85497d81 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -1302,7 +1302,8 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu { background-color: var(--left-pane-background-color); } -body.mobile #launcher-pane .dropdown.global-menu > .dropdown-menu.show { +body.mobile #launcher-pane .dropdown.global-menu > .dropdown-menu.show, +body.mobile #launcher-container .dropdown > .dropdown-menu.show { position: fixed !important; bottom: calc(var(--mobile-bottom-offset) + var(--launcher-pane-size)) !important; top: unset !important; diff --git a/src/services/hidden_subtree_launcherbar.ts b/src/services/hidden_subtree_launcherbar.ts index 15df97fee..01fec5985 100644 --- a/src/services/hidden_subtree_launcherbar.ts +++ b/src/services/hidden_subtree_launcherbar.ts @@ -28,6 +28,12 @@ export default function buildLaunchBarConfig() { builtinWidget: "forwardInHistoryButton", icon: "bx bxs-chevron-right", attributes: [{ type: "label", name: "docName", value: "launchbar_history_navigation" }] + }, + calendar: { + title: t("hidden-subtree.calendar-title"), + type: "launcher", + builtinWidget: "calendar", + icon: "bx bx-calendar" } }; @@ -56,7 +62,7 @@ export default function buildLaunchBarConfig() { attributes: [{ type: "label", name: "desktopOnly" }] }, { id: "_lbNoteMap", title: t("hidden-subtree.note-map-title"), type: "launcher", targetNoteId: "_globalNoteMap", icon: "bx bxs-network-chart" }, - { id: "_lbCalendar", title: t("hidden-subtree.calendar-title"), type: "launcher", builtinWidget: "calendar", icon: "bx bx-calendar" }, + { id: "_lbCalendar", ...sharedLaunchers.calendar }, { id: "_lbRecentChanges", title: t("hidden-subtree.recent-changes-title"), @@ -83,7 +89,8 @@ export default function buildLaunchBarConfig() { const mobileVisibleLaunchers: HiddenSubtreeItem[] = [ { id: "_lbMobileBackInHistory", ...sharedLaunchers.backInHistory }, { id: "_lbMobileForwardInHistory", ...sharedLaunchers.forwardInHistory }, - { id: "_lbMobileJumpTo", title: t("hidden-subtree.jump-to-note-title"), type: "launcher", command: "jumpToNote", icon: "bx bx-plus-circle" } + { id: "_lbMobileJumpTo", title: t("hidden-subtree.jump-to-note-title"), type: "launcher", command: "jumpToNote", icon: "bx bx-plus-circle" }, + { id: "_lbMobileCalendar", ...sharedLaunchers.calendar } ]; return {