diff --git a/src/main.rs b/src/main.rs index 2ce4d0c..e07ddbc 100755 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ pub fn main() -> iced::Result { width: 800.0, height: 600.0, }, - resizable: false, + resizable: true, decorations: true, ..window::Settings::default() }, @@ -70,6 +70,7 @@ impl Sandbox for Counter { match message { Message::InputChanged(value) => { self.input_val = value.clone(); + println!("InputChanged: {}", value); if let Ok(value) = value.parse::() { self.value = value; } @@ -90,10 +91,9 @@ impl Sandbox for Counter { } ] .width(Length::Fill) - .padding([55, 0]) + .padding([0, 0]) .align_items(Alignment::Center) .into() - // row![TextInput::new("Search", &self.input_val).on_input(Message::InputChanged)].into() } fn theme(&self) -> Theme { diff --git a/src/search_bar.rs b/src/search_bar.rs index 065c063..3d0d15f 100755 --- a/src/search_bar.rs +++ b/src/search_bar.rs @@ -11,6 +11,7 @@ use crate::{message::Message::*, Counter}; pub fn search_bar(state: &Counter) -> Element { row![TextInput::new("Search", &state.input_val) .on_input(Message::InputChanged) + .padding(Padding::from(15)) .width(300)] .into() } @@ -29,8 +30,8 @@ pub fn tabs(state: &Counter) -> Element { menu_tab_button("Settings", Tab::Settings), ] .padding(10) - .spacing(20) - .width(300) + // .spacing(20) + .width(Length::Fixed(200f32)) .height(Length::Shrink) .into() }