blob: 603c6c59b689fd5bbea90d269d182f84fdb5a9fa (
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
46
47
48
49
50
51
52
|
/*
* SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com>
* SPDX-License-Identifier: LGPL-2.1-only
*/
#ifndef TURNS_GUI_TURN_ORDER_VIEW_HPP
#define TURNS_GUI_TURN_ORDER_VIEW_HPP
#include "template_widget.hpp"
#include <turnsmm/turn-order.hpp>
#include <glibmm/object.h>
#include <glibmm/property.h>
#include <glibmm/propertyproxy.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::gui
{
struct TurnOrderView : template_widget<TurnOrderView, Gtk::Box>
{
auto constexpr inline static children = std::array{
"progress",
"view",
};
TurnOrderView();
explicit TurnOrderView(Glib::RefPtr<TurnOrder> const & turn_order);
[[nodiscard]] auto get_turn_order() const -> Glib::RefPtr<TurnOrder>;
auto set_turn_order(Glib::RefPtr<TurnOrder> const & turn_order) -> void;
auto property_turn_order() -> Glib::PropertyProxy<Glib::RefPtr<TurnOrder>>;
auto property_turn_order() const -> Glib::PropertyProxy_ReadOnly<Glib::RefPtr<TurnOrder>>;
private:
auto handle_create_row(Glib::RefPtr<Glib::Object> const item) -> Gtk::Widget *;
Glib::Property<Glib::RefPtr<TurnOrder>> m_turn_order{*this, "turn-order", nullptr};
Gtk::ProgressBar * m_progress{get_widget<Gtk::ProgressBar>("progress")};
Gtk::ListBox * m_view{get_widget<Gtk::ListBox>("view")};
};
} // namespace Turns::gui
#endif
|