mirror of
https://github.com/penpot/penpot.git
synced 2025-07-11 00:17:20 +02:00
🐛 Disable stroke style for texts
This commit is contained in:
parent
ae84f3cbe8
commit
570f038062
4 changed files with 19 additions and 13 deletions
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
(mf/defc stroke-menu
|
(mf/defc stroke-menu
|
||||||
{::mf/wrap [#(mf/memo' % (mf/check-props ["ids" "values" "type" "show-caps"]))]}
|
{::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
|
(let [label (case type
|
||||||
:multiple (tr "workspace.options.selection-stroke")
|
:multiple (tr "workspace.options.selection-stroke")
|
||||||
:group (tr "workspace.options.group-stroke")
|
:group (tr "workspace.options.group-stroke")
|
||||||
|
@ -191,4 +191,5 @@
|
||||||
:on-reorder (handle-reorder index)
|
:on-reorder (handle-reorder index)
|
||||||
:disable-drag disable-drag
|
:disable-drag disable-drag
|
||||||
:select-all select-all
|
:select-all select-all
|
||||||
:on-blur on-blur}])])]]))
|
:on-blur on-blur
|
||||||
|
:disable-stroke-style disable-stroke-style}])])]]))
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
(second))))
|
(second))))
|
||||||
|
|
||||||
(mf/defc stroke-row
|
(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
|
(let [start-caps-state (mf/use-state {:open? false
|
||||||
:top 0
|
:top 0
|
||||||
:left 0})
|
:left 0})
|
||||||
|
@ -110,14 +110,15 @@
|
||||||
[:option {:value ":inner"} (tr "workspace.options.stroke.inner")]
|
[:option {:value ":inner"} (tr "workspace.options.stroke.inner")]
|
||||||
[:option {:value ":outer"} (tr "workspace.options.stroke.outer")]]
|
[:option {:value ":outer"} (tr "workspace.options.stroke.outer")]]
|
||||||
|
|
||||||
[:select#style.input-select {:value (enum->string (:stroke-style stroke))
|
(when-not disable-stroke-style
|
||||||
:on-change (on-stroke-style-change index)}
|
[:select#style.input-select {:value (enum->string (:stroke-style stroke))
|
||||||
(when (= (:stroke-style stroke) :multiple)
|
:on-change (on-stroke-style-change index)}
|
||||||
[:option {:value ""} "--"])
|
(when (= (:stroke-style stroke) :multiple)
|
||||||
[:option {:value ":solid"} (tr "workspace.options.stroke.solid")]
|
[:option {:value ""} "--"])
|
||||||
[:option {:value ":dotted"} (tr "workspace.options.stroke.dotted")]
|
[:option {:value ":solid"} (tr "workspace.options.stroke.solid")]
|
||||||
[:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
|
[:option {:value ":dotted"} (tr "workspace.options.stroke.dotted")]
|
||||||
[:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]]]
|
[:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
|
||||||
|
[:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]])]
|
||||||
|
|
||||||
;; Stroke Caps
|
;; Stroke Caps
|
||||||
(when show-caps
|
(when show-caps
|
||||||
|
|
|
@ -240,6 +240,8 @@
|
||||||
type :multiple
|
type :multiple
|
||||||
all-types (into #{} (map :type shapes))
|
all-types (into #{} (map :type shapes))
|
||||||
|
|
||||||
|
has-text? (contains? all-types :text)
|
||||||
|
|
||||||
[measure-ids measure-values] (get-attrs shapes objects :measure)
|
[measure-ids measure-values] (get-attrs shapes objects :measure)
|
||||||
|
|
||||||
[layer-ids layer-values
|
[layer-ids layer-values
|
||||||
|
@ -279,7 +281,8 @@
|
||||||
[:& fill-menu {:type type :ids fill-ids :values fill-values}])
|
[:& fill-menu {:type type :ids fill-ids :values fill-values}])
|
||||||
|
|
||||||
(when-not (empty? stroke-ids)
|
(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)
|
(when-not (empty? shadow-ids)
|
||||||
[:& shadow-menu {:type type :ids shadow-ids :values shadow-values}])
|
[:& shadow-menu {:type type :ids shadow-ids :values shadow-values}])
|
||||||
|
|
|
@ -80,7 +80,8 @@
|
||||||
|
|
||||||
[:& stroke-menu {:ids ids
|
[:& stroke-menu {:ids ids
|
||||||
:type type
|
:type type
|
||||||
:values stroke-values}]
|
:values stroke-values
|
||||||
|
:disable-stroke-style true}]
|
||||||
|
|
||||||
[:& shadow-menu
|
[:& shadow-menu
|
||||||
{:ids ids
|
{:ids ids
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue