[gnome-builder] libide/tweaks: change title based on project title



commit f5ca2452ea24415afb82399bca028ece7b47860c
Author: Christian Hergert <chergert redhat com>
Date:   Tue Aug 23 14:55:50 2022 -0700

    libide/tweaks: change title based on project title

 src/libide/tweaks/ide-tweaks-window.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/libide/tweaks/ide-tweaks-window.c b/src/libide/tweaks/ide-tweaks-window.c
index 62510460d..6474fc855 100644
--- a/src/libide/tweaks/ide-tweaks-window.c
+++ b/src/libide/tweaks/ide-tweaks-window.c
@@ -22,6 +22,8 @@
 
 #include "config.h"
 
+#include <glib/gi18n.h>
+
 #include <libpeas/peas.h>
 
 #include "ide-tweaks-addin.h"
@@ -634,7 +636,17 @@ ide_tweaks_window_set_tweaks (IdeTweaksWindow *self,
 
   if (tweaks != NULL)
     {
+      IdeContext *context;
+      g_autofree char *title = NULL;
+
       g_set_object (&self->tweaks, tweaks);
+
+      /* Update window title to include project */
+      if ((context = ide_tweaks_get_context (tweaks)))
+        title = ide_context_dup_title (context);
+      gtk_window_set_title (GTK_WINDOW (self),
+                            title ? title : _("Preferences"));
+
       ide_tweaks_window_rebuild (self);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]