0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-13 07:21:40 -05:00

🐛 Disable stroke style for texts

This commit is contained in:
alonso.torres 2022-05-13 16:03:06 +02:00
parent ae84f3cbe8
commit 570f038062
4 changed files with 19 additions and 13 deletions

View file

@ -34,7 +34,7 @@
(mf/defc stroke-menu
{::mf/wrap [#(mf/memo' % (mf/check-props ["ids" "values" "type" "show-caps"]))]}
[{:keys [ids type values show-caps] :as props}]
[{:keys [ids type values show-caps disable-stroke-style] :as props}]
(let [label (case type
:multiple (tr "workspace.options.selection-stroke")
:group (tr "workspace.options.group-stroke")
@ -191,4 +191,5 @@
:on-reorder (handle-reorder index)
:disable-drag disable-drag
:select-all select-all
:on-blur on-blur}])])]]))
:on-blur on-blur
:disable-stroke-style disable-stroke-style}])])]]))

View file

@ -47,7 +47,7 @@
(second))))
(mf/defc stroke-row
[{:keys [index stroke title show-caps on-color-change on-reorder on-color-detach on-remove on-stroke-width-change on-stroke-style-change on-stroke-alignment-change open-caps-select close-caps-select on-stroke-cap-start-change on-stroke-cap-end-change on-stroke-cap-switch disable-drag select-all on-blur]}]
[{:keys [index stroke title show-caps on-color-change on-reorder on-color-detach on-remove on-stroke-width-change on-stroke-style-change on-stroke-alignment-change open-caps-select close-caps-select on-stroke-cap-start-change on-stroke-cap-end-change on-stroke-cap-switch disable-drag select-all on-blur disable-stroke-style]}]
(let [start-caps-state (mf/use-state {:open? false
:top 0
:left 0})
@ -110,14 +110,15 @@
[:option {:value ":inner"} (tr "workspace.options.stroke.inner")]
[:option {:value ":outer"} (tr "workspace.options.stroke.outer")]]
[:select#style.input-select {:value (enum->string (:stroke-style stroke))
:on-change (on-stroke-style-change index)}
(when (= (:stroke-style stroke) :multiple)
[:option {:value ""} "--"])
[:option {:value ":solid"} (tr "workspace.options.stroke.solid")]
[:option {:value ":dotted"} (tr "workspace.options.stroke.dotted")]
[:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
[:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]]]
(when-not disable-stroke-style
[:select#style.input-select {:value (enum->string (:stroke-style stroke))
:on-change (on-stroke-style-change index)}
(when (= (:stroke-style stroke) :multiple)
[:option {:value ""} "--"])
[:option {:value ":solid"} (tr "workspace.options.stroke.solid")]
[:option {:value ":dotted"} (tr "workspace.options.stroke.dotted")]
[:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
[:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]])]
;; Stroke Caps
(when show-caps

View file

@ -240,6 +240,8 @@
type :multiple
all-types (into #{} (map :type shapes))
has-text? (contains? all-types :text)
[measure-ids measure-values] (get-attrs shapes objects :measure)
[layer-ids layer-values
@ -279,7 +281,8 @@
[:& fill-menu {:type type :ids fill-ids :values fill-values}])
(when-not (empty? stroke-ids)
[:& stroke-menu {:type type :ids stroke-ids :show-caps show-caps :values stroke-values}])
[:& stroke-menu {:type type :ids stroke-ids :show-caps show-caps :values stroke-values
:disable-stroke-style has-text?}])
(when-not (empty? shadow-ids)
[:& shadow-menu {:type type :ids shadow-ids :values shadow-values}])

View file

@ -80,7 +80,8 @@
[:& stroke-menu {:ids ids
:type type
:values stroke-values}]
:values stroke-values
:disable-stroke-style true}]
[:& shadow-menu
{:ids ids