Various GUI improvements #19

Merged
jaby merged 5 commits from topic/jb/gui-improvements into main 2025-03-12 18:42:19 +00:00
3 changed files with 19 additions and 2 deletions
Showing only changes of commit 2317bd9b29 - Show all commits

View File

@ -19,6 +19,7 @@ fn main() -> Result<(), slint::PlatformError> {
setup_main_tab(gui_elements_ref.clone(), logic_ref.clone());
setup_file_tab(gui_elements_ref.clone(), logic_ref.clone());
setup_about_tab(main_window_ref.clone());
let main_window = main_window_ref.borrow();
main_window.run()
@ -100,4 +101,11 @@ fn setup_file_tab(gui_elements_ref: Rc<RefCell<GUIElements>>, logic_ref: Rc<RefC
main_window.invoke_change_to_main();
Ok(())
});
}
fn setup_about_tab(main_window_ref: Rc<RefCell<MainWindow>>) {
const VERSION: &str = env!("CARGO_PKG_VERSION");
let main_window = main_window_ref.borrow();
main_window.invoke_set_version(SharedString::from(VERSION));
}

View File

@ -57,10 +57,14 @@ export component MainWindow inherits Window {
}
Tab {
title: "About";
AboutTab {}
about_tab := AboutTab {}
}
}
public function set_version(version: string) {
about_tab.version = version;
}
public function change_to_load_file() {
file_tab.state = State.ConvertImage;
tab_widget.current-index = 0;

View File

@ -1,14 +1,19 @@
import { AboutSlint } from "std-widgets.slint";
export component AboutTab {
in property <string> version;
y: 0px;
VerticalLayout {
padding: 8px;
alignment: start;
Text {
font-size: 24pt;
text: "TIM_Tool Version 0.1.0";
text: "TIM_Tool Version " + root.version;
horizontal-alignment: center;
}
Image {
source: @image-url("../assets/TimTool64x64.png");
image-rendering: pixelated;
}
Text {
font-size: 20pt;
text: "Part of JabyEngine";