Integration: #2095 error-check colours come from theme tokens

This commit is contained in:
aiongg
2026-10-22 02:36:59 +00:00
parent 75f6c92eab
commit 59e6f123ba
2 changed files with 13 additions and 6 deletions
+3 -6
View File
@@ -1385,7 +1385,7 @@ pub(crate) fn paint_quadrant(
let s = 6.0 * z.max(0.7);
p.add(egui::Shape::convex_polygon(
vec![rect.left_top(), pos2(rect.left() + s, rect.top()), pos2(rect.left(), rect.top() + s)],
ERROR_CHECK_GREEN,
t.error_check_green,
Stroke::NONE,
));
}
@@ -3042,9 +3042,6 @@ fn object_menu(app: &mut SheetApp, ui: &mut egui::Ui) {
}
}
/// Excel's background error-checking indicator colour.
const ERROR_CHECK_GREEN: Color32 = Color32::from_rgb(0x1E, 0x8E, 0x3E);
/// The warning button beside an active cell holding a number stored as text, as in Excel: its
/// menu names the problem and offers Convert to Number for the selection (#1994).
fn error_check_tag(app: &mut SheetApp, ui: &mut egui::Ui, geo: &Geo, sh: &Sheet) {
@@ -3075,10 +3072,10 @@ fn error_check_tag(app: &mut SheetApp, ui: &mut egui::Ui, geo: &Geo, sh: &Sheet)
let r = 6.0;
p.add(egui::Shape::convex_polygon(
vec![pos2(c.x, c.y - r), pos2(c.x + r, c.y), pos2(c.x, c.y + r), pos2(c.x - r, c.y)],
Color32::from_rgb(0xF2, 0xB7, 0x05),
t.warning_fill,
Stroke::NONE,
));
p.text(c, egui::Align2::CENTER_CENTER, "!", egui::FontId::proportional(10.0), Color32::BLACK);
p.text(c, egui::Align2::CENTER_CENTER, "!", egui::FontId::proportional(10.0), t.warning_ink);
egui::Popup::menu(&resp).show(|ui| {
ui.label(egui::RichText::new(lang.tr("Number Stored as Text")).strong());
ui.separator();
+10
View File
@@ -45,6 +45,10 @@ pub struct Tokens {
pub menu_bg: Color32,
pub shadow: Color32,
pub danger: Color32,
/// Background error checking: the corner triangle, and the warning button's diamond and mark.
pub error_check_green: Color32,
pub warning_fill: Color32,
pub warning_ink: Color32,
/// Info-bar (notice strip) fills, by severity.
pub notice_warn_bg: Color32,
pub notice_warn_border: Color32,
@@ -88,6 +92,9 @@ impl Tokens {
menu_bg: Color32::WHITE,
shadow: Color32::from_black_alpha(40),
danger: Color32::from_rgb(0xC4, 0x2B, 0x1C),
error_check_green: Color32::from_rgb(0x1E, 0x8E, 0x3E),
warning_fill: Color32::from_rgb(0xF2, 0xB7, 0x05),
warning_ink: Color32::BLACK,
notice_warn_bg: Color32::from_rgb(0xFF, 0xF4, 0xCE),
notice_warn_border: Color32::from_rgb(0xF0, 0xC3, 0x6E),
notice_info_bg: Color32::from_rgb(0xEA, 0xF2, 0xFB),
@@ -130,6 +137,9 @@ impl Tokens {
menu_bg: Color32::from_rgb(0x30, 0x30, 0x30),
shadow: Color32::from_black_alpha(90),
danger: Color32::from_rgb(0xF1, 0x70, 0x5F),
error_check_green: Color32::from_rgb(0x4C, 0xC2, 0x6B),
warning_fill: Color32::from_rgb(0xF2, 0xB7, 0x05),
warning_ink: Color32::BLACK,
notice_warn_bg: Color32::from_rgb(0x4A, 0x3F, 0x1E),
notice_warn_border: Color32::from_rgb(0x7A, 0x67, 0x30),
notice_info_bg: Color32::from_rgb(0x24, 0x33, 0x44),