summaryrefslogtreecommitdiff
path: root/ui/src
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-04-29 14:00:29 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-04-29 14:00:29 +0200
commit1d74095f77cc19ba4886d502bbb7a290f9874c9f (patch)
tree720d8627c073ab86ed19649c216e988db3a8efd7 /ui/src
parentef0d0c5bbc4bdbe176a4bc83c352ffa2bd854922 (diff)
downloadturns-1d74095f77cc19ba4886d502bbb7a290f9874c9f.tar.xz
turns-1d74095f77cc19ba4886d502bbb7a290f9874c9f.zip
ui: move UI builder files
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/widgets/participant_row.cpp2
-rw-r--r--ui/src/widgets/participant_row.ui88
-rw-r--r--ui/src/widgets/preferences.cpp2
-rw-r--r--ui/src/widgets/preferences.ui103
-rw-r--r--ui/src/widgets/turn_order_view.cpp2
-rw-r--r--ui/src/widgets/turn_order_view.ui37
-rw-r--r--ui/src/windows/participant_editor.ui70
-rw-r--r--ui/src/windows/tracker.ui152
-rw-r--r--ui/src/windows/tracker/actions.cpp2
9 files changed, 454 insertions, 4 deletions
diff --git a/ui/src/widgets/participant_row.cpp b/ui/src/widgets/participant_row.cpp
index 367870a..6902a1c 100644
--- a/ui/src/widgets/participant_row.cpp
+++ b/ui/src/widgets/participant_row.cpp
@@ -29,7 +29,7 @@ namespace turns::ui::widgets
namespace
{
auto constexpr static TYPE_NAME = "participant_row";
- auto constexpr static TEMPLATE = "/widgets/participant_row.ui";
+ auto constexpr static TEMPLATE = "/ch/arknet/Turns/widgets/participant_row.ui";
auto css_class_for(core::disposition value) -> Glib::ustring
{
diff --git a/ui/src/widgets/participant_row.ui b/ui/src/widgets/participant_row.ui
new file mode 100644
index 0000000..da7712d
--- /dev/null
+++ b/ui/src/widgets/participant_row.ui
@@ -0,0 +1,88 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Cambalache 0.96.0 -->
+<interface>
+ <requires lib="gtk" version="4.14"/>
+ <template class="gtkmm__CustomObject_participant_row" parent="GtkListBoxRow">
+ <property name="activatable">False</property>
+ <property name="child">
+ <object class="GtkBox">
+ <child>
+ <object class="GtkBox">
+ <child>
+ <object class="GtkToggleButton" id="toggle_defeated">
+ <property name="halign">center</property>
+ <property name="icon-name">face-smile-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Mark as defeated</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ <style>
+ <class name="prefixes"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkLabel" id="title">
+ <property name="wrap-mode">word-char</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="title"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="subtitle">
+ <property name="wrap-mode">word-char</property>
+ <property name="xalign">0.0</property>
+ <style>
+ <class name="subtitle"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkButton" id="delete">
+ <property name="icon-name">edit-delete-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Delete participant</property>
+ <style>
+ <class name="circular"/>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="edit">
+ <property name="icon-name">document-edit-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Edit participant</property>
+ <style>
+ <class name="circular"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ <style>
+ <class name="suffixes"/>
+ </style>
+ </object>
+ </child>
+ <style>
+ <class name="header"/>
+ </style>
+ </object>
+ </property>
+ <property name="selectable">False</property>
+ <property name="valign">center</property>
+ </template>
+</interface>
diff --git a/ui/src/widgets/preferences.cpp b/ui/src/widgets/preferences.cpp
index e9dde1e..327860f 100644
--- a/ui/src/widgets/preferences.cpp
+++ b/ui/src/widgets/preferences.cpp
@@ -28,7 +28,7 @@ namespace turns::ui::widgets
namespace
{
auto constexpr static TYPE_NAME = "preferences";
- auto constexpr static TEMPLATE = "/widgets/preferences.ui";
+ auto constexpr static TEMPLATE = "/ch/arknet/Turns/widgets/preferences.ui";
} // namespace
preferences::preferences(Glib::RefPtr<Gio::Settings> settings)
diff --git a/ui/src/widgets/preferences.ui b/ui/src/widgets/preferences.ui
new file mode 100644
index 0000000..74a7845
--- /dev/null
+++ b/ui/src/widgets/preferences.ui
@@ -0,0 +1,103 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Cambalache 0.96.0 -->
+<interface>
+ <requires lib="gtk" version="4.14"/>
+ <requires lib="libadwaita" version="1.6"/>
+ <template class="gtkmm__CustomObject_preferences" parent="AdwPreferencesPage">
+ <property name="icon-name">preferences-system-symbolic</property>
+ <property name="title" translatable="yes">Preferences</property>
+ <child>
+ <object class="AdwPreferencesGroup" id="colors">
+ <property name="title" translatable="yes">Disposition Colors</property>
+ <child>
+ <object class="AdwActionRow">
+ <property name="activatable-widget">friendly_color_button</property>
+ <property name="title" translatable="yes">Friendly</property>
+ <child>
+ <object class="GtkColorDialogButton" id="friendly_color_button">
+ <property name="dialog">
+ <object class="GtkColorDialog">
+ <property name="with-alpha">False</property>
+ </object>
+ </property>
+ <property name="valign">center</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="friendly_reset_button">
+ <property name="icon-name">process-stop-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Reset</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="activatable-widget">hostile_color_button</property>
+ <property name="title" translatable="yes">Hostile</property>
+ <child>
+ <object class="GtkColorDialogButton" id="hostile_color_button">
+ <property name="dialog">
+ <object class="GtkColorDialog">
+ <property name="with-alpha">False</property>
+ </object>
+ </property>
+ <property name="valign">center</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="hostile_reset_button">
+ <property name="icon-name">process-stop-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Reset</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="activatable-widget">secret_color_button</property>
+ <property name="title" translatable="yes">Secret</property>
+ <child>
+ <object class="GtkColorDialogButton" id="secret_color_button">
+ <property name="dialog">
+ <object class="GtkColorDialog">
+ <property name="with-alpha">False</property>
+ </object>
+ </property>
+ <property name="valign">center</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="secret_reset_button">
+ <property name="icon-name">process-stop-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Reset</property>
+ <property name="valign">center</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwPreferencesGroup" id="control">
+ <property name="title" translatable="yes">Flow</property>
+ <child>
+ <object class="AdwSwitchRow" id="skip_defeated">
+ <property name="title" translatable="yes">Skip defeated</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/ui/src/widgets/turn_order_view.cpp b/ui/src/widgets/turn_order_view.cpp
index f3db3c4..97f3834 100644
--- a/ui/src/widgets/turn_order_view.cpp
+++ b/ui/src/widgets/turn_order_view.cpp
@@ -24,7 +24,7 @@ namespace turns::ui::widgets
namespace
{
auto constexpr static TYPE_NAME = "turn_order_view";
- auto constexpr static TEMPLATE = "/widgets/turn_order_view.ui";
+ auto constexpr static TEMPLATE = "/ch/arknet/Turns/widgets/turn_order_view.ui";
} // namespace
turn_order_view::turn_order_view(Glib::RefPtr<model_type> model)
diff --git a/ui/src/widgets/turn_order_view.ui b/ui/src/widgets/turn_order_view.ui
new file mode 100644
index 0000000..50d91c5
--- /dev/null
+++ b/ui/src/widgets/turn_order_view.ui
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Cambalache 0.96.0 -->
+<interface>
+ <requires lib="gtk" version="4.14"/>
+ <requires lib="libadwaita" version="1.6"/>
+ <template class="gtkmm__CustomObject_turn_order_view" parent="GtkBox">
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkProgressBar" id="progress">
+ <style>
+ <class name="osd"/>
+ </style>
+ </object>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="child">
+ <object class="AdwClamp">
+ <property name="child">
+ <object class="GtkListBox" id="view">
+ <property name="valign">start</property>
+ <style>
+ <class name="boxed-list"/>
+ </style>
+ </object>
+ </property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-end">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">12</property>
+ </object>
+ </property>
+ <property name="vexpand">True</property>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/ui/src/windows/participant_editor.ui b/ui/src/windows/participant_editor.ui
new file mode 100644
index 0000000..0eebf52
--- /dev/null
+++ b/ui/src/windows/participant_editor.ui
@@ -0,0 +1,70 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Cambalache 0.96.0 -->
+<interface>
+ <requires lib="gtk" version="4.14"/>
+ <requires lib="libadwaita" version="1.7"/>
+ <object class="AdwDialog" id="participant_editor">
+ <property name="child">
+ <object class="AdwToolbarView">
+ <property name="content">
+ <object class="AdwClamp">
+ <property name="child">
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-end">12</property>
+ <property name="margin-start">12</property>
+ <property name="margin-top">18</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">18</property>
+ <property name="valign">start</property>
+ <child>
+ <object class="AdwPreferencesGroup">
+ <child>
+ <object class="AdwEntryRow" id="name">
+ <property name="title" translatable="yes">Name</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwSpinRow" id="priority">
+ <property name="adjustment">
+ <object class="GtkAdjustment">
+ <property name="lower">-1000.0</property>
+ <property name="step-increment">1.0</property>
+ <property name="upper">1000.0</property>
+ </object>
+ </property>
+ <property name="digits">1</property>
+ <property name="numeric">True</property>
+ <property name="title" translatable="yes">Priority</property>
+ </object>
+ </child>
+ <child>
+ <object class="AdwComboRow" id="disposition">
+ <property name="title" translatable="yes">Disposition</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton" id="finish">
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes">Finish</property>
+ <style>
+ <class name="pill"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </property>
+ </object>
+ </property>
+ <child type="top">
+ <object class="AdwHeaderBar"/>
+ </child>
+ </object>
+ </property>
+ <property name="hexpand">True</property>
+ </object>
+</interface>
diff --git a/ui/src/windows/tracker.ui b/ui/src/windows/tracker.ui
new file mode 100644
index 0000000..787347c
--- /dev/null
+++ b/ui/src/windows/tracker.ui
@@ -0,0 +1,152 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Created with Cambalache 0.96.0 -->
+<interface>
+ <requires lib="gtk" version="4.14"/>
+ <requires lib="libadwaita" version="1.6"/>
+ <requires lib="gio" version="2.0"/>
+ <object class="AdwApplicationWindow" id="tracker">
+ <property name="content">
+ <object class="AdwToolbarView">
+ <property name="content">
+ <object class="AdwToastOverlay" id="overlay">
+ <property name="child">
+ <object class="GtkStack" id="stack">
+ <child>
+ <object class="AdwStatusPage" id="empty">
+ <property name="child">
+ <object class="GtkButton">
+ <property name="action-name">win.add_participant</property>
+ <property name="halign">center</property>
+ <property name="label" translatable="yes">Add participant</property>
+ <style>
+ <class name="pill"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </property>
+ <property name="icon-name">contact-new-symbolic</property>
+ </object>
+ </child>
+ </object>
+ </property>
+ </object>
+ </property>
+ <child type="top">
+ <object class="AdwHeaderBar" id="header">
+ <property name="centering-policy">strict</property>
+ <property name="title-widget">
+ <object class="AdwWindowTitle" id="title">
+ <property name="hexpand">True</property>
+ <property name="subtitle" translatable="yes">No active turn order</property>
+ <property name="title" translatable="yes">Turns</property>
+ </object>
+ </property>
+ <child type="end">
+ <object class="GtkMenuButton" id="open_main_menu">
+ <property name="icon-name">open-menu</property>
+ <property name="menu-model">main_menu</property>
+ <property name="tooltip-text" translatable="yes">Main Menu</property>
+ <property name="use-underline">True</property>
+ </object>
+ </child>
+ <child type="start">
+ <object class="GtkButton" id="add_participant">
+ <property name="action-name">win.add_participant</property>
+ <property name="icon-name">contact-new</property>
+ <property name="tooltip-text" translatable="yes">Add participant</property>
+ </object>
+ </child>
+ <child type="start">
+ <object class="GtkButton" id="start">
+ <property name="action-name">win.start</property>
+ <property name="icon-name">media-playback-start-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Start turn order</property>
+ </object>
+ </child>
+ <style/>
+ </object>
+ </child>
+ <child type="bottom">
+ <object class="GtkRevealer" id="controls">
+ <property name="child">
+ <object class="GtkActionBar">
+ <child type="start">
+ <object class="GtkButton">
+ <property name="action-name">win.previous</property>
+ <property name="icon-name">media-skip-backward-symbolic</property>
+ <property name="tooltip-markup" translatable="yes">Previous participant</property>
+ <style>
+ <class name="pill"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ <child type="center">
+ <object class="GtkButton">
+ <property name="action-name">win.stop</property>
+ <property name="icon-name">media-playback-stop-symbolic</property>
+ <property name="tooltip-markup" translatable="yes">End turn order</property>
+ <style>
+ <class name="pill"/>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ </child>
+ <child type="end">
+ <object class="GtkButton">
+ <property name="action-name">win.next</property>
+ <property name="icon-name">media-skip-forward-symbolic</property>
+ <property name="tooltip-markup" translatable="yes">Next participant</property>
+ <style>
+ <class name="pill"/>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ </child>
+ <style>
+ <class name="toolbar"/>
+ </style>
+ </object>
+ </property>
+ <property name="transition-type">slide-up</property>
+ </object>
+ </child>
+ <style/>
+ </object>
+ </property>
+ <property name="default-height">720</property>
+ <property name="default-width">360</property>
+ <property name="height-request">480</property>
+ <property name="width-request">360</property>
+ </object>
+ <menu id="main_menu">
+ <item>
+ <attribute name="action">win.clear</attribute>
+ <attribute name="label" translatable="yes">_Clear</attribute>
+ </item>
+ <item>
+ <attribute name="action">win.open</attribute>
+ <attribute name="label" translatable="yes">_Open...</attribute>
+ </item>
+ <item>
+ <attribute name="action">win.save</attribute>
+ <attribute name="label" translatable="yes">_Save</attribute>
+ </item>
+ <item>
+ <attribute name="action">win.save-as</attribute>
+ <attribute name="label" translatable="yes">Save as...</attribute>
+ </item>
+ <item>
+ <attribute name="action">win.preferences</attribute>
+ <attribute name="label" translatable="yes">_Preferences</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.quit</attribute>
+ <attribute name="label" translatable="yes">_Quit</attribute>
+ </item>
+ <item>
+ <attribute name="action">app.about</attribute>
+ <attribute name="label">About</attribute>
+ </item>
+ </menu>
+</interface>
diff --git a/ui/src/windows/tracker/actions.cpp b/ui/src/windows/tracker/actions.cpp
index 36d12f3..bbb0c7e 100644
--- a/ui/src/windows/tracker/actions.cpp
+++ b/ui/src/windows/tracker/actions.cpp
@@ -37,7 +37,7 @@ namespace turns::ui::windows
{
auto editor_for(Glib::RefPtr<core::participant> participant)
{
- auto builder = Gtk::Builder::create_from_resource("/windows/participant_editor.ui");
+ auto builder = Gtk::Builder::create_from_resource("/ch/arknet/Turns/windows/participant_editor.ui");
return std::pair{builder, Gtk::Builder::get_widget_derived<participant_editor>(builder, "participant_editor", participant)};
}