diff --git a/src/gui/views/goblin/mod.rs b/src/gui/views/goblin/mod.rs index 852ae998..29841e0a 100644 --- a/src/gui/views/goblin/mod.rs +++ b/src/gui/views/goblin/mod.rs @@ -903,25 +903,53 @@ impl GoblinWalletView { fn pay_ui(&mut self, ui: &mut egui::Ui, wallet: &Wallet, cb: &dyn PlatformCallbacks) { let t = theme::tokens(); ui.add_space(8.0); + // Header identity for the avatar (→ settings), mirroring the Home header. + let (header_handle, header_hex) = wallet + .nostr_service() + .map(|s| { + let id = s.identity.read(); + let hex = hex_of(&id.npub); + let h = id + .nip05 + .clone() + .map(|n| format!("@{}", n.split('@').next().unwrap_or(""))) + .unwrap_or_else(|| data::short_npub(&hex)); + (h, hex) + }) + .unwrap_or_else(|| ("N".to_string(), String::new())); + let header_hue = data::hue_of(&header_hex); + let header_tex = self.handle_tex(ui.ctx(), wallet, &header_handle); ui.horizontal(|ui| { - // Goblin mark in place of a "Pay" title (Cash App-style brand header), - // tinted dark to read on the yellow surface. + // Goblin mark (left), sized to match the right-side controls. ui.add( egui::Image::new(egui::include_image!("../../../../img/goblin-logo2.svg")) .tint(t.text) - .fit_to_exact_size(Vec2::splat(34.0)), + .fit_to_exact_size(Vec2::splat(40.0)), ); - // Scan-to-pay QR, top-right (mirrors the Home header scan puck): - // open the scanner with the typed amount preserved. + // Right cluster: scan QR (black, no background) then the profile + // picture at the far right; all three controls about the same size. ui.with_layout(Layout::right_to_left(Align::Center), |ui| { - let (rect, resp) = ui.allocate_exact_size(Vec2::splat(48.0), Sense::click()); - ui.painter().circle_filled(rect.center(), 24.0, t.surface2); + if w::avatar_any( + ui, + &header_handle, + &header_hex, + 40.0, + header_hue, + header_tex.as_ref(), + ) + .on_hover_cursor(egui::CursorIcon::PointingHand) + .clicked() + { + self.tab = Tab::Me; + } + ui.add_space(12.0); + let (rect, resp) = ui.allocate_exact_size(Vec2::splat(44.0), Sense::click()); ui.painter().text( rect.center(), egui::Align2::CENTER_CENTER, QR_CODE, - FontId::new(23.0, fonts::regular()), - t.surface_text, + FontId::new(38.0, fonts::regular()), + t.text, ); if resp .on_hover_cursor(egui::CursorIcon::PointingHand)