From c430b5cc0a0a355cdcce9f73f2444a6b63b7da40 Mon Sep 17 00:00:00 2001 From: Reboot-Codes Date: Tue, 3 Jun 2025 15:36:25 -0700 Subject: [PATCH] Styling --- toolbox/ratchet/src/main.rs | 1 + .../ratchet/src/screens/configurator/mod.rs | 40 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/toolbox/ratchet/src/main.rs b/toolbox/ratchet/src/main.rs index 29cda16..1262f3a 100644 --- a/toolbox/ratchet/src/main.rs +++ b/toolbox/ratchet/src/main.rs @@ -46,6 +46,7 @@ pub fn main() -> iced::Result { .init(); iced::application(APP_NAME, MainAppState::update, MainAppState::view) + .font(iced_fonts::REQUIRED_FONT_BYTES) .theme(theme) .run() } diff --git a/toolbox/ratchet/src/screens/configurator/mod.rs b/toolbox/ratchet/src/screens/configurator/mod.rs index 7802591..4a80b13 100644 --- a/toolbox/ratchet/src/screens/configurator/mod.rs +++ b/toolbox/ratchet/src/screens/configurator/mod.rs @@ -1,7 +1,10 @@ use iced::{ + Border, Element, + Padding, Task, Theme, + border::Radius, widget::{ button, column, @@ -12,6 +15,8 @@ use iced::{ vertical_space, }, }; +use iced_aw::badge; +use log::debug; use crate::{ Message, @@ -57,6 +62,20 @@ impl ConfiguratorScreen { pub fn view(&self, _state: &crate::MainAppState) -> iced::Element { let mut elements: Vec> = vec![]; let sidebar = vec![ + column(vec![ + text("$ConnectionName").size(24).into(), + badge("Connected") + .style(iced_aw::style::badge::success) + .into(), + ]) + .spacing(12) + .padding(Padding { + top: 0.0, + bottom: 12.0, + left: 0.0, + right: 0.0, + }) + .into(), button("Overview") .on_press_maybe({ if self.tab != ConfiguratorTab::Overview { @@ -107,15 +126,19 @@ impl ConfiguratorScreen { match self.tab { ConfiguratorTab::Overview => { + debug!("Overview Tab"); content.push(text("Overview").into()); } ConfiguratorTab::Modules => { + debug!("Modules Tab"); content.push(text("Modules").into()); } ConfiguratorTab::Apps => { + debug!("Apps Tab"); content.push(text("Apps").into()); } ConfiguratorTab::Repos => { + debug!("Repos Tab"); content.push(text("Repositories").into()); } } @@ -131,7 +154,12 @@ impl ConfiguratorScreen { .style(|theme: &Theme| { let palette = theme.extended_palette(); - iced::widget::container::Style::default().background(palette.primary.base.text) + iced::widget::container::Style::default() + .background(palette.primary.base.text) + .border(Border { + radius: Radius::from(12), + ..Default::default() + }) }) .into(), ); @@ -139,8 +167,13 @@ impl ConfiguratorScreen { scrollable( column(content) .width(iced::Length::Fill) - .spacing(12) - .padding(12), + .padding(Padding { + left: 6.0, + right: 0.0, + top: 0.0, + bottom: 0.0, + }) + .spacing(12), ) .width(iced::Length::Fill) .into(), @@ -150,6 +183,7 @@ impl ConfiguratorScreen { row(elements) .height(iced::Length::Fill) .width(iced::Length::Fill) + .padding(6) .into(), ]) .into() -- 2.51.2