aboutsummaryrefslogtreecommitdiff
path: root/gui/include/turn_order_view.hpp
blob: 9a7ede66da5beebb902871967f18dcaa874fd309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com>
 * SPDX-License-Identifier: LGPL-2.1-only
 */

#ifndef TURNS_UI_TURN_ORDER_VIEW_HPP
#define TURNS_UI_TURN_ORDER_VIEW_HPP

#include "turns/core/fwd.hpp"
#include "turns/core/turn_order_model.hpp"
#include "turns/ui/template_widget.hpp"

#include <glibmm/object.h>
#include <glibmm/refptr.h>

#include <gtkmm/box.h>
#include <gtkmm/listbox.h>
#include <gtkmm/progressbar.h>
#include <gtkmm/widget.h>

#include <array>

namespace turns::ui
{
  struct TurnOrderView : template_widget<TurnOrderView, Gtk::Box>
  {
    using model_type = core::TurnOderModel;

    auto constexpr inline static children = std::array{
        "progress",
        "view",
    };

    explicit TurnOrderView(Glib::RefPtr<model_type> model = {});

  private:
    auto handle_create_row(Glib::RefPtr<Glib::Object> const item) -> Gtk::Widget *;

    Glib::RefPtr<model_type> m_model;
    Gtk::ProgressBar * m_progress;
    Gtk::ListBox * m_view;
  };
}  // namespace turns::ui::widgets

#endif