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,
|
alias,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
|
let not_tapminiscript = device_must_support_taproot
|
||||||
|
&& !is_compatible_with_tapminiscript(kind, version.as_ref());
|
||||||
if chosen && processing {
|
if chosen && processing {
|
||||||
hw::processing_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
hw::processing_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
||||||
} else if device_must_support_taproot
|
} else if selected {
|
||||||
&& !is_compatible_with_tapminiscript(kind, version.as_ref())
|
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(
|
hw::warning_hardware_wallet(
|
||||||
kind,
|
kind,
|
||||||
version.as_ref(),
|
version.as_ref(),
|
||||||
@ -1570,8 +1578,6 @@ pub fn hw_list_view(
|
|||||||
alias.as_ref(),
|
alias.as_ref(),
|
||||||
"Device firmware version does not support taproot miniscript",
|
"Device firmware version does not support taproot miniscript",
|
||||||
)
|
)
|
||||||
} else if selected {
|
|
||||||
hw::selected_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
|
||||||
} else {
|
} else {
|
||||||
hw::supported_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
hw::supported_hardware_wallet(kind, version.as_ref(), fingerprint, alias.as_ref())
|
||||||
}
|
}
|
||||||
@ -1627,6 +1633,13 @@ pub fn key_list_view<'a>(
|
|||||||
version,
|
version,
|
||||||
fingerprint,
|
fingerprint,
|
||||||
Some(name),
|
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
|
} else if device_must_support_taproot
|
||||||
&& kind.map(|kind| is_compatible_with_tapminiscript(kind, version)) == Some(false)
|
&& 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>,
|
version: Option<V>,
|
||||||
fingerprint: F,
|
fingerprint: F,
|
||||||
alias: Option<impl Into<Cow<'a, str>>>,
|
alias: Option<impl Into<Cow<'a, str>>>,
|
||||||
|
warning: Option<&'static str>,
|
||||||
) -> Container<'a, T> {
|
) -> Container<'a, T> {
|
||||||
container(
|
container(
|
||||||
row(vec![
|
Row::new()
|
||||||
column(vec![
|
.push(
|
||||||
Row::new()
|
column(vec![
|
||||||
.spacing(5)
|
Row::new()
|
||||||
.push_maybe(alias.map(|a| text::p1_bold(a)))
|
.spacing(5)
|
||||||
.push(text::p1_regular(format!("#{}", fingerprint)))
|
.push_maybe(alias.map(|a| text::p1_bold(a)))
|
||||||
.into(),
|
.push(text::p1_regular(format!("#{}", fingerprint)))
|
||||||
Row::new()
|
.into(),
|
||||||
.spacing(5)
|
Row::new()
|
||||||
.push(text::caption(kind.to_string()))
|
.spacing(5)
|
||||||
.push_maybe(version.map(|v| text::caption(v.to_string())))
|
.push(text::caption(kind.to_string()))
|
||||||
.into(),
|
.push_maybe(version.map(|v| text::caption(v.to_string())))
|
||||||
])
|
.into(),
|
||||||
.width(Length::Fill)
|
])
|
||||||
.into(),
|
.width(Length::Fill),
|
||||||
image::success_mark_icon().width(Length::Fixed(50.0)).into(),
|
)
|
||||||
])
|
.push_maybe(warning.map(|w| {
|
||||||
.align_items(Alignment::Center),
|
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)
|
.padding(10)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user