gui(installer): 37dab1bff29333e6f73616238d5e608975002ce7 make only the warning displayed when a device does not support tapminiscript, this commit add also the 'selected' icon
This commit is contained in:
parent
30024e576e
commit
f075b3de74
@ -1558,11 +1558,19 @@ pub fn hw_list_view(
|
||||
alias,
|
||||
..
|
||||
} => {
|
||||
let not_tapminiscript = device_must_support_taproot
|
||||
&& !is_compatible_with_tapminiscript(kind, version.as_ref());
|
||||
if chosen && processing {
|
||||
hw::processing_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
||||
} else if device_must_support_taproot
|
||||
&& !is_compatible_with_tapminiscript(kind, version.as_ref())
|
||||
{
|
||||
} else if selected {
|
||||
hw::selected_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref(), {
|
||||
if not_tapminiscript {
|
||||
Some("Device firmware version does not support taproot miniscript")
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
} else if not_tapminiscript {
|
||||
hw::warning_hardware_wallet(
|
||||
kind,
|
||||
version.as_ref(),
|
||||
@ -1570,8 +1578,6 @@ pub fn hw_list_view(
|
||||
alias.as_ref(),
|
||||
"Device firmware version does not support taproot miniscript",
|
||||
)
|
||||
} else if selected {
|
||||
hw::selected_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
||||
} else {
|
||||
hw::supported_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
||||
}
|
||||
@ -1627,6 +1633,13 @@ pub fn key_list_view<'a>(
|
||||
version,
|
||||
fingerprint,
|
||||
Some(name),
|
||||
if device_must_support_taproot
|
||||
&& kind.map(|kind| is_compatible_with_tapminiscript(kind, version)) == Some(false)
|
||||
{
|
||||
Some("Device firmware version does not support taproot miniscript")
|
||||
} else {
|
||||
None
|
||||
},
|
||||
)
|
||||
} else if device_must_support_taproot
|
||||
&& kind.map(|kind| is_compatible_with_tapminiscript(kind, version)) == Some(false)
|
||||
|
||||
@ -190,26 +190,31 @@ pub fn selected_hardware_wallet<'a, T: 'a, K: Display, V: Display, F: Display>(
|
||||
version: Option<V>,
|
||||
fingerprint: F,
|
||||
alias: Option<impl Into<Cow<'a, str>>>,
|
||||
warning: Option<&'static str>,
|
||||
) -> Container<'a, T> {
|
||||
container(
|
||||
row(vec![
|
||||
column(vec![
|
||||
Row::new()
|
||||
.spacing(5)
|
||||
.push_maybe(alias.map(|a| text::p1_bold(a)))
|
||||
.push(text::p1_regular(format!("#{}", fingerprint)))
|
||||
.into(),
|
||||
Row::new()
|
||||
.spacing(5)
|
||||
.push(text::caption(kind.to_string()))
|
||||
.push_maybe(version.map(|v| text::caption(v.to_string())))
|
||||
.into(),
|
||||
])
|
||||
.width(Length::Fill)
|
||||
.into(),
|
||||
image::success_mark_icon().width(Length::Fixed(50.0)).into(),
|
||||
])
|
||||
.align_items(Alignment::Center),
|
||||
Row::new()
|
||||
.push(
|
||||
column(vec![
|
||||
Row::new()
|
||||
.spacing(5)
|
||||
.push_maybe(alias.map(|a| text::p1_bold(a)))
|
||||
.push(text::p1_regular(format!("#{}", fingerprint)))
|
||||
.into(),
|
||||
Row::new()
|
||||
.spacing(5)
|
||||
.push(text::caption(kind.to_string()))
|
||||
.push_maybe(version.map(|v| text::caption(v.to_string())))
|
||||
.into(),
|
||||
])
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.push_maybe(warning.map(|w| {
|
||||
tooltip::Tooltip::new(icon::warning_icon(), w, tooltip::Position::Bottom)
|
||||
.style(theme::Container::Card(theme::Card::Simple))
|
||||
}))
|
||||
.push(image::success_mark_icon().width(Length::Fixed(50.0)))
|
||||
.align_items(Alignment::Center),
|
||||
)
|
||||
.padding(10)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user