feat: add a way to toggle displaying brackets

It also add a shortcut "ctrl+c ctrl+b".

Feature request: https://discuss.logseq.com/t/dont-show-and-when-not-editing-a-bulletpoint/90/2
This commit is contained in:
Tienson Qin
2020-12-22 12:10:08 +08:00
parent 5e0fbbd825
commit 5b74e78fae
6 changed files with 65 additions and 19 deletions

View File

@@ -5,6 +5,7 @@
[frontend.handler.user :as user-handler]
[frontend.handler.ui :as ui-handler]
[frontend.handler.repo :as repo-handler]
[frontend.handler.config :as config-handler]
[frontend.state :as state]
[frontend.util :as util]
[frontend.config :as config]
@@ -67,6 +68,7 @@
preferred-workflow (keyword (state/sub [:me :preferred_workflow]))
preferred-language (state/sub [:preferred-language])
enable-timetracking? (state/enable-timetracking?)
show-brackets? (state/show-brackets?)
github-token (state/sub [:me :access-token])
cors-proxy (state/sub [:me :cors_proxy])
logged? (state/logged?)
@@ -89,6 +91,15 @@
(fn []
(state/set-theme! switch-theme)))]]]
[:div.sm:grid.sm:grid-cols-3.sm:gap-4.sm:items-start.sm:pt-5.pl-1
[:label.block.text-sm.font-medium.leading-5.opacity-70
{:for "show_brackets"}
(t :settings-page/show-brackets)]
[:div.mt-1.sm:mt-0.sm:col-span-2
[:div.max-w-lg.rounded-md.sm:max-w-xs
(ui/toggle show-brackets?
config-handler/toggle-ui-show-brackets!)]]]
[:div.mb-6.sm:grid.sm:grid-cols-3.sm:gap-4.sm:items-start.sm:pt-5.pl-1
[:label.block.text-sm.font-medium.leading-5.sm:mt-px.sm:pt-2.opacity-70
{:for "preferred_language"}