widgets: update policycheck_view

* update margins
* add widget IDs
* experimental inclusion of a progress bar

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-07-10 20:38:38 +02:00
parent e2ced73db9
commit 193f2de7ea

View File

@@ -30,6 +30,7 @@ widget!(
impl Template for PolicyCheckView {
fn template(self, id: Entity, ctx: &mut BuildContext<'_>) -> Self {
let policy_check_menu_text_block = TextBlock::new()
.id(ID_POLICY_CHECK_TEXT_BLOCK_MENU)
.foreground("#3b434a")
.text("Help Menu")
.v_align("center")
@@ -188,16 +189,19 @@ impl Template for PolicyCheckView {
ctx.get_mut::<PolicyCheckState>(id)
.action(Action::ParseEntry(entity));
})
.on_changed(move |ctx, entity| {
// Element value has changed
ctx.get_mut::<PolicyCheckState>(id)
.action(Action::InputTextChanged(entity));
ctx.get_mut::<PolicyCheckState>(id)
.action(Action::SetVisibility(entity));
//ctx.get_widget(policy_check_label_policy_number).set("visible");
// ctx.get_mut::<PolicyCheckState>(id)
// .action(Action::SetVisility(entity));
})
//.on_changed(move |ctx, entity| {
// ctx.get_mut::<PolicyCheckState>(id)
// .action(Action::SetPopupBox(entity));
// ctx.get_mut::<PolicyCheckState>(id)
// .action(Action::AddProgress(0.5));
// ctx.get_mut::<PolicyCheckState>(id)
// .action(Action::InputTextChanged(entity));
// ctx.get_mut::<PolicyCheckState>(id)
// .action(Action::SetVisibility(entity));
// //ctx.get_widget(policy_check_label_policy_number).set("visible");
// // ctx.get_mut::<PolicyCheckState>(id)
// // .action(Action::SetVisility(entity));
//})
// .on_mouse_down | .on_mouse_move | .on_mouse_up (move |ctx, entity| {
// state(id, states).action(Action::AddItem);
// })