policycheck: update styling, constants and localization

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-09-28 13:06:50 +02:00
parent e297c82b85
commit d2a188eee6
7 changed files with 250 additions and 146 deletions

View File

@@ -11,16 +11,19 @@ Dictionary (
// like a struct, but keys are also values instead of just beenig identifiers // like a struct, but keys are also values instead of just beenig identifiers
words: { words: {
// policycheck_view // policycheck_view
"Policy number validation": "Versicherungsnummern Prüfung", "Validation policy number": "Prüfung Versicherungsnummer",
"Policy number": "Versicherungsnummer", "Policy number": "Versicherungsnummer",
"Policy code": "ID der Vers.-Nummer",
"Checklist elements: ": "Prüflistenelemente: ", "Checklist elements: ": "Prüflistenelemente: ",
"Check result": "Prüfungsergebnis", "Check result": "Prüfungsergebnis",
"Importing data": "Importiere Datensätze", "Importing data": "Importiere Datensätze",
"Processing time": "Bearbeitungszeit", "Processing time": "Bearbeitungszeit",
"Error:": "Fehler:",
"Reason": "Grund",
"Policy number is to long": "Die Nummer ist zu lang", "Policy number is to long": "Die Nummer ist zu lang",
"Policy number is to short": "Die Nummer ist zu kurz", "Policy number is to short": "Die Nummer ist zu kurz",
"The given policy number is invalid": "Die Versicherungsnumber ist ungültig", "The given policy number is invalid": "Die Versicherungsnummer ist ungültig",
"The given policy number is valid": "Die Versicherungsnumber ist gültig", "The given policy number is valid": "Die Versicherungsnummer ist gültig",
"Only numbers are valid": "Nur Nummern sind zulässig", "Only numbers are valid": "Nur Nummern sind zulässig",
// localization // localization
"Hello": "Hallo", "Hello": "Hallo",

View File

@@ -1,113 +1,122 @@
Theme ( Theme (
styles: { styles: {
"button_menu": ( "button_menu": (
base: "menu", base: "menu",
properties: { properties: {
"background": "transparent", "background": "transparent",
//"background": "$GOLDEN_DREAM", //"background": "$GOLDEN_DREAM",
//"background": "$LINK_WATER", //"background": "$LINK_WATER",
//"border_brush": "$LINK_WATER", //"border_brush": "$LINK_WATER",
//"border_brush": "$GOLDEN_DREAM", //"border_brush": "$GOLDEN_DREAM",
"border_radius": 0, "border_radius": 0,
"border_width": 0, "border_width": 0,
//"foreground": "$BRIGHT_GRAY", //"foreground": "$BRIGHT_GRAY",
//"icon_brush": "$BRIGHT_GRAY", //"icon_brush": "$BRIGHT_GRAY",
"font_size": "$ICON_SIZE_16", "font_size": "$ICON_SIZE_16",
"h_align": "left", "h_align": "left",
//"height": 14, //"height": 14,
"margin": (0, 4, 0, 0), "margin": (0, 4, 0, 0),
//"padding": (8, 0, 8, 0), //"padding": (8, 0, 8, 0),
}, },
), ),
"container_menu": ( "container_menu": (
properties: { properties: {
"border_radius": 0, "border_radius": 0,
"border_width": 1, "border_width": 1,
"background": "$BRIGHT_GRAY", "background": "$BRIGHT_GRAY",
"border_brush": "$LINK_WATER", "border_brush": "$LINK_WATER",
//"border_brush": "$GOLDEN_DREAM", //"border_brush": "$GOLDEN_DREAM",
"padding": 4, "padding": 4,
}, },
), ),
"container_progress": ( "container_progress": (
properties: { properties: {
"border_radius": 3, "border_radius": 3,
"border_width": 1, "border_width": 1,
"background": "$BRIGHT_GRAY", "background": "$BRIGHT_GRAY",
"border_brush": "$LINK_WATER", "border_brush": "$LINK_WATER",
//"border_brush": "$GOLDEN_DREAM", //"border_brush": "$GOLDEN_DREAM",
"padding": 14, "padding": 14,
"h_align": "end" "h_align": "end"
}, },
), ),
"container_form": ( "container_form": (
base: "container", base: "container",
properties: { properties: {
"background": "$BRIGHT_GRAY", "background": "$BRIGHT_GRAY",
"border_brush": "$LINK_WATER", "border_brush": "$LINK_WATER",
"border_radius": 3, "border_radius": 3,
"border_width": 1, "border_width": 1,
"padding": 14, "padding": 14,
"v_align": "top", "v_align": "top",
}, },
), ),
"header_bar": ( "header_bar": (
base: "header", base: "header",
properties: { properties: {
"foreground": "$LINK_WATER", "foreground": "$LINK_WATER",
}, },
), ),
"menu": ( "hint": (
//base: "base", base: "body",
properties: { properties: {
"font_size": 16, "font_size": 11,
"font_family": "$MEDIUM_FONT", "font_family": "$MEDIUM_FONT",
"background": "$BLACK", "width": "250",
"opacity": 1, "min_width": "250"
}, },
states: { ),
"pressed": { "menu": (
"background": "$WHITE", //base: "base",
}, properties: {
}, "font_size": 16,
), "font_family": "$MEDIUM_FONT",
"popup_progress": ( "background": "$BLACK",
base: "popup", "opacity": 1,
properties: { },
//"h_align": "center", states: {
"width": 300, "pressed": {
"heigth": 120, "background": "$WHITE",
}, },
), },
"stack_menu": ( ),
properties: { "popup_progress": (
//"background": "transparent", base: "popup",
"spacing": 2, properties: {
"orientation": "vertical", //"h_align": "center",
"h_align": "left", "width": 300,
}, "heigth": 120,
), },
"stack_progress": ( ),
properties: { "stack_menu": (
//"background": "transparent", properties: {
"spacing": 8, //"background": "transparent",
"margin": (16, 16, 16, 16), "spacing": 2,
}, "orientation": "vertical",
), "h_align": "left",
"textblock": ( },
//base: "base", ),
properties: { "stack_progress": (
"font_size": "$ICON_SIZE_12", properties: {
}, //"background": "transparent",
), "spacing": 8,
"textblock_progress": ( "margin": (16, 16, 16, 16),
base: "textblock", },
properties: { ),
//"background": "transparent", "textblock": (
//"font_size": 12, //base: "base",
"h_align": "center", properties: {
"v_align": "center", "font_size": "$ICON_SIZE_12",
}, },
), ),
"textblock_progress": (
base: "textblock",
properties: {
//"background": "transparent",
//"font_size": 12,
"h_align": "center",
"v_align": "center",
},
),
} }
) )

View File

@@ -219,9 +219,14 @@ impl PolicyCheckState {
// Parse policy code: "AS-123456789" // Parse policy code: "AS-123456789"
// DION VERS POLLFNR // DION VERS POLLFNR
// 1 AS 1515735810 // 1 AS 1515735810
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed); //Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
//Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), Visibility::Collapsed);
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Collapsed);
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Collapsed);
Button::background_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("transparent")); Button::background_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("transparent"));
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Collapsed); //Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Collapsed);
if policy_number_length == 10 { if policy_number_length == 10 {
// cast policy_number_sting to <u64> // cast policy_number_sting to <u64>
@@ -235,60 +240,92 @@ impl PolicyCheckState {
// matching key, get associated value // matching key, get associated value
trace!(target: "advotracker", state = "success", trace!(target: "advotracker", state = "success",
policy_number = ?p, policy_code = ?policy_code); policy_number = ?p, policy_code = ?policy_code);
let string_result = format!("1-{:?}-{}", let string_result = format!("1-{:?}-{}",
policy_code, p); policy_code, p);
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from(string_result)); TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from(string_result));
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#008000"));
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000")); Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000"));
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000")); Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#008000"));
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CHECK); Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CHECK);
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible); Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
} }
_ => { _ => {
// no matching key // no matching key
let res = t!("policy.validation.failed", self.lang); let res = t!("policy.validation.failed", self.lang);
trace!(target: "advotracker", state = ?res, policy_number = ?p); trace!(target: "advotracker", state = ?res, policy_number = ?p);
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible); TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("The given policy number is invalid")); TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("The given policy number is invalid"));
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR); Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible); Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
} }
} }
}, },
Err(e) => { Err(e) => {
trace!(target: "advotracker", state = "error", error_type = "invalid type", error = ?e); trace!(target: "advotracker", state = "error", error_type = "invalid type", error = ?e);
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true); TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Only numbers are valid"));
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Only numbers are valid"));
//TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR); Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible); Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
} }
} }
} }
if policy_number_length < 10 { if policy_number_length < 10 {
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true); let res = t!("policy.validation.failed", self.lang);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Policy number is to short")); trace!(target: "advotracker", state = ?res, reason = "number to short");
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Policy number is to short"));
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR); Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible); Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
} }
if policy_number_length > 10 { if policy_number_length > 10 {
TextBlock::enabled_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), true); let res = t!("policy.validation.failed", self.lang);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_RESULT), String::from("Policy number is to long")); trace!(target: "advotracker", state = ?res, reason = "number to long");
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Visible);
TextBox::foreground_set(&mut ctx.child(ID_POLICY_CHECK_POLICY_NUMBER), String::from("#FF0000"));
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_HINT), Visibility::Visible);
TextBlock::text_set(&mut ctx.child(ID_POLICY_CHECK_HINT), String::from("Policy number is to long"));
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_HINT), Visibility::Visible);
Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::icon_brush_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000")); Button::foreground_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), String::from("#FF0000"));
Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR); Button::icon_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), material_icons_font::MD_CLEAR);
Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible); Button::visibility_set(&mut ctx.child(ID_POLICY_CHECK_BUTTON_RESULT), Visibility::Visible);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Visible);
} }
trace!(target: "advotracker", parse_entry = "finished"); trace!(target: "advotracker", parse_entry = "finished");
@@ -427,8 +464,11 @@ impl State for PolicyCheckState {
.entity_of_child(ID_POLICY_CHECK_LABEL_RESULT) .entity_of_child(ID_POLICY_CHECK_LABEL_RESULT)
.expect("PolicyCheckState.init: Can't find resource entity 'ID_POLICY_CHECK_LABEL_RESULT'."); .expect("PolicyCheckState.init: Can't find resource entity 'ID_POLICY_CHECK_LABEL_RESULT'.");
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed); //TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed); //TextBlock::visibility_set(&mut ctx.child(ID_POLICY_CHECK_LABEL_RESULT), Visibility::Collapsed);
//Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_0), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_1), Visibility::Collapsed);
Stack::visibility_set(&mut ctx.child(ID_POLICY_CHECK_FORM_ROW_2), Visibility::Collapsed);
// Preset localization with given environment lang // Preset localization with given environment lang
self.lang = PolicyCheckState::get_lang(); self.lang = PolicyCheckState::get_lang();

View File

@@ -16,11 +16,16 @@ pub static STYLE_STACK_MENU: &'static str = "stack_menu";
// Widget IDs (DCES: Entity[id] => [Component1, .. , Component<n>] -> data or state) // Widget IDs (DCES: Entity[id] => [Component1, .. , Component<n>] -> data or state)
pub static ID_POLICY_CHECK_FORM: &'static str = "policy_check_form"; pub static ID_POLICY_CHECK_FORM: &'static str = "policy_check_form";
pub static ID_POLICY_CHECK_FORM_ROW_0: &'static str = "policy_check_form_row_0";
pub static ID_POLICY_CHECK_FORM_ROW_1: &'static str = "policy_check_form_row_1";
pub static ID_POLICY_CHECK_FORM_ROW_2: &'static str = "policy_check_form_row_2";
pub static ID_POLICY_CHECK_HEADER: &'static str = "policy_check_header"; pub static ID_POLICY_CHECK_HEADER: &'static str = "policy_check_header";
pub static ID_POLICY_CHECK_ITEMS_WIDGET: &'static str = "policy_check_items_widget"; pub static ID_POLICY_CHECK_ITEMS_WIDGET: &'static str = "policy_check_items_widget";
pub static ID_POLICY_CHECK_BUTTON_RESULT: &'static str = "policy_check_button_result"; pub static ID_POLICY_CHECK_BUTTON_RESULT: &'static str = "policy_check_button_result";
pub static ID_POLICY_CHECK_BUTTON_MENU: &'static str = "policy_check_button_menu"; pub static ID_POLICY_CHECK_BUTTON_MENU: &'static str = "policy_check_button_menu";
pub static ID_POLICY_CHECK_DATA_COUNT_BLOCK: &'static str = "policy_check_data_count_block"; pub static ID_POLICY_CHECK_DATA_COUNT_BLOCK: &'static str = "policy_check_data_count_block";
pub static ID_POLICY_CHECK_HINT: &'static str = "policy_check_hint";
pub static ID_POLICY_CHECK_LABEL_HINT: &'static str = "policy_check_label_hint";
pub static ID_POLICY_CHECK_LABEL_MENU: &'static str = "policy_check_label_menu"; pub static ID_POLICY_CHECK_LABEL_MENU: &'static str = "policy_check_label_menu";
pub static ID_POLICY_CHECK_LABEL_POLICY_NUMBER: &'static str = "policy_check_label_policy_number"; pub static ID_POLICY_CHECK_LABEL_POLICY_NUMBER: &'static str = "policy_check_label_policy_number";
pub static ID_POLICY_CHECK_LABEL_RESULT: &'static str = "policy_check_label_result"; pub static ID_POLICY_CHECK_LABEL_RESULT: &'static str = "policy_check_label_result";

View File

@@ -96,7 +96,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
trace!(target: "advotracker", environment = "system", lang = ?lang); trace!(target: "advotracker", environment = "system", lang = ?lang);
trace!(target: "advotracker", machine = ?&machine_kind); trace!(target: "advotracker", machine = ?&machine_kind);
// how to handle unumplemented lang resources?? // how to handle unimplemented lang resources??
res = t!("parse.environment", lang); res = t!("parse.environment", lang);
trace!(target: "advotracker", environment = "envy", lang = ?lang); trace!(target: "advotracker", environment = "envy", lang = ?lang);
state = t!("state.finished", lang); state = t!("state.finished", lang);

View File

@@ -58,7 +58,7 @@ impl Template for PolicyCheckView {
.v_align("end") .v_align("end")
.child( .child(
TextBlock::new() TextBlock::new()
.margin((0, 9, 16, 0)) .margin((0, 9, 48, 0))
.text("©Networkx GmbH") .text("©Networkx GmbH")
.build(ctx) .build(ctx)
) )
@@ -111,7 +111,7 @@ impl Template for PolicyCheckView {
.id(ID_POLICY_CHECK_HEADER) .id(ID_POLICY_CHECK_HEADER)
.v_align("center") .v_align("center")
.h_align("left") .h_align("left")
.text("Policy number validation") .text("Validation policy number")
.build(ctx), .build(ctx),
) )
.build(ctx), .build(ctx),
@@ -120,11 +120,14 @@ impl Template for PolicyCheckView {
.build(ctx); .build(ctx);
let policy_check_form_row_0 = Stack::new() let policy_check_form_row_0 = Stack::new()
// 1st row
.id(ID_POLICY_CHECK_FORM_ROW_0)
.attach(Grid::row(0)) .attach(Grid::row(0))
.attach(Grid::column(0)) .attach(Grid::column(0))
.attach(Grid::column_span(5)) .attach(Grid::column_span(5))
.orientation("horizontal") .orientation("horizontal")
.v_align("center") .v_align("center")
//.h_align("center")
.child( .child(
TextBlock::new() TextBlock::new()
.id(ID_POLICY_CHECK_LABEL_POLICY_NUMBER) .id(ID_POLICY_CHECK_LABEL_POLICY_NUMBER)
@@ -134,6 +137,8 @@ impl Template for PolicyCheckView {
.margin((0, 0, 16, 0)) .margin((0, 0, 16, 0))
.h_align("end") .h_align("end")
.v_align("center") .v_align("center")
.width(300)
.min_width(300)
.text("Policy number") .text("Policy number")
.build(ctx), .build(ctx),
) )
@@ -182,12 +187,13 @@ impl Template for PolicyCheckView {
let policy_check_form_row_1 = Stack::new() let policy_check_form_row_1 = Stack::new()
// 2nd row // 2nd row
.id(ID_POLICY_CHECK_FORM_ROW_1)
.attach(Grid::row(1)) .attach(Grid::row(1))
.attach(Grid::column(0)) .attach(Grid::column(0))
.attach(Grid::column_span(5)) .attach(Grid::column_span(5))
.orientation("horizontal") .orientation("horizontal")
//.visibility(Visibility::Collapsed)
.v_align("center") .v_align("center")
//.h_align("center")
.child( .child(
TextBlock::new() TextBlock::new()
.id(ID_POLICY_CHECK_LABEL_RESULT) .id(ID_POLICY_CHECK_LABEL_RESULT)
@@ -197,9 +203,9 @@ impl Template for PolicyCheckView {
.margin((0, 0, 16, 0)) .margin((0, 0, 16, 0))
.h_align("end") .h_align("end")
.v_align("center") .v_align("center")
.width(250) .width(300)
.min_width(250) .min_width(300)
.text("Check result") .text("Policy code")
.build(ctx), .build(ctx),
) )
.child( .child(
@@ -214,35 +220,78 @@ impl Template for PolicyCheckView {
) )
.build(ctx); .build(ctx);
let policy_check_form_row_2 = Stack::new()
// 3nd row
.id(ID_POLICY_CHECK_FORM_ROW_2)
.attach(Grid::row(2))
.attach(Grid::column(0))
.attach(Grid::column_span(5))
.orientation("horizontal")
.v_align("center")
.h_align("center")
.child(
TextBlock::new()
.id(ID_POLICY_CHECK_LABEL_HINT)
//.style("hint")
.attach(Grid::row(2))
.attach(Grid::column(0))
.margin((0, 0, 16, 0))
.h_align("end")
.v_align("center")
.width(300)
.min_width(300)
.font_size(11.)
.text("Error:")
.build(ctx),
)
.child(
TextBlock::new()
.id(ID_POLICY_CHECK_HINT)
//.style("hint")
.attach(Grid::row(2))
.attach(Grid::column(2))
.h_align("start")
.v_align("center")
.font_size(11)
.build(ctx)
)
.build(ctx);
let policy_check_form = Container::new() let policy_check_form = Container::new()
.id(ID_POLICY_CHECK_FORM)
.min_width(420)
.attach(Grid::row(2)) .attach(Grid::row(2))
.attach(Grid::column(1)) .attach(Grid::column(1))
.style("container_form") .style("container_form")
.child( .child(
Grid::new() Grid::new()
.id(ID_POLICY_CHECK_FORM) .id(ID_POLICY_CHECK_FORM)
.width(450)
.min_width(400)
.columns( .columns(
Columns::create() Columns::create()
// Labels // Label
.push("250") .push("300")
// Seperator // Seperator
.push("16") .push("16")
// Values // Values
.push("100") .push("auto")
// Seperator // Seperator
.push("16") .push("16")
// Result-Button // Result-Button
.push("32") .push("32")
.build(), //.build(),
) )
.rows( .rows(
Rows::create() Rows::create()
.push("auto") .push("auto")
.push("auto") .push("auto")
.build(), .push("*")
//.build(),
) )
.child(policy_check_form_row_0) .child(policy_check_form_row_0)
.child(policy_check_form_row_1) .child(policy_check_form_row_1)
.child(policy_check_form_row_2)
.build(ctx), .build(ctx),
) )
.build(ctx); .build(ctx);
@@ -284,7 +333,6 @@ impl Template for PolicyCheckView {
.margin((0, 4, 0, 0)) .margin((0, 4, 0, 0))
.enabled(true) .enabled(true)
.text("Checklist elements: ") .text("Checklist elements: ")
//.visibility(Visibility::Collapsed)
.build(ctx) .build(ctx)
) )
.child( .child(
@@ -293,7 +341,6 @@ impl Template for PolicyCheckView {
.margin((0, 4, 0, 0)) .margin((0, 4, 0, 0))
.enabled(true) .enabled(true)
.text("0") .text("0")
//.visibility(Visibility::Collapsed)
.build(ctx) .build(ctx)
) )
.build(ctx); .build(ctx);
@@ -310,7 +357,7 @@ impl Template for PolicyCheckView {
.push(50) .push(50)
.push("*") .push("*")
.push(50) .push(50)
.build(), //.build(),
) )
.rows( .rows(
Rows::create() Rows::create()
@@ -319,7 +366,7 @@ impl Template for PolicyCheckView {
.push("*") .push("*")
.push("auto") .push("auto")
.push("auto") .push("auto")
.build(), //.build(),
) )
// row 0: Policy Check Header // row 0: Policy Check Header