Skip to content

Conversation

@ronnakamoto
Copy link

@ronnakamoto ronnakamoto commented May 17, 2025

Updated the transfer UI to have a better look.

image

use eframe::egui::{self, Color32, Response, Ui};

/// Layout dimensions
pub struct LayoutDimensions;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a struct? This could be a module

}

/// Layout colors
pub struct LayoutColors;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a struct? This could be a module

}

/// Helper functions for layout
pub struct LayoutHelpers;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a struct? This could be a module

if !self.amount.is_empty() && amount.is_err() {
ui.add_space(LayoutDimensions::SMALL_SPACING);
ui.colored_label(
egui::Color32::from_rgb(255, 0, 0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colors should be defined as consts somewhere

{
// Set a maximum length of 62 characters for Bitcoin addresses
// This covers all Bitcoin address formats (P2PKH, P2SH, Bech32, etc.)
if self.mainchain_address.len() > 62 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the 62 should be defined as a const somewhere

// Set a maximum length of 62 characters for Bitcoin addresses
// This covers all Bitcoin address formats (P2PKH, P2SH, Bech32, etc.)
if self.mainchain_address.len() > 62 {
self.mainchain_address.truncate(62);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truncation seems like the wrong behavior here. If the address is too long to be parsed, then displaying a parse error is preferable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants