0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 15:51:37 -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
### :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 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).

View file

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

View file

@ -24,7 +24,7 @@
(mf/defc fill-menu
{::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)))
(not (nil? (:fill-color-gradient values))))
@ -75,7 +75,8 @@
[:div.element-set
[:div.element-set-title
[: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
[:& color-row {:color color
@ -87,5 +88,3 @@
[:div.element-set-title
[:span label]
[:div.add-page {:on-click on-add} i/close]]])))

View file

@ -6,6 +6,7 @@
(ns app.main.ui.workspace.sidebar.options.shapes.text
(:require
[app.common.colors :as clr]
[app.common.data :as d]
[app.main.data.workspace.texts :as dwt]
[app.main.refs :as refs]
@ -36,6 +37,8 @@
fill-values (d/update-in-when fill-values [:fill-color-gradient :type] keyword)
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
(:fill fill-values) (assoc :fill-color (:fill fill-values))
(:opacity fill-values) (assoc :fill-opacity (:fill fill-values)))
@ -73,7 +76,8 @@
[:& fill-menu
{:ids ids
:type type
:values fill-values}]
:values fill-values
:disable-remove? true}]
[:& shadow-menu
{:ids ids