Build 72: fix the Pay-screen brand marks
Correct the Build 71 misread of the design notes: - Amount keeps the ツ unit mark (revert the goblin mark next to the number). - The goblin mark replaces the "Pay" title at the top-left (tinted dark to read on the yellow surface). - The bottom tab-bar strip turns yellow on the Pay surface, like the body. - (Dark status-bar icons on the yellow surface kept from Build 71.)
This commit is contained in:
@@ -360,7 +360,12 @@ impl GoblinWalletView {
|
||||
let bottom_inset = View::get_bottom_inset();
|
||||
egui::TopBottomPanel::bottom("goblin_tabs")
|
||||
.frame(egui::Frame {
|
||||
fill: t.bg,
|
||||
// Bottom strip goes yellow on the Pay surface, like the body.
|
||||
fill: if self.tab == Tab::Pay {
|
||||
theme::YELLOW.bg
|
||||
} else {
|
||||
t.bg
|
||||
},
|
||||
inner_margin: Margin {
|
||||
left: 16,
|
||||
right: 16,
|
||||
@@ -888,10 +893,12 @@ impl GoblinWalletView {
|
||||
let t = theme::tokens();
|
||||
ui.add_space(8.0);
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(
|
||||
RichText::new("Pay")
|
||||
.font(FontId::new(28.0, fonts::bold()))
|
||||
.color(t.text),
|
||||
// Goblin mark in place of a "Pay" title (Cash App-style brand header),
|
||||
// tinted dark to read on the yellow surface.
|
||||
ui.add(
|
||||
egui::Image::new(egui::include_image!("../../../../img/goblin-logo2.svg"))
|
||||
.tint(t.text)
|
||||
.fit_to_exact_size(Vec2::splat(34.0)),
|
||||
);
|
||||
// Scan-to-pay QR, top-right (mirrors the Home header scan puck):
|
||||
// open the scanner with the typed amount preserved.
|
||||
@@ -948,10 +955,10 @@ impl GoblinWalletView {
|
||||
let dx = 14.0 * (1.0 - p) * (p * std::f32::consts::PI * 9.0).sin();
|
||||
// Red flash that eases back to the normal ink over the shake.
|
||||
let num = lerp_color(t.neg, t.text, p);
|
||||
// goblin mark keeps its colours; only the digits flash red.
|
||||
w::amount_text_centered_goblin(ui, &display, 76.0, num, dx);
|
||||
let mark = lerp_color(t.neg, t.text_dim, p);
|
||||
w::amount_text_centered_shifted(ui, &display, 76.0, num, mark, dx);
|
||||
} else {
|
||||
w::amount_text_centered_goblin(ui, &display, 76.0, t.text, 0.0);
|
||||
w::amount_text_centered(ui, &display, 76.0);
|
||||
}
|
||||
if let Ok(grin) = display.parse::<f64>() {
|
||||
if let Some(preview) = pairing_preview(grin) {
|
||||
|
||||
@@ -227,42 +227,6 @@ pub fn amount_text_centered_shifted(
|
||||
});
|
||||
}
|
||||
|
||||
/// Pay-screen hero amount: the number with the **goblin mark** as its unit (in
|
||||
/// place of the ツ glyph), centered. `dx` is the over-balance shake offset.
|
||||
pub fn amount_text_centered_goblin(ui: &mut Ui, value: &str, size: f32, num_ink: Color32, dx: f32) {
|
||||
let avail = ui.available_width();
|
||||
let measure = |ui: &Ui, sz: f32| -> f32 {
|
||||
ui.painter()
|
||||
.layout_no_wrap(value.to_string(), FontId::new(sz, fonts::bold()), num_ink)
|
||||
.size()
|
||||
.x
|
||||
};
|
||||
// Goblin mark ~half the digit height, with a small gap before it.
|
||||
let mark_of = |sz: f32| sz * 0.52;
|
||||
let gap = size * 0.06;
|
||||
let mut size = size;
|
||||
let total0 = measure(ui, size) + gap + mark_of(size);
|
||||
if total0 > avail && total0 > 1.0 {
|
||||
size = (size * (avail / total0) * 0.97).clamp(14.0, size);
|
||||
}
|
||||
let mark = mark_of(size);
|
||||
let total = measure(ui, size) + gap + mark;
|
||||
ui.horizontal(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 0.0;
|
||||
ui.add_space(((ui.available_width() - total) / 2.0 + dx).max(0.0));
|
||||
ui.label(
|
||||
RichText::new(value)
|
||||
.font(FontId::new(size, fonts::bold()))
|
||||
.color(num_ink),
|
||||
);
|
||||
ui.add_space(gap);
|
||||
ui.add(
|
||||
egui::Image::new(egui::include_image!("../../../../img/goblin-logo2.svg"))
|
||||
.fit_to_exact_size(Vec2::splat(mark)),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/// An uppercase letterspaced kicker label.
|
||||
pub fn kicker(ui: &mut Ui, text: &str) {
|
||||
let t = theme::tokens();
|
||||
|
||||
Reference in New Issue
Block a user