mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-04 22:28:12 +08:00
Move gradient picking into the color picker (#1778)
* Gradient picker * Fix up color picker layout CSS problems * Begin hooking up SpectrumInput for gradient in the ColorPicker * Working gradient picking on the frontend only * Plumb FillColorChoice into the backend * Hook everything else up, just with a weird bug remaining * Fix some svelty reactivity issues * Add and remove stops * Cleanup * Rename type * Fill node document format upgrading * Fix lint * Polish the color picker UX and fix a bug --------- Co-authored-by: 0hypercube <0hypercube@gmail.com>
This commit is contained in:
co-authored by
0hypercube
parent
449729f1e1
commit
a9a4b5cd19
@@ -7,6 +7,7 @@ use graphene_core::raster::color::Color;
|
||||
use graphene_core::renderer::Quad;
|
||||
|
||||
use glam::DVec2;
|
||||
use graphene_std::vector::style::FillChoice;
|
||||
|
||||
fn grid_overlay_rectangular(document: &DocumentMessageHandler, overlay_context: &mut OverlayContext, spacing: DVec2) {
|
||||
let origin = document.snapping_state.grid.origin;
|
||||
@@ -226,7 +227,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
|
||||
};
|
||||
let update_color = |grid, update: fn(&mut GridSnapping) -> Option<&mut Color>| {
|
||||
update_val::<ColorButton>(grid, move |grid, color| {
|
||||
if let Some(color) = color.value {
|
||||
if let FillChoice::Solid(color) = color.value {
|
||||
if let Some(update_color) = update(grid) {
|
||||
*update_color = color;
|
||||
}
|
||||
@@ -276,7 +277,7 @@ pub fn overlay_options(grid: &GridSnapping) -> Vec<LayoutGroup> {
|
||||
Separator::new(SeparatorType::Related).widget_holder(),
|
||||
]);
|
||||
color_widgets.push(
|
||||
ColorButton::new(Some(grid.grid_color))
|
||||
ColorButton::new(FillChoice::Solid(grid.grid_color))
|
||||
.tooltip("Grid display color")
|
||||
.on_update(update_color(grid, |grid| Some(&mut grid.grid_color)))
|
||||
.widget_holder(),
|
||||
|
||||
Reference in New Issue
Block a user