diff --git a/frontend/src/app/main/data/viewer/shortcuts.cljs b/frontend/src/app/main/data/viewer/shortcuts.cljs index 86f1ad8800..a87bb291a5 100644 --- a/frontend/src/app/main/data/viewer/shortcuts.cljs +++ b/frontend/src/app/main/data/viewer/shortcuts.cljs @@ -41,7 +41,15 @@ :prev-frame {:tooltip ds/right-arrow :command "right" - :fn (st/emitf dv/select-next-frame)}}) + :fn (st/emitf dv/select-next-frame)} + + :open-handoff {:tooltip "G H" + :command "g h" + :fn #(st/emit! (dv/go-to-section :handoff))} + + :open-comments {:tooltip "G C" + :command "g c" + :fn #(st/emit! (dv/go-to-section :comments))}}) (defn get-tooltip [shortcut] (assert (contains? shortcuts shortcut) (str shortcut)) diff --git a/frontend/src/app/main/data/workspace.cljs b/frontend/src/app/main/data/workspace.cljs index 6b9e081ae5..7073100ea5 100644 --- a/frontend/src/app/main/data/workspace.cljs +++ b/frontend/src/app/main/data/workspace.cljs @@ -1198,6 +1198,14 @@ (gpr/assign-proportions))))] (rx/of (dch/update-shapes [id] assign-proportions)))))) +(defn toggle-proportion-lock +[] +(ptk/reify ::toggle-propotion-lock + ptk/WatchEvent + (watch [_ state _] + (let [selected (wsh/lookup-selected state)] + (rx/of (dch/update-shapes selected #(update % :proportion-lock not))))))) + ;; --- Update Shape Flags (defn update-shape-flags @@ -1217,6 +1225,21 @@ ids (into [id] (cp/get-children id objects))] (rx/of (dch/update-shapes ids update-fn)))))) +(defn toggle-visibility-selected + [] + (ptk/reify ::toggle-visibility-selected + ptk/WatchEvent + (watch [_ state _] + (let [selected (wsh/lookup-selected state)] + (rx/of (dch/update-shapes selected #(update % :hidden not))))))) + +(defn toggle-lock-selected + [] + (ptk/reify ::toggle-lock-selected + ptk/WatchEvent + (watch [_ state _] + (let [selected (wsh/lookup-selected state)] + (rx/of (dch/update-shapes selected #(update % :blocked not))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Navigation @@ -1282,13 +1305,13 @@ (defn go-to-viewer ([] (go-to-viewer {})) - ([{:keys [file-id page-id]}] + ([{:keys [file-id page-id section]}] (ptk/reify ::go-to-viewer ptk/WatchEvent (watch [_ state _] (let [{:keys [current-file-id current-page-id]} state pparams {:file-id (or file-id current-file-id)} - qparams {:page-id (or page-id current-page-id)}] + qparams {:page-id (or page-id current-page-id) :section section}] (rx/of ::dwp/force-persist (rt/nav-new-window* {:rname :viewer :path-params pparams diff --git a/frontend/src/app/main/data/workspace/shortcuts.cljs b/frontend/src/app/main/data/workspace/shortcuts.cljs index d8ea486b09..70d77f3bbc 100644 --- a/frontend/src/app/main/data/workspace/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/shortcuts.cljs @@ -239,6 +239,14 @@ :command "g v" :fn #(st/emit! (dw/go-to-viewer))} + :open-handoff {:tooltip "G H" + :command "g h" + :fn #(st/emit! (dw/go-to-viewer {:section :handoff}))} + + :open-comments {:tooltip "G C" + :command "g c" + :fn #(st/emit! (dw/go-to-viewer {:section :comments}))} + :open-dashboard {:tooltip "G D" :command "g d" :fn #(st/emit! (dw/go-to-dashboard))} @@ -301,13 +309,25 @@ :command "alt+s" :fn #(st/emit! (dw/align-objects :vbottom))} - :h-distribute {:tooltip (ds/meta-shift (ds/alt "H")) - :command (ds/c-mod "shift+alt+h") - :fn #(st/emit! (dw/distribute-objects :horizontal))} + :h-distribute {:tooltip (ds/meta-shift (ds/alt "H")) + :command (ds/c-mod "shift+alt+h") + :fn #(st/emit! (dw/distribute-objects :horizontal))} - :v-distribute {:tooltip (ds/meta-shift (ds/alt "V")) - :command (ds/c-mod "shift+alt+v") - :fn #(st/emit! (dw/distribute-objects :vertical))}}) + :v-distribute {:tooltip (ds/meta-shift (ds/alt "V")) + :command (ds/c-mod "shift+alt+v") + :fn #(st/emit! (dw/distribute-objects :vertical))} + + :toggle-visibility {:tooltip (ds/meta-shift "H") + :command (ds/c-mod "shift+h") + :fn #(st/emit! (dw/toggle-visibility-selected))} + + :toggle-lock {:tooltip (ds/meta-shift "L") + :command (ds/c-mod "shift+l") + :fn #(st/emit! (dw/toggle-lock-selected))} + + :toggle-lock-size {:tooltip (ds/meta (ds/alt "L")) + :command (ds/c-mod "alt+l") + :fn #(st/emit! (dw/toggle-proportion-lock))}}) (defn get-tooltip [shortcut] (assert (contains? shortcuts shortcut) (str shortcut)) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/align.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/align.cljs index 1261aaf6fb..6581b32635 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/align.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/align.cljs @@ -7,8 +7,8 @@ (ns app.main.ui.workspace.sidebar.options.menus.align (:require [app.main.data.workspace :as dw] - [app.main.refs :as refs] [app.main.data.workspace.shortcuts :as sc] + [app.main.refs :as refs] [app.main.store :as st] [app.main.ui.icons :as i] [app.util.i18n :as i18n :refer [tr]]