Refactor UI components for layout management and results display
- Replaced the `renderizar` function in `layouts.rs` with a new `view` function using Iced for a more modern UI approach. - Introduced a new `view_secao_layouts` function to handle the display of saved layouts. - Updated the `resultado.rs` file to use Iced for rendering the results screen, including buttons for actions and pagination controls. - Created a new `selecionar_aba.rs` file for the selection of XLSX sheet tabs, implementing a preview feature. - Removed old rendering functions and replaced them with Iced components for better performance and maintainability. - Added design tokens in `design_tokens.json` for consistent styling across the application. - Created a mockup HTML file to visualize the UI design.
This commit is contained in:
+8
-35
@@ -7,39 +7,12 @@ mod ui;
|
||||
|
||||
use ui::app::App;
|
||||
|
||||
fn load_icon() -> Option<egui::viewport::IconData> {
|
||||
let bytes = include_bytes!("../icon.ico");
|
||||
let img = image::load_from_memory(bytes).ok()?.into_rgba8();
|
||||
let (width, height) = img.dimensions();
|
||||
Some(egui::viewport::IconData {
|
||||
rgba: img.into_raw(),
|
||||
width,
|
||||
height,
|
||||
})
|
||||
}
|
||||
|
||||
fn main() -> eframe::Result {
|
||||
let mut viewport = egui::ViewportBuilder::default()
|
||||
.with_title("Comparador de Notas")
|
||||
.with_inner_size([1024.0, 768.0])
|
||||
.with_min_inner_size([800.0, 600.0]);
|
||||
|
||||
if let Some(icon) = load_icon() {
|
||||
viewport = viewport.with_icon(std::sync::Arc::new(icon));
|
||||
}
|
||||
|
||||
let native_options = eframe::NativeOptions {
|
||||
viewport,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
eframe::run_native(
|
||||
"Comparador de Notas",
|
||||
native_options,
|
||||
Box::new(|_cc| {
|
||||
let mut app = App::default();
|
||||
app.inicializar();
|
||||
Ok(Box::new(app))
|
||||
}),
|
||||
)
|
||||
fn main() -> iced::Result {
|
||||
iced::application("Comparador de Notas", App::update, App::view)
|
||||
.window(iced::window::Settings {
|
||||
size: iced::Size::new(1024.0, 768.0),
|
||||
min_size: Some(iced::Size::new(800.0, 600.0)),
|
||||
..Default::default()
|
||||
})
|
||||
.run_with(App::new)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user