From f26cdd3a4b5241d501a409600ba73cf779168817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Thu, 10 Oct 2024 18:38:26 +0200 Subject: [PATCH] FIX: Sets the patternFill to solid when changing the background color --- base/src/test/user_model/test_styles.rs | 2 ++ base/src/user_model/common.rs | 2 ++ webapp/src/icons/ironcalc_icon.svg | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 webapp/src/icons/ironcalc_icon.svg diff --git a/base/src/test/user_model/test_styles.rs b/base/src/test/user_model/test_styles.rs index 377ff29..a6e5f93 100644 --- a/base/src/test/user_model/test_styles.rs +++ b/base/src/test/user_model/test_styles.rs @@ -145,6 +145,7 @@ fn basic_fill() { let style = model.get_cell_style(0, 1, 1).unwrap(); assert_eq!(style.fill.bg_color, None); assert_eq!(style.fill.fg_color, None); + assert_eq!(&style.fill.pattern_type, "none"); // bg_color model @@ -156,6 +157,7 @@ fn basic_fill() { let style = model.get_cell_style(0, 1, 1).unwrap(); assert_eq!(style.fill.bg_color, Some("#F2F2F2".to_owned())); assert_eq!(style.fill.fg_color, Some("#F3F4F5".to_owned())); + assert_eq!(&style.fill.pattern_type, "solid"); let send_queue = model.flush_send_queue(); diff --git a/base/src/user_model/common.rs b/base/src/user_model/common.rs index 6e46fdc..b68a0d7 100644 --- a/base/src/user_model/common.rs +++ b/base/src/user_model/common.rs @@ -882,9 +882,11 @@ impl UserModel { } "fill.bg_color" => { style.fill.bg_color = color(value)?; + style.fill.pattern_type = "solid".to_string(); } "fill.fg_color" => { style.fill.fg_color = color(value)?; + style.fill.pattern_type = "solid".to_string(); } "num_fmt" => { value.clone_into(&mut style.num_fmt); diff --git a/webapp/src/icons/ironcalc_icon.svg b/webapp/src/icons/ironcalc_icon.svg new file mode 100644 index 0000000..261e91b --- /dev/null +++ b/webapp/src/icons/ironcalc_icon.svg @@ -0,0 +1,7 @@ + + + + + + +