diff --git a/client/src/component/divider.rs b/client/src/component/divider.rs new file mode 100644 index 0000000..02b1f53 --- /dev/null +++ b/client/src/component/divider.rs @@ -0,0 +1,14 @@ +pub fn view() -> iced::Element<'static, crate::Message> { + iced::widget::column![iced::widget::horizontal_rule(1)] + .padding(iced::Padding::from([ + 1. * crate::REM, + 0., + 0.5 * crate::REM, + 0., + ])) + // We're fixing the height here to unitfy it + // with the height of entries for a smooth + // scrolling experience + .height(crate::ENTRY_HEIGHT) + .into() +} diff --git a/client/src/component/mod.rs b/client/src/component/mod.rs index ad0a682..45299c3 100644 --- a/client/src/component/mod.rs +++ b/client/src/component/mod.rs @@ -1,3 +1,4 @@ +pub mod divider; pub mod entry; pub mod plugin_header; pub mod query_input; diff --git a/client/src/main.rs b/client/src/main.rs index 033664a..ad4f3c3 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -273,11 +273,7 @@ impl Application for Centerpiece { } if !divider_added && plugin_to_add.is_some() { - lines = lines.push( - iced::widget::column![iced::widget::horizontal_rule(1)].padding( - iced::Padding::from([1. * crate::REM, 0., 0.5 * crate::REM, 0.]), - ), - ); + lines = lines.push(component::divider::view()); divider_added = true; continue; } @@ -336,7 +332,7 @@ impl Centerpiece { let window = iced::window::Settings { transparent: true, - size: (650, 375), + size: (650, 380), decorations: false, level: iced::window::Level::AlwaysOnTop, resizable: false, @@ -523,6 +519,7 @@ impl Centerpiece { } pub const REM: f32 = 14.0; +pub const ENTRY_HEIGHT: f32 = 2.25 * crate::REM; struct SandboxStyle {} impl iced::application::StyleSheet for SandboxStyle {