back_overlay first

This commit is contained in:
micialware committed 2026-08-01 17:23:43 +03:00
1 parent 4d6de8a02c
commit 9a1d68aac1
2 files changed
+40 -28

No files matched your search

+19 -1
View File
@@ -1,8 +1,11 @@
use iced::border::Radius;
use iced::Element;
use iced::widget::button::{primary, Status};
use iced::widget::{button, container};
use crate::repetitions::Style;
use iced_core::{Border, Theme};
use iced_core::alignment::Horizontal::Left;
use iced_core::Length::Fill;
pub const DEFAULT_SPACING: f32 = 16.0;
pub const ACCENT_FONT_SIZE: f32 = 22.0;
@@ -19,3 +22,18 @@ pub fn jl_button(theme: &Theme, status: Status) -> Style {
style
}
pub fn back_overlay<'a, T: Clone + 'a>(content: Element<'a, T>, back_message: T) -> Element<'a, T> {
container(
iced::widget::column![
button("Назад")
.style(jl_button)
.on_press(back_message),
content
]
.align_x(Left)
.width(Fill),
)
.center_x(Fill)
.padding(10)
.into()
}