mirror of
https://github.com/penpot/penpot.git
synced 2025-06-07 08:21:37 +02:00
✨ Allows change colors from root
This commit is contained in:
parent
5f0020a95c
commit
b999c05d1e
3 changed files with 18 additions and 28 deletions
|
@ -112,9 +112,6 @@
|
||||||
(let [pid (:current-page-id state)
|
(let [pid (:current-page-id state)
|
||||||
objects (get-in state [:workspace-data :pages-index pid :objects])
|
objects (get-in state [:workspace-data :pages-index pid :objects])
|
||||||
not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame))
|
not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame))
|
||||||
children (->> ids (filter not-frame) (mapcat #(cp/get-children % objects)))
|
|
||||||
ids (into ids children)
|
|
||||||
|
|
||||||
is-text? #(= :text (:type (get objects %)))
|
is-text? #(= :text (:type (get objects %)))
|
||||||
text-ids (filter is-text? ids)
|
text-ids (filter is-text? ids)
|
||||||
shape-ids (filter (comp not is-text?) ids)
|
shape-ids (filter (comp not is-text?) ids)
|
||||||
|
@ -141,9 +138,6 @@
|
||||||
(let [pid (:current-page-id state)
|
(let [pid (:current-page-id state)
|
||||||
objects (get-in state [:workspace-data :pages-index pid :objects])
|
objects (get-in state [:workspace-data :pages-index pid :objects])
|
||||||
not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame))
|
not-frame (fn [shape-id] (not= (get-in objects [shape-id :type]) :frame))
|
||||||
children (->> ids (filter not-frame) (mapcat #(cp/get-children % objects)))
|
|
||||||
ids (into ids children)
|
|
||||||
|
|
||||||
update-fn (fn [s]
|
update-fn (fn [s]
|
||||||
(cond-> s
|
(cond-> s
|
||||||
true
|
true
|
||||||
|
|
|
@ -226,7 +226,6 @@
|
||||||
objects (dwc/lookup-page-objects state page-id)
|
objects (dwc/lookup-page-objects state page-id)
|
||||||
find-shape
|
find-shape
|
||||||
(fn [selection]
|
(fn [selection]
|
||||||
(when (seq selection)
|
|
||||||
(let [id (first selection)
|
(let [id (first selection)
|
||||||
shape (get objects id)]
|
shape (get objects id)]
|
||||||
(let [child-id (->> (cp/get-children id objects)
|
(let [child-id (->> (cp/get-children id objects)
|
||||||
|
@ -235,11 +234,12 @@
|
||||||
(filter #(geom/has-point? % position))
|
(filter #(geom/has-point? % position))
|
||||||
(first)
|
(first)
|
||||||
:id)]
|
:id)]
|
||||||
(or child-id id)))))]
|
(or child-id id))))]
|
||||||
(->> (uw/ask! {:cmd :selection/query
|
(->> (uw/ask! {:cmd :selection/query
|
||||||
:page-id page-id
|
:page-id page-id
|
||||||
:rect (geom/make-centered-rect position 1 1)})
|
:rect (geom/make-centered-rect position 1 1)})
|
||||||
(rx/first)
|
(rx/first)
|
||||||
|
(rx/filter (comp not empty?))
|
||||||
(rx/map find-shape)
|
(rx/map find-shape)
|
||||||
(rx/filter #(not (nil? %)))
|
(rx/filter #(not (nil? %)))
|
||||||
(rx/map #(select-shape % false))))))))
|
(rx/map #(select-shape % false))))))))
|
||||||
|
|
|
@ -95,22 +95,18 @@
|
||||||
|
|
||||||
(when (contains? svg-elements tag)
|
(when (contains? svg-elements tag)
|
||||||
[:*
|
[:*
|
||||||
(cond
|
(when (= tag :svg)
|
||||||
(= tag :svg)
|
|
||||||
[:*
|
[:*
|
||||||
[:& measures-menu {:ids ids
|
[:& measures-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values measure-values}]]
|
:values measure-values}]])
|
||||||
|
|
||||||
:else
|
|
||||||
[:*
|
|
||||||
[:& fill-menu {:ids ids
|
[:& fill-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values fill-values}]
|
:values fill-values}]
|
||||||
[:& stroke-menu {:ids ids
|
[:& stroke-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values stroke-values}]])
|
:values stroke-values}]
|
||||||
|
|
||||||
[:& shadow-menu {:ids ids
|
[:& shadow-menu {:ids ids
|
||||||
:values (select-keys shape [:shadow])}]
|
:values (select-keys shape [:shadow])}]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue