Small changes

This commit is contained in:
micialware committed 2026-08-04 14:09:40 +03:00
1 parent 64fbfb5a32
commit a222233290
9 files changed
+89 -46

No files matched your search

+10 -2
View File
@@ -1,12 +1,14 @@
use crate::repetitions::Style;
use iced::border::Radius;
use iced::widget::button::{primary, Status};
use iced::widget::button::*;
use iced::widget::{button, container};
use iced::Element;
use iced_core::alignment::Horizontal::Left;
use iced_core::Length::Fill;
use iced_core::{Border, Theme};
pub const HALF_SPACING: f32 = DEFAULT_SPACING / 2.0;
pub const QUARTER_SPACING: f32 = DEFAULT_SPACING / 4.0;
pub const DEFAULT_SPACING: f32 = 16.0;
pub const ACCENT_FONT_SIZE: f32 = 22.0;
pub const BUTTON_RADIUS: f32 = 8.0;
@@ -20,6 +22,12 @@ pub fn jl_button(theme: &Theme, status: Status) -> Style {
};
style
}
pub fn cta_button(theme: &Theme, status: Status) -> Style {
let mut style = secondary(theme, status);
style.border.width = 1.0;
style.border.radius = Radius::new(BUTTON_RADIUS);
style
}
pub fn back_overlay<'a, T: Clone + 'a>(content: Element<'a, T>, back_message: T) -> Element<'a, T> {
container(
@@ -27,7 +35,7 @@ pub fn back_overlay<'a, T: Clone + 'a>(content: Element<'a, T>, back_message: T)
button("Назад").style(jl_button).on_press(back_message),
content
]
.spacing(5)
.spacing(DEFAULT_SPACING)
.align_x(Left)
.width(Fill),
)