Compare commits
3 Commits
3549c1a709
...
c5386eccd5
Author | SHA1 | Date |
---|---|---|
|
c5386eccd5 | |
|
2317bd9b29 | |
|
a0368c1e51 |
|
@ -19,6 +19,7 @@ fn main() -> Result<(), slint::PlatformError> {
|
||||||
|
|
||||||
setup_main_tab(gui_elements_ref.clone(), logic_ref.clone());
|
setup_main_tab(gui_elements_ref.clone(), logic_ref.clone());
|
||||||
setup_file_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();
|
let main_window = main_window_ref.borrow();
|
||||||
main_window.run()
|
main_window.run()
|
||||||
|
@ -101,3 +102,10 @@ fn setup_file_tab(gui_elements_ref: Rc<RefCell<GUIElements>>, logic_ref: Rc<RefC
|
||||||
Ok(())
|
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));
|
||||||
|
}
|
|
@ -57,10 +57,14 @@ export component MainWindow inherits Window {
|
||||||
}
|
}
|
||||||
Tab {
|
Tab {
|
||||||
title: "About";
|
title: "About";
|
||||||
AboutTab {}
|
about_tab := AboutTab {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function set_version(version: string) {
|
||||||
|
about_tab.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
public function change_to_load_file() {
|
public function change_to_load_file() {
|
||||||
file_tab.state = State.ConvertImage;
|
file_tab.state = State.ConvertImage;
|
||||||
tab_widget.current-index = 0;
|
tab_widget.current-index = 0;
|
||||||
|
|
|
@ -1,14 +1,19 @@
|
||||||
import { AboutSlint } from "std-widgets.slint";
|
import { AboutSlint } from "std-widgets.slint";
|
||||||
export component AboutTab {
|
export component AboutTab {
|
||||||
|
in property <string> version;
|
||||||
y: 0px;
|
y: 0px;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
alignment: start;
|
alignment: start;
|
||||||
Text {
|
Text {
|
||||||
font-size: 24pt;
|
font-size: 24pt;
|
||||||
text: "TIM_Tool Version 0.1.0";
|
text: "TIM_Tool Version " + root.version;
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
}
|
}
|
||||||
|
Image {
|
||||||
|
source: @image-url("../assets/TimTool64x64.png");
|
||||||
|
image-rendering: pixelated;
|
||||||
|
}
|
||||||
Text {
|
Text {
|
||||||
font-size: 20pt;
|
font-size: 20pt;
|
||||||
text: "Part of JabyEngine";
|
text: "Part of JabyEngine";
|
||||||
|
|
|
@ -7,7 +7,10 @@ export enum State {
|
||||||
|
|
||||||
component ProjectWidget inherits Rectangle {
|
component ProjectWidget inherits Rectangle {
|
||||||
Text {
|
Text {
|
||||||
text: "!!Planschbecken!!";
|
text: "Projects not supported yet";
|
||||||
|
color: #FF0000;
|
||||||
|
font-size: 30pt;
|
||||||
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,11 +112,11 @@ export component MainTab inherits Rectangle {
|
||||||
|
|
||||||
function update_viewport() {
|
function update_viewport() {
|
||||||
if abs(self.viewport-x) + self.width > self.viewport-width {
|
if abs(self.viewport-x) + self.width > self.viewport-width {
|
||||||
self.viewport-x = 0;
|
self.viewport-x += (self.width + abs(self.viewport-x)) - self.viewport-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if abs(self.viewport-y) + self.height > self.viewport-height {
|
if abs(self.viewport-y) + self.height > self.viewport-height {
|
||||||
self.viewport-y = 0;
|
self.viewport-y += (self.height + abs(self.viewport-y)) - self.viewport-height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue