bin: policycheck: simplified core to check policy number

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-07-22 18:10:51 +02:00
parent 0f97202fbb
commit 276c0fb5f0

View File

@@ -1,16 +1,17 @@
use orbtk::prelude::*;
use orbtk::theme::DEFAULT_THEME_CSS;
// use orbtk::theme::DEFAULT_THEME_CSS;
// use orbtk::theme::LIGHT_THEME_EXTENSION_CSS;
//#[cfg(feature = "light-theme")]
static WIDGET_EXT: &'static str = include_str!("../../resources/stylesheets/policyholder_check.css");
// //#[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 get_theme() -> ThemeValue {
// //ThemeValue::create_from_css(LIGHT_THEME_EXTENSION_CSS)
// ThemeValue::create_from_css(DEFAULT_THEME_CSS)
// .extension_css(WIDGET_EXT)
// .build()
// }
#[derive(Debug, Copy, Clone)]
enum Action {
@@ -84,8 +85,8 @@ impl State for MainViewState {
fn create_header(ctx: &mut BuildContext, text: &str) -> Entity {
TextBlock::new()
.text(text)
.element("text-block")
.class("h1")
//.element("text-block")
.style("header")
.build(ctx)
}
@@ -124,7 +125,7 @@ impl Template for MainView {
)
.child(
Grid::new()
.element("policyholder_check")
//.element("policyholder_check")
.margin((4.0, 24.0, 24.0, 4.0))
.min_width(180.0)
.min_height(80.0)
@@ -165,7 +166,7 @@ impl Template for MainView {
)
.child(
TextBlock::new()
.element("text-block")
//.element("text-block")
.id("result")
.min_width(80.0)
.max_width(180.0)
@@ -179,7 +180,7 @@ impl Template for MainView {
)
.child(
Grid::new()
.element("logo_customer")
//.element("logo_customer")
.margin((9.0, 16.0, 16.0, 9.0))
.attach(Grid::column(0))
.attach(Grid::row(1))
@@ -193,7 +194,7 @@ impl Template for MainView {
)
.child(
Grid::new()
.element("logo_vendor")
//.element("logo_vendor")
.margin((9.0, 16.0, 16.0, 9.0))
.attach(Grid::column(2))
.attach(Grid::row(1))
@@ -222,7 +223,7 @@ fn main() {
.min_width(460.0)
.min_height(180.0)
.resizeable(true)
.theme(get_theme())
//.theme(get_theme())
.child(MainView::new().build(ctx))
.build(ctx)
})