Skip to content

Commit

Permalink
debug gui
Browse files Browse the repository at this point in the history
  • Loading branch information
pythcoiner committed Aug 6, 2024
1 parent 2c235c4 commit 1a5104e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion gui/src/installer/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,7 @@ pub fn hw_list_view(
device_must_support_taproot: bool,
network: Network,
) -> Element<Message> {
let mut upgrade = false;
let mut bttn = Button::new(match hw {
HardwareWallet::Supported {
kind,
Expand All @@ -1746,6 +1747,7 @@ pub fn hw_list_view(
} else if selected {
hw::selected_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
} else if device_must_support_taproot && ledger_need_taproot_upgrade(kind, version) {
upgrade = true;
match hw.is_upgrade_in_progress() {
false => ledger_need_upgrade(
kind,
Expand Down Expand Up @@ -1779,7 +1781,7 @@ pub fn hw_list_view(
.style(theme::Button::Border)
.width(Length::Fill)
.padding(1);
if !processing && hw.is_supported() {
if !processing && hw.is_supported() && !upgrade {
bttn = bttn.on_press(Message::Select(i));
}
Container::new(bttn)
Expand Down
11 changes: 10 additions & 1 deletion gui/ui/src/component/hw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,16 @@ pub fn ledger_upgrading<'a, T: 'a + std::clone::Clone, K: Display, V: Display>(

let logs: Vec<_> = logs.into_iter().map(|msg| p2_regular(msg).into()).collect();

let banner = Container::new(Column::new().push(p1_regular("Upgrading:")).extend(logs));
let banner = Container::new(
Column::new().push(p1_regular("Upgrading:")).push(
Scrollable::new(Column::with_children(logs))
.height(50)
.width(Length::Fill),
),
)
.padding(15)
.style(theme::Container::Card(theme::Card::HalfBottom))
.width(Length::Fill);

Container::new(Column::new().push(device).push(banner))
.style(theme::Container::Card(theme::Card::Simple))
Expand Down
4 changes: 2 additions & 2 deletions gui/ui/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl Card {
Card::HalfTop => container::Appearance {
background: Some(color::GREY_2.into()),
border: Border {
radius: [25.0, 25.0, 0.0, 0.0].into(),
radius: [30.0, 30.0, 0.0, 0.0].into(),
..Border::default()
},
..container::Appearance::default()
Expand All @@ -355,7 +355,7 @@ impl Card {
text_color: color::GREY_2.into(),
background: Some(color::ORANGE.into()),
border: Border {
radius: [0.0, 0.0, 25.0, 25.0].into(),
radius: [0.0, 0.0, 30.0, 30.0].into(),
..Border::default()
},
..container::Appearance::default()
Expand Down

0 comments on commit 1a5104e

Please sign in to comment.