Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
21 changes: 14 additions & 7 deletions crates/crabapi/src/gui/iced/default_styles.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#[allow(unused_imports)]
use iced::{Color, Pixels, Border, Padding, border::Radius};

/// Font size for inputs and buttons
pub const fn input_size_as_f32() -> f32 {
20.0
22.0 // Slightly larger for better readability
}

pub const fn input_size() -> iced::Pixels {
iced::Pixels(input_size_as_f32())
/// Font size wrapper
pub const fn input_size() -> Pixels {
Pixels(input_size_as_f32())
}

pub const fn padding() -> iced::Padding {
iced::Padding::new(10.0)
/// Padding for UI elements
pub const fn padding() -> Padding {
Padding::new(12.0) // Increased padding for better spacing
}

pub const fn spacing() -> iced::Pixels {
iced::Pixels(10.0)
/// Spacing between elements
pub const fn spacing() -> Pixels {
Pixels(12.0)
}
8 changes: 5 additions & 3 deletions crates/crabapi/src/gui/iced/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,10 @@ impl GUI {

fn view_request_row_setup(request_row: Row<'_, Message>) -> Row<'_, Message> {
request_row
.spacing(default_styles::spacing())
.padding(default_styles::padding())
.align_y(Alignment::Center)
.spacing(default_styles::spacing())
.padding(default_styles::padding())
.align_y(Alignment::Center)
.width(Length::Fill) // Stretch the row
}

fn view_request_send_button() -> Element<'static, Message> {
Expand All @@ -268,6 +269,7 @@ impl GUI {
);
column![label, scrollable(body)].into()
}

}

impl Default for GUI {
Expand Down
Loading