mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
Allow type overriding via prop
This commit is contained in:
parent
62f7f8a74f
commit
aa75f30858
1 changed files with 7 additions and 4 deletions
|
@ -436,10 +436,12 @@
|
||||||
:sizing sizing-attribute-actions
|
:sizing sizing-attribute-actions
|
||||||
:rotation (partial generic-attribute-actions #{:rotation} "Rotation")
|
:rotation (partial generic-attribute-actions #{:rotation} "Rotation")
|
||||||
:opacity (partial generic-attribute-actions #{:opacity} "Opacity")
|
:opacity (partial generic-attribute-actions #{:opacity} "Opacity")
|
||||||
:stroke-width (partial generic-attribute-actions #{:stroke-width} "Stroke Width")})
|
:stroke-width (partial generic-attribute-actions #{:stroke-width} "Stroke Width")
|
||||||
|
:dimensions (fn [_]
|
||||||
|
[{:title "Spacing" :submenu :spacing}])})
|
||||||
|
|
||||||
(defn shape-attribute-actions [{:keys [token] :as context-data}]
|
(defn shape-attribute-actions [{:keys [type token] :as context-data}]
|
||||||
(when-let [with-actions (get shape-attribute-actions-map (:type token))]
|
(when-let [with-actions (get shape-attribute-actions-map (or type (:type token)))]
|
||||||
(with-actions context-data)))
|
(with-actions context-data)))
|
||||||
|
|
||||||
(defn shape-attribute-actions* [{:keys [token selected-shapes] :as context-data}]
|
(defn shape-attribute-actions* [{:keys [token selected-shapes] :as context-data}]
|
||||||
|
@ -513,7 +515,8 @@
|
||||||
:hidden-icon (not selected?))}])
|
:hidden-icon (not selected?))}])
|
||||||
:selected? selected?))
|
:selected? selected?))
|
||||||
(when submenu
|
(when submenu
|
||||||
(let [submenu-entries (shape-attribute-actions (assoc context-data :token-type submenu))]
|
(let [submenu-entries (-> (assoc context-data :type submenu)
|
||||||
|
(generate-menu-entries))]
|
||||||
(for [[index {:keys [title action selected?] :as sub-entry}] (d/enumerate submenu-entries)]
|
(for [[index {:keys [title action selected?] :as sub-entry}] (d/enumerate submenu-entries)]
|
||||||
(cond
|
(cond
|
||||||
(= :separator sub-entry) [:& menu-separator]
|
(= :separator sub-entry) [:& menu-separator]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue