mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 03:06:36 +02:00
✨ Add audit events for aspect ration change
This commit is contained in:
parent
a40d207dfd
commit
f888a6db4c
1 changed files with 14 additions and 6 deletions
|
@ -11,6 +11,7 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.config :as cfg]
|
[app.config :as cfg]
|
||||||
|
[app.main.data.events :as-alias ev]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.data.workspace.colors :as dc]
|
[app.main.data.workspace.colors :as dc]
|
||||||
[app.main.data.workspace.libraries :as dwl]
|
[app.main.data.workspace.libraries :as dwl]
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
;; --- Refs
|
;; --- Refs
|
||||||
|
@ -103,11 +105,16 @@
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps current-color)
|
(mf/deps current-color)
|
||||||
(fn []
|
(fn []
|
||||||
(let [keep-aspect-ratio? (-> current-color :image :keep-aspect-ratio not)]
|
(let [keep-aspect-ratio? (-> current-color :image :keep-aspect-ratio not)
|
||||||
(st/emit! (dc/update-colorpicker-color
|
image (-> (:image current-color)
|
||||||
{:image (-> (:image current-color)
|
(assoc :keep-aspect-ratio keep-aspect-ratio?))]
|
||||||
(assoc :keep-aspect-ratio keep-aspect-ratio?))}
|
|
||||||
true)))))
|
|
||||||
|
(st/emit!
|
||||||
|
(dc/update-colorpicker-color {:image image} true)
|
||||||
|
(ptk/data-event ::ev/event {::ev/name "toggle-image-aspect-ratio"
|
||||||
|
::ev/origin "workspace:colorpicker"
|
||||||
|
:checked keep-aspect-ratio?})))))
|
||||||
|
|
||||||
on-change-tab
|
on-change-tab
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
@ -279,7 +286,8 @@
|
||||||
[:label {:for "keep-aspect-ratio"
|
[:label {:for "keep-aspect-ratio"
|
||||||
:class (stl/css-case :global/checked keep-aspect-ratio?)}
|
:class (stl/css-case :global/checked keep-aspect-ratio?)}
|
||||||
[:span {:class (stl/css-case :global/checked keep-aspect-ratio?)}
|
[:span {:class (stl/css-case :global/checked keep-aspect-ratio?)}
|
||||||
(when keep-aspect-ratio? i/status-tick-refactor)]
|
(when keep-aspect-ratio?
|
||||||
|
i/status-tick-refactor)]
|
||||||
(tr "media.keep-aspect-ratio")
|
(tr "media.keep-aspect-ratio")
|
||||||
[:input {:type "checkbox"
|
[:input {:type "checkbox"
|
||||||
:id "keep-aspect-ratio"
|
:id "keep-aspect-ratio"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue