Skip to content

Commit c719d90

Browse files
Misei.Misei.
authored andcommitted
Fix gpui-component init and Root view
1 parent 3d7c46a commit c719d90

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

atem-ui/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ impl Render for AtemUiView {
768768

769769
fn main() {
770770
Application::new().run(|cx: &mut App| {
771+
// Required for gpui-component widgets (e.g. Theme global) to be available.
772+
gpui_component::init(cx);
773+
771774
let bounds = Bounds::centered(None, size(px(720.), px(520.)), cx);
772775
cx.open_window(
773776
WindowOptions {
@@ -778,7 +781,7 @@ fn main() {
778781
let ip_input =
779782
cx.new(|cx| InputState::new(window, cx).default_value("192.168.1.50"));
780783

781-
cx.new(|_| AtemUiView {
784+
let view = cx.new(|_| AtemUiView {
782785
ip_input,
783786
status: ConnectionStatus::Disconnected,
784787
snapshot: None,
@@ -790,7 +793,10 @@ fn main() {
790793
selected_aux_bus: 0,
791794
selected_dsk_key_index: 0,
792795
dsk_rate: 20,
793-
})
796+
});
797+
798+
// gpui-component requires a Root view as the first window layer.
799+
cx.new(|cx| gpui_component::Root::new(view, window, cx))
794800
},
795801
)
796802
.unwrap();

0 commit comments

Comments
 (0)