Files
comparador-notas/src/ui/components/paginacao.rs
T
FelipeCN ad09c53a5d feat: implement UI redesign for Comparador de Notas
- Introduced a new theme for the application based on dark navy aesthetics.
- Created design tokens for colors, spacings, and border radii.
- Developed a theme module in Rust to manage styles for various UI components.
- Updated multiple screens and components to align with the new design, including cards, buttons, badges, and progress bars.
- Enhanced user experience with improved layouts and visual elements across the application.
2026-03-04 10:58:54 -03:00

32 lines
894 B
Rust

use crate::ui::message::Message;
use crate::ui::theme as t;
use iced::widget::{button, row, text};
use iced::{Alignment, Element};
/// Renderiza controles de paginação reutilizáveis.
pub fn controles_paginacao(
pagina_atual: usize,
total_paginas: usize,
msg_anterior: Message,
msg_proximo: Message,
) -> Element<'static, Message> {
let btn_anterior = button("◀")
.on_press_maybe((pagina_atual > 0).then_some(msg_anterior))
.style(t::btn_ghost);
let btn_proximo = button("▶")
.on_press_maybe((pagina_atual + 1 < total_paginas).then_some(msg_proximo))
.style(t::btn_ghost);
row![
btn_anterior,
text(format!("Página {} / {}", pagina_atual + 1, total_paginas))
.size(13)
.color(t::TEXT_SECONDARY),
btn_proximo,
]
.spacing(8)
.align_y(Alignment::Center)
.into()
}