frontend: update example widgets and linked in resources
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -4,30 +4,46 @@ widget!(MainView);
|
||||
|
||||
impl Template for MainView {
|
||||
fn template(self, _: Entity, ctx: &mut BuildContext) -> Self {
|
||||
let container = Container::create()
|
||||
let container = Container::new()
|
||||
.background("#dfebf5")
|
||||
.width(200.0)
|
||||
.height(200.0)
|
||||
.child(
|
||||
TextBlock::create()
|
||||
TextBlock::new()
|
||||
.foreground("#3b434a")
|
||||
.text("Overlay")
|
||||
.vertical_alignment("center")
|
||||
.horizontal_alignment("center")
|
||||
.text("Overlay 1")
|
||||
.element("h2")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx);
|
||||
|
||||
let container = Container::new()
|
||||
.background("#dffff5")
|
||||
.width(180.0)
|
||||
.height(180.0)
|
||||
.position((250.0, 250.0))
|
||||
.child(
|
||||
TextBlock::new()
|
||||
.foreground("#3f3f3f")
|
||||
.text("Overlay 2")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx);
|
||||
|
||||
ctx.append_child_to_overlay(container).unwrap();
|
||||
self.name("MainView").child(
|
||||
Container::create()
|
||||
Container::new()
|
||||
.background("#e1bc21")
|
||||
.child(
|
||||
TextBlock::create()
|
||||
TextBlock::new()
|
||||
.text("MainView")
|
||||
.element("h1")
|
||||
.vertical_alignment("center")
|
||||
.horizontal_alignment("center")
|
||||
.v_align("center")
|
||||
.h_align("center")
|
||||
.build(ctx),
|
||||
)
|
||||
.build(ctx),
|
||||
@@ -41,7 +57,7 @@ fn main() {
|
||||
|
||||
Application::new()
|
||||
.window(|ctx| {
|
||||
Window::create()
|
||||
Window::new()
|
||||
.title("OrbTk - overlay example")
|
||||
.position((100.0, 100.0))
|
||||
.size(420.0, 730.0)
|
||||
|
||||
Reference in New Issue
Block a user