From 92fc3900c9d3084dd4d0d2386ab4d823e356da20 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 16 Jul 2024 15:59:45 +0200 Subject: app/ui: add basic tracking UI definition As part of #5, this change adds the basic definition of the turn tracking UI. As of now, the UI is not functional due to several missing window actions. Additionally, the UI is not only revealed when a turn order is started (as there is no infrastructure in place to manage the lifecycle of a turn order yet), but when the turn order is not empty. --- app/src/windows/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/src') diff --git a/app/src/windows/main.cpp b/app/src/windows/main.cpp index 04d7329..a532dc0 100644 --- a/app/src/windows/main.cpp +++ b/app/src/windows/main.cpp @@ -26,6 +26,7 @@ namespace turns::app::windows main::main(BaseObjectType * base, Glib::RefPtr const builder) : Gtk::ApplicationWindow{base} , m_adw{ADW_APPLICATION_WINDOW(gobj())} + , m_controls{builder->get_widget("controls")} , m_empty(builder->get_widget("empty")) , m_stack{builder->get_widget("stack")} , m_title(ADW_WINDOW_TITLE(builder->get_widget("title")->gobj())) @@ -40,6 +41,10 @@ namespace turns::app::windows m_clear_action->property_enabled(), Glib::Binding::Flags::SYNC_CREATE); + m_controls_revealed = Glib::Binding::bind_property(m_turn_order->property_n_items(), + m_controls->property_reveal_child(), + Glib::Binding::Flags::SYNC_CREATE); + m_visible_child_widget = Glib::Binding::bind_property(m_turn_order->property_n_items(), m_stack->property_visible_child(), Glib::Binding::Flags::SYNC_CREATE, -- cgit v1.2.3