mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 08:29:42 -05:00
🐛 Add selected colors on rightbar when selecting a board
This commit is contained in:
parent
a1a3d09998
commit
61e83d7e01
2 changed files with 10 additions and 3 deletions
|
@ -44,7 +44,7 @@
|
||||||
shape (gsh/transform-shape shape modifiers)]
|
shape (gsh/transform-shape shape modifiers)]
|
||||||
[:*
|
[:*
|
||||||
(case (:type shape)
|
(case (:type shape)
|
||||||
:frame [:& frame/options {:shape shape}]
|
:frame [:& frame/options {:shape shape :shape-with-children shapes-with-children :file-id file-id :shared-libs shared-libs}]
|
||||||
:group [:& group/options {:shape shape :shape-with-children shapes-with-children :file-id file-id :shared-libs shared-libs}]
|
:group [:& group/options {:shape shape :shape-with-children shapes-with-children :file-id file-id :shared-libs shared-libs}]
|
||||||
:text [:& text/options {:shape shape :file-id file-id :shared-libs shared-libs}]
|
:text [:& text/options {:shape shape :file-id file-id :shared-libs shared-libs}]
|
||||||
:rect [:& rect/options {:shape shape}]
|
:rect [:& rect/options {:shape shape}]
|
||||||
|
|
|
@ -6,9 +6,11 @@
|
||||||
|
|
||||||
(ns app.main.ui.workspace.sidebar.options.shapes.frame
|
(ns app.main.ui.workspace.sidebar.options.shapes.frame
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.data :as d]
|
||||||
[app.common.types.shape.layout :as ctl]
|
[app.common.types.shape.layout :as ctl]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.blur :refer [blur-menu]]
|
[app.main.ui.workspace.sidebar.options.menus.blur :refer [blur-menu]]
|
||||||
|
[app.main.ui.workspace.sidebar.options.menus.color-selection :refer [color-selection-menu]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.constraints :refer [constraint-attrs constraints-menu]]
|
[app.main.ui.workspace.sidebar.options.menus.constraints :refer [constraint-attrs constraints-menu]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.fill :refer [fill-attrs-shape fill-menu]]
|
[app.main.ui.workspace.sidebar.options.menus.fill :refer [fill-attrs-shape fill-menu]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.frame-grid :refer [frame-grid]]
|
[app.main.ui.workspace.sidebar.options.menus.frame-grid :refer [frame-grid]]
|
||||||
|
@ -21,10 +23,10 @@
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc options
|
(mf/defc options
|
||||||
[{:keys [shape] :as props}]
|
[{:keys [shape file-id shape-with-children shared-libs] :as props}]
|
||||||
(let [ids [(:id shape)]
|
(let [ids [(:id shape)]
|
||||||
type (:type shape)
|
type (:type shape)
|
||||||
|
objects (->> shape-with-children (group-by :id) (d/mapm (fn [_ v] (first v))))
|
||||||
stroke-values (select-keys shape stroke-attrs)
|
stroke-values (select-keys shape stroke-attrs)
|
||||||
layer-values (select-keys shape layer-attrs)
|
layer-values (select-keys shape layer-attrs)
|
||||||
measure-values (select-measure-keys shape)
|
measure-values (select-measure-keys shape)
|
||||||
|
@ -63,6 +65,11 @@
|
||||||
[:& stroke-menu {:ids ids
|
[:& stroke-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values stroke-values}]
|
:values stroke-values}]
|
||||||
|
(when (> (count objects) 2)
|
||||||
|
[:& color-selection-menu {:type type
|
||||||
|
:shapes (vals objects)
|
||||||
|
:file-id file-id
|
||||||
|
:shared-libs shared-libs}])
|
||||||
[:& shadow-menu {:ids ids
|
[:& shadow-menu {:ids ids
|
||||||
:values (select-keys shape [:shadow])}]
|
:values (select-keys shape [:shadow])}]
|
||||||
[:& blur-menu {:ids ids
|
[:& blur-menu {:ids ids
|
||||||
|
|
Loading…
Add table
Reference in a new issue