[gnome-builder/wip/gtk4-port: 171/1774] libide/gui: fix menu-id usage
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 171/1774] libide/gui: fix menu-id usage
- Date: Mon, 11 Jul 2022 22:30:59 +0000 (UTC)
commit 4b8e27d136a1908acd97158a90f5f0db9525e42e
Author: Christian Hergert <chergert redhat com>
Date: Tue Mar 29 13:41:51 2022 -0700
libide/gui: fix menu-id usage
src/libide/gui/ide-header-bar.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/gui/ide-header-bar.c b/src/libide/gui/ide-header-bar.c
index e8b2ac05a..8aa79dbbc 100644
--- a/src/libide/gui/ide-header-bar.c
+++ b/src/libide/gui/ide-header-bar.c
@@ -22,6 +22,7 @@
#include "config.h"
+#include "ide-application.h"
#include "ide-header-bar.h"
typedef struct
@@ -183,10 +184,17 @@ ide_header_bar_set_menu_id (IdeHeaderBar *self,
if (!ide_str_equal0 (menu_id, priv->menu_id))
{
+ GMenu *menu = NULL;
+
g_free (priv->menu_id);
priv->menu_id = g_strdup (menu_id);
- g_object_set (priv->menu_button, "menu-id", menu_id, NULL);
+
+ if (menu_id != NULL)
+ menu = ide_application_get_menu_by_id (IDE_APPLICATION_DEFAULT, menu_id);
+
+ g_object_set (priv->menu_button, "menu-model", menu, NULL);
gtk_widget_set_visible (GTK_WIDGET (priv->menu_button), !ide_str_empty0 (menu_id));
+
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_MENU_ID]);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]