mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
✨ Small change to frame labels
This commit is contained in:
parent
4c36d83e38
commit
2a4573842d
6 changed files with 10 additions and 11 deletions
|
@ -74,7 +74,6 @@
|
|||
(def workspace-saved-grids
|
||||
(l/derived :saved-grids workspace-page-options))
|
||||
|
||||
|
||||
(def workspace-objects
|
||||
(l/derived :objects workspace-data))
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
(mf/defc dropdown
|
||||
{::mf/wrap-props false}
|
||||
[props]
|
||||
#_(assert (fn? (gobj/get props "on-close")) "missing `on-close` prop")
|
||||
#_(assert (boolean? (gobj/get props "show")) "missing `show` prop")
|
||||
(assert (fn? (gobj/get props "on-close")) "missing `on-close` prop")
|
||||
(assert (boolean? (gobj/get props "show")) "missing `show` prop")
|
||||
|
||||
(when (gobj/get props "show")
|
||||
(mf/element dropdown' props)))
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
:type type}]
|
||||
[:span.dropdown-button {:on-click open-dropdown} i/arrow-down]
|
||||
|
||||
[:& dropdown {:show (:is-open? @state)
|
||||
[:& dropdown {:show (get @state :is-open? false)
|
||||
:on-close close-dropdown}
|
||||
[:ul.custom-select-dropdown
|
||||
(for [[index item] (map-indexed vector options)]
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
childs (mapv #(get objects %) (:shapes shape))
|
||||
ds-modifier (get-in shape [:modifiers :displacement])
|
||||
|
||||
label-pos (gpt/point x (- y 10))
|
||||
label-pos (gpt/point x (- y (/ 10 zoom)))
|
||||
|
||||
on-double-click
|
||||
(mf/use-callback
|
||||
|
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
on-orientation-clicked
|
||||
(fn [orientation]
|
||||
(let [width (:width shape)
|
||||
height (:height shape)
|
||||
new-width (if (= orientation :horiz) (max width height) (min width height))
|
||||
new-height (if (= orientation :horiz) (min width height) (max width height))]
|
||||
(let [width (:width shape)
|
||||
height (:height shape)
|
||||
new-width (if (= orientation :horiz) (max width height) (min width height))
|
||||
new-height (if (= orientation :horiz) (min width height) (max width height))]
|
||||
(st/emit! (udw/update-rect-dimensions (:id shape) :width new-width)
|
||||
(udw/update-rect-dimensions (:id shape) :height new-height))))
|
||||
|
||||
|
|
|
@ -180,8 +180,8 @@
|
|||
|
||||
(when (#{:row :column} type)
|
||||
[:& input-row {:label (if (= :row type)
|
||||
(t locale "workspace.options.grid.params.width")
|
||||
(t locale "workspace.options.grid.params.height"))
|
||||
(t locale "workspace.options.grid.params.height")
|
||||
(t locale "workspace.options.grid.params.width"))
|
||||
:class "pixels"
|
||||
:value (or (:item-length params) "")
|
||||
:on-change handle-change-item-length}])
|
||||
|
|
Loading…
Add table
Reference in a new issue