49 lines
1.3 KiB
Rust
49 lines
1.3 KiB
Rust
// SPDX-License-Identifier: (0BSD or MIT)
|
|
/*
|
|
* OrbTK - The Orbital Widget Toolkit
|
|
*
|
|
* Copyright 2021 Ralf Zerres <ralf.zerres@networkx.de>
|
|
*/
|
|
|
|
use orbtk::prelude::*;
|
|
|
|
use crate::{
|
|
receiver::receiver_view::ReceiverView,
|
|
sender::sender_view::SenderView,
|
|
};
|
|
|
|
// constants
|
|
pub static ID_SENDER_VIEW: &str = "sender_view";
|
|
pub static ID_RECEIVER_VIEW: &str = "receiver_view";
|
|
|
|
widget!(MainView {
|
|
//sender_view: ,
|
|
//receiver_view:
|
|
});
|
|
|
|
impl Template for MainView {
|
|
fn template(self, _id: Entity, ctx: &mut BuildContext<'_>) -> Self {
|
|
let receiver_view = ReceiverView::new()
|
|
.build(ctx);
|
|
|
|
let sender_view = SenderView::new()
|
|
.target(receiver_view.0) // entity of the target
|
|
.build(ctx);
|
|
|
|
self.name("MainView")
|
|
.child(
|
|
Stack::new()
|
|
.orientation("vertical")
|
|
.child(sender_view)
|
|
.child(receiver_view)
|
|
.build(ctx)
|
|
)
|
|
// .child(
|
|
// TabWidget::new()
|
|
// .tab(ID_SENDER_VIEW, SenderView::new().build(ctx))
|
|
// .tab(ID_RECEIVER_VIEW, ReceiverView::new().build(ctx))
|
|
// .build(ctx),
|
|
// )
|
|
}
|
|
}
|