mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-26 19:56:48 -06:00
Integration: #2095 error-check colours come from theme tokens
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user