ui: add success mark and key mark

This commit is contained in:
edouard 2023-05-10 09:51:07 +02:00
parent 4c08f4ae35
commit b9ca312b07
5 changed files with 44 additions and 35 deletions

View File

@ -1120,12 +1120,7 @@ pub fn undefined_descriptor_key<'a>() -> Element<'a, message::DefineKey> {
Column::new()
.spacing(15)
.align_items(Alignment::Center)
.push(
icon::key_icon()
.size(30)
.width(Length::Units(50))
.style(color::GREY_3),
),
.push(image::key_mark_icon().width(Length::Units(30))),
)
.height(Length::Fill)
.align_y(alignment::Vertical::Center),
@ -1162,30 +1157,19 @@ pub fn defined_descriptor_key(
),
)
.push(
Column::new()
.align_items(Alignment::Center)
.spacing(5)
.push(
Container::new(
Column::new()
.spacing(5)
.align_items(Alignment::Center)
.push(
scrollable(text(name).bold()).horizontal_scroll(
Properties::new().width(2).scroller_width(2),
),
)
.push(
icon::circle_check_icon()
.style(color::GREEN)
.size(20)
.width(Length::Units(50)),
),
Container::new(
Column::new()
.spacing(10)
.align_items(Alignment::Center)
.push(
scrollable(text(name).bold())
.horizontal_scroll(Properties::new().width(2).scroller_width(2)),
)
.height(Length::Fill)
.align_y(alignment::Vertical::Center),
)
.height(Length::Fill),
.push(image::success_mark_icon().width(Length::Units(50)))
.push(Space::with_width(Length::Units(1))),
)
.height(Length::Fill)
.align_y(alignment::Vertical::Center),
)
.push(
button::secondary(Some(icon::pencil_icon()), "Edit").on_press(message::DefineKey::Edit),

View File

@ -1,4 +1,4 @@
use crate::{color, component::text, icon, theme, util::*, widget::*};
use crate::{color, component::text, icon, image, theme, util::*, widget::*};
use iced::{
widget::{column, container, row, tooltip},
Alignment, Length,
@ -121,7 +121,7 @@ pub fn selected_hardware_wallet<'a, T: 'a, K: Display, V: Display, F: Display>(
])
.width(Length::Fill)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
image::success_mark_icon().width(Length::Units(50)).into(),
])
.align_items(Alignment::Center),
)
@ -151,8 +151,8 @@ pub fn sign_success_hardware_wallet<'a, T: 'a, K: Display, V: Display, F: Displa
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Signed").style(color::GREEN).into(),
image::success_mark_icon().width(Length::Units(50)).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -186,8 +186,8 @@ pub fn registration_success_hardware_wallet<'a, T: 'a, K: Display, V: Display, F
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Registered").style(color::GREEN).into(),
image::success_mark_icon().width(Length::Units(50)).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -250,8 +250,8 @@ pub fn sign_success_hot_signer<'a, T: 'a, F: Display>(
.width(Length::Fill)
.into(),
row(vec![
icon::circle_check_icon().style(color::GREEN).into(),
text::p1_regular("Signed").style(color::GREEN).into(),
image::success_mark_icon().width(Length::Units(50)).into(),
])
.align_items(Alignment::Center)
.spacing(5)
@ -284,7 +284,7 @@ pub fn selected_hot_signer<'a, T: 'a, F: Display>(
])
.width(Length::Fill)
.into(),
icon::circle_check_icon().style(color::GREEN).into(),
image::success_mark_icon().width(Length::Units(50)).into(),
])
.align_items(Alignment::Center),
)

View File

@ -39,3 +39,17 @@ pub fn restore_wallet_icon() -> Svg {
let h = Handle::from_memory(RESTORE_WALLET_ICON.to_vec());
Svg::new(h)
}
const SUCCESS_MARK_ICON: &[u8] = include_bytes!("../static/icons/success-mark.svg");
pub fn success_mark_icon() -> Svg {
let h = Handle::from_memory(SUCCESS_MARK_ICON.to_vec());
Svg::new(h)
}
const KEY_MARK_ICON: &[u8] = include_bytes!("../static/icons/key-mark.svg");
pub fn key_mark_icon() -> Svg {
let h = Handle::from_memory(KEY_MARK_ICON.to_vec());
Svg::new(h)
}

View File

@ -0,0 +1,7 @@
<svg width="49" height="49" viewBox="0 0 49 49" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="24.5" cy="24.5" r="24.5" fill="#CDCDCD"/>
<path d="M34.625 24.75L21.5 24.75" stroke="#141414" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M34.625 21L34.625 24.75" stroke="#141414" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M29.9375 21L29.9375 24.75" stroke="#141414" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="3.75" cy="3.75" r="3.75" transform="matrix(-1 0 0 1 21.5 21)" stroke="#141414" stroke-width="3"/>
</svg>

After

Width:  |  Height:  |  Size: 621 B

View File

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="16" fill="#00FF66"/>
<path d="M12.4385 15.5L14.7344 17.796L19.3262 13.2041" stroke="#141414" stroke-width="1.89796" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 301 B