* orbtk code to handle a menu structure Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
73 lines
1.3 KiB
Rust
73 lines
1.3 KiB
Rust
use orbtk::prelude::*;
|
|
//use orbtk::theme::vector_graphics::material_icons_font;
|
|
|
|
//use crate::keys::*;
|
|
|
|
//pub struct PolicyMenu {
|
|
// pub isvalid: bool
|
|
//}
|
|
|
|
widget!(
|
|
PolicyCheckMenu {
|
|
isvalid: String
|
|
}
|
|
);
|
|
|
|
impl Template for PolicyCheckMenu {
|
|
fn template(self, _id: Entity, ctx: &mut BuildContext) -> Self {
|
|
self.name("PolicyCheckMenu").child(
|
|
Stack::new()
|
|
.orientation("vertical")
|
|
.spacing(8.0)
|
|
.h_align("center")
|
|
.child(
|
|
Stack::new()
|
|
.orientation("horizontal")
|
|
.spacing(4.0)
|
|
.h_align("start")
|
|
.child(
|
|
Button::new()
|
|
.element("button-user")
|
|
.icon("")
|
|
.min_width(32.0)
|
|
.max_width(32.0)
|
|
.build(ctx),
|
|
)
|
|
.child(
|
|
TextBlock::new()
|
|
.element("menu-user")
|
|
.min_width(80.0)
|
|
.max_width(180.0)
|
|
.text("angemeldeter Benutzer")
|
|
.build(ctx),
|
|
)
|
|
.build(ctx),
|
|
)
|
|
.child(
|
|
Stack::new()
|
|
.orientation("horizontal")
|
|
.spacing(4.0)
|
|
.h_align("start")
|
|
.child(
|
|
Button::new()
|
|
.element("button-user")
|
|
.icon("")
|
|
.min_width(32.0)
|
|
.max_width(32.0)
|
|
.build(ctx),
|
|
)
|
|
.child(
|
|
TextBlock::new()
|
|
.element("menu-quit")
|
|
.min_width(80.0)
|
|
.max_width(180.0)
|
|
.text("Quit")
|
|
.build(ctx),
|
|
)
|
|
.build(ctx),
|
|
)
|
|
.build(ctx)
|
|
)
|
|
}
|
|
}
|