summaryrefslogtreecommitdiff
path: root/src/gui/window.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-11-03 14:07:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-11-03 14:07:03 (GMT)
commit530cd02edf04a3df85a1b40f476f2b2d54793e4e (patch)
treef0616f6478c52b018679cc4cec1b06d9e37331a1 /src/gui/window.c
parent54d05927811a59db294af8a24258c0b837360492 (diff)
Take into account widgets provided by panels for the title bar.gtk4
Diffstat (limited to 'src/gui/window.c')
-rw-r--r--src/gui/window.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/window.c b/src/gui/window.c
index 193f1bf..2680c89 100644
--- a/src/gui/window.c
+++ b/src/gui/window.c
@@ -295,8 +295,40 @@ static void gtk_framework_window_activate_about(GSimpleAction *action, GVariant
void gtk_framework_window_add(GtkFrameworkWindow *window, /* __steal */GtkTiledPanel *panel)
{
+ GtkWidget *bar; /* Barre de titre */
+ GListStore *list; /* Liste éventuelle à intégrer */
+ guint count; /* Nombre d'élements présents */
+ guint i; /* Boucle de parcours */
+ GtkWidget *widget; /* Composant à intégrer */
+
gtk_stack_add_child(window->grid, GTK_WIDGET(panel));
gtk_stack_set_visible_child(window->grid, GTK_WIDGET(panel));
+
+
+ bar = gtk_window_get_titlebar(GTK_WINDOW(window));
+
+ if (bar == NULL) ////////// REMME
+ {
+ bar = gtk_header_bar_new();
+ gtk_window_set_titlebar(GTK_WINDOW(window), bar);
+ } /////////////////////////////
+
+ list = gtk_tiled_panel_get_title_widgets(panel, false);
+
+ if (list != NULL)
+ {
+ count = g_list_model_get_n_items(G_LIST_MODEL(list));
+
+ for (i = 0; i < count; i++)
+ {
+ widget = GTK_WIDGET(g_list_model_get_item(G_LIST_MODEL(list), i));
+ gtk_header_bar_pack_end(GTK_HEADER_BAR(bar), widget);
+ }
+
+ unref_object(list);
+
+ }
+
}