frontend: main: the advotracker frontend entry function
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
52
frontend/src/main.rs
Normal file
52
frontend/src/main.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
use orbtk::prelude::*;
|
||||
use orbtk::theme::DEFAULT_THEME_CSS;
|
||||
//use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
|
||||
|
||||
pub mod base_state;
|
||||
pub mod data;
|
||||
pub mod keys;
|
||||
pub mod main_view;
|
||||
|
||||
// validation check of a policy data element given by its poliy code
|
||||
pub mod policycheck_view;
|
||||
pub mod policycheck_state;
|
||||
|
||||
// manage list of policy data structures
|
||||
pub mod policylist_view;
|
||||
pub mod policylist_state;
|
||||
|
||||
//#[cfg(feature = "light-theme")]
|
||||
static WIDGET_EXT: &'static str = include_str!("../resources/stylesheets/policyholder_check.css");
|
||||
|
||||
fn get_theme() -> ThemeValue {
|
||||
//ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
|
||||
ThemeValue::create_from_css(DEFAULT_THEME_CSS)
|
||||
.extension_css(WIDGET_EXT)
|
||||
.build()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Application::from_name("rzerres.advotracker")
|
||||
.window(move |ctx| {
|
||||
Window::new()
|
||||
//.title("OrbTk - Policyholder checker example")
|
||||
.title("AdvoTracker - Versicherungsnummern")
|
||||
.position((-500.0, -100.0))
|
||||
.size(480.0, 260.0)
|
||||
.min_width(460.0)
|
||||
.min_height(180.0)
|
||||
.resizeable(true)
|
||||
.theme(get_theme())
|
||||
.child(main_view::MainView::new().build(ctx))
|
||||
.build(ctx)
|
||||
})
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user