diff --git a/gui/src/installer/view.rs b/gui/src/installer/view.rs index 2721fe18..ba6ab336 100644 --- a/gui/src/installer/view.rs +++ b/gui/src/installer/view.rs @@ -157,15 +157,20 @@ pub fn define_descriptor<'a>( pick_list(&NETWORKS[..], Some(Network::from(network)), |net| { Message::Network(net.into()) }) - .style(theme::PickList::Simple) + .style(if network_valid { + theme::PickList::Simple + } else { + theme::PickList::Invalid + }) .padding(10), )) .push_maybe(if network_valid { None } else { - Some(card::warning( - "A data directory already exists for this network".to_string(), - )) + Some( + text("A data directory already exists for this network") + .style(color::legacy::ALERT), + ) }) .padding(50); @@ -363,14 +368,20 @@ pub fn import_descriptor<'a>( pick_list(&NETWORKS[..], Some(Network::from(network)), |net| { Message::Network(net.into()) }) + .style(if network_valid { + theme::PickList::Simple + } else { + theme::PickList::Invalid + }) .padding(10), )) .push_maybe(if network_valid { None } else { - Some(card::warning( - "A data directory already exists for this network".to_string(), - )) + Some( + text("A data directory already exists for this network") + .style(color::legacy::ALERT), + ) }); let col_descriptor = Column::new() .push(text("Descriptor:").bold()) @@ -619,14 +630,20 @@ pub fn participate_xpub<'a>( pick_list(&NETWORKS[..], Some(Network::from(network)), |net| { Message::Network(net.into()) }) + .style(if network_valid { + theme::PickList::Simple + } else { + theme::PickList::Invalid + }) .padding(10), )) .push_maybe(if network_valid { None } else { - Some(card::warning( - "A data directory already exists for this network".to_string(), - )) + Some( + text("A data directory already exists for this network") + .style(color::legacy::ALERT), + ) }); layout( diff --git a/gui/ui/src/component/card.rs b/gui/ui/src/component/card.rs index 44c9d1e4..965bed73 100644 --- a/gui/ui/src/component/card.rs +++ b/gui/ui/src/component/card.rs @@ -18,8 +18,8 @@ pub fn warning<'a, T: 'a>(message: String) -> Container<'a, T> { Row::new() .spacing(20) .align_items(iced::Alignment::Center) - .push(icon::warning_octagon_icon().style(color::legacy::WARNING)) - .push(text(message).style(color::legacy::WARNING)), + .push(icon::warning_octagon_icon()) + .push(text(message)), ) .padding(15) .style(theme::Container::Card(theme::Card::Warning)) diff --git a/gui/ui/src/theme.rs b/gui/ui/src/theme.rs index 927bd0ae..fbeabace 100644 --- a/gui/ui/src/theme.rs +++ b/gui/ui/src/theme.rs @@ -50,7 +50,7 @@ impl iced::overlay::menu::StyleSheet for Theme { background: color::LIGHT_GREY.into(), border_width: 1.0, border_radius: 0.0, - border_color: color::GREEN, + border_color: color::LIGHT_GREY, selected_text_color: color::BLACK, selected_background: color::GREEN.into(), } @@ -422,19 +422,31 @@ impl scrollable::StyleSheet for Theme { pub enum PickList { #[default] Simple, + Invalid, } impl pick_list::StyleSheet for Theme { type Style = PickList; - fn active(&self, _style: &Self::Style) -> pick_list::Appearance { - pick_list::Appearance { - placeholder_color: color::legacy::FOREGROUND, - handle_color: color::legacy::FOREGROUND, - background: color::legacy::FOREGROUND.into(), - border_width: 1.0, - border_color: color::legacy::BORDER_GREY, - border_radius: 10.0, - text_color: iced::Color::BLACK, + fn active(&self, style: &Self::Style) -> pick_list::Appearance { + match style { + PickList::Simple => pick_list::Appearance { + placeholder_color: color::legacy::FOREGROUND, + handle_color: color::legacy::FOREGROUND, + background: color::legacy::FOREGROUND.into(), + border_width: 1.0, + border_color: color::legacy::BORDER_GREY, + border_radius: 10.0, + text_color: iced::Color::BLACK, + }, + PickList::Invalid => pick_list::Appearance { + placeholder_color: color::legacy::FOREGROUND, + handle_color: color::legacy::FOREGROUND, + background: color::legacy::FOREGROUND.into(), + border_width: 1.0, + border_color: color::legacy::ALERT, + border_radius: 10.0, + text_color: iced::Color::BLACK, + }, } }