0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-14 16:51:18 -05:00

🐛 Fix default color fill for textx

This commit is contained in:
Alejandro Alonso 2022-01-04 09:55:19 +01:00 committed by Alonso Torres
parent 88120b83bd
commit e0b7001a09
4 changed files with 11 additions and 9 deletions

View file

@ -5,6 +5,7 @@
### :boom: Breaking changes ### :boom: Breaking changes
### :sparkles: New features ### :sparkles: New features
- Setting fill automatically for new texts [Taiga #2441](https://tree.taiga.io/project/penpot/us/2441).
- Add shortcut to move action [Github #1213](https://github.com/penpot/penpot/issues/1213). - Add shortcut to move action [Github #1213](https://github.com/penpot/penpot/issues/1213).
- Add alt as mod key to add stroke color from library menu [Taiga #2207](https://tree.taiga.io/project/penpot/us/2207). - Add alt as mod key to add stroke color from library menu [Taiga #2207](https://tree.taiga.io/project/penpot/us/2207).
- Add detach in bulk option to context menu [Taiga #2210](https://tree.taiga.io/project/penpot/us/2210). - Add detach in bulk option to context menu [Taiga #2210](https://tree.taiga.io/project/penpot/us/2210).

View file

@ -6,6 +6,7 @@
(ns app.common.text (ns app.common.text
(:require (:require
[app.common.colors :as clr]
[app.common.data :as d] [app.common.data :as d]
[app.common.transit :as t] [app.common.transit :as t]
[clojure.walk :as walk] [clojure.walk :as walk]
@ -25,7 +26,7 @@
:text-transform "none" :text-transform "none"
:text-align "left" :text-align "left"
:text-decoration "none" :text-decoration "none"
:fill-color nil :fill-color clr/black
:fill-opacity 1}) :fill-opacity 1})
(def typography-fields (def typography-fields
@ -247,6 +248,3 @@
{:blocks (reduce #(conj %1 (build-block %2)) [] (node-seq #(= (:type %) "paragraph") root)) {:blocks (reduce #(conj %1 (build-block %2)) [] (node-seq #(= (:type %) "paragraph") root))
:entityMap {}})) :entityMap {}}))

View file

@ -24,7 +24,7 @@
(mf/defc fill-menu (mf/defc fill-menu
{::mf/wrap [#(mf/memo' % (mf/check-props ["ids" "values"]))]} {::mf/wrap [#(mf/memo' % (mf/check-props ["ids" "values"]))]}
[{:keys [ids type values] :as props}] [{:keys [ids type values disable-remove?] :as props}]
(let [show? (or (not (nil? (:fill-color values))) (let [show? (or (not (nil? (:fill-color values)))
(not (nil? (:fill-color-gradient values)))) (not (nil? (:fill-color-gradient values))))
@ -75,7 +75,8 @@
[:div.element-set [:div.element-set
[:div.element-set-title [:div.element-set-title
[:span label] [:span label]
[:div.add-page {:on-click on-delete} i/minus]] (when (not disable-remove?)
[:div.add-page {:on-click on-delete} i/minus])]
[:div.element-set-content [:div.element-set-content
[:& color-row {:color color [:& color-row {:color color
@ -87,5 +88,3 @@
[:div.element-set-title [:div.element-set-title
[:span label] [:span label]
[:div.add-page {:on-click on-add} i/close]]]))) [:div.add-page {:on-click on-add} i/close]]])))

View file

@ -6,6 +6,7 @@
(ns app.main.ui.workspace.sidebar.options.shapes.text (ns app.main.ui.workspace.sidebar.options.shapes.text
(:require (:require
[app.common.colors :as clr]
[app.common.data :as d] [app.common.data :as d]
[app.main.data.workspace.texts :as dwt] [app.main.data.workspace.texts :as dwt]
[app.main.refs :as refs] [app.main.refs :as refs]
@ -36,6 +37,8 @@
fill-values (d/update-in-when fill-values [:fill-color-gradient :type] keyword) fill-values (d/update-in-when fill-values [:fill-color-gradient :type] keyword)
fill-values (cond-> fill-values fill-values (cond-> fill-values
(not (contains? fill-values :fill-color)) (assoc :fill-color clr/black)
(not (contains? fill-values :fill-opacity)) (assoc :fill-opacity 1)
;; Keep for backwards compatibility ;; Keep for backwards compatibility
(:fill fill-values) (assoc :fill-color (:fill fill-values)) (:fill fill-values) (assoc :fill-color (:fill fill-values))
(:opacity fill-values) (assoc :fill-opacity (:fill fill-values))) (:opacity fill-values) (assoc :fill-opacity (:fill fill-values)))
@ -73,7 +76,8 @@
[:& fill-menu [:& fill-menu
{:ids ids {:ids ids
:type type :type type
:values fill-values}] :values fill-values
:disable-remove? true}]
[:& shadow-menu [:& shadow-menu
{:ids ids {:ids ids