Add color choices to the options bar of tools (#1199)

* Generalize PenColorType -> ToolColorType

* impl default for ToolColorOptions

* Add stroke color option to the freehand tool

* Consolidate working color update messages

* Update tool working colours when switching tools

* Update working colors on tool activation

* Add stroke color option to line tool

* Add fill color option to freehand tool

* Add tool color options to spline tool

* Fix freehand tool

* Add color options to text

* Add tool color/weight options to rectangle

* Add tool color/weight options to ellipse

* Add tool color/weight options to shape

* Fix spline default fill/stroke

* Reorder widgets and code cleanup

* Add CustomColor icon

* Fix warnings

* Change color defaults to secondary fill, primary stroke

* Fix spacing between brush options number inputs

* Add toolbar color option to brush

* Implement allowNone on color input widget

* Rearrange widget and remove X from brush

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Chase
2023-05-08 10:00:10 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 6d1eff0437
commit eca018975c
21 changed files with 929 additions and 310 deletions
@@ -443,6 +443,9 @@ impl WidgetHolder {
pub fn new(widget: Widget) -> Self {
Self { widget_id: generate_uuid(), widget }
}
pub fn section_separator() -> Self {
Separator::new(SeparatorDirection::Horizontal, SeparatorType::Section).widget_holder()
}
pub fn unrelated_separator() -> Self {
Separator::new(SeparatorDirection::Horizontal, SeparatorType::Unrelated).widget_holder()
}
@@ -53,11 +53,9 @@ pub struct ColorInput {
// #[serde(rename = "allowTransparency")]
// #[derivative(Default(value = "false"))]
// pub allow_transparency: bool,
// TODO: Implement
// #[serde(rename = "allowNone")]
// #[derivative(Default(value = "false"))]
// pub allow_none: bool,
#[serde(rename = "allowNone")]
#[derivative(Default(value = "true"))]
pub allow_none: bool,
// pub disabled: bool,
pub tooltip: String,