# HG changeset patch
# Node ID a06e946d4aa0
# Parent  1c53950f9052
diff --git a/pidgin/pidginavatar.c b/pidgin/pidginavatar.c
--- a/pidgin/pidginavatar.c
+++ b/pidgin/pidginavatar.c
@@ -28,6 +28,7 @@
 	GtkBox parent;
 
 	GtkWidget *icon;
+	GMenuModel *menu;
 
 	GdkPixbufAnimation *animation;
 	gboolean animate;
@@ -339,20 +340,13 @@
                                    gpointer data)
 {
 	PidginAvatar *avatar = PIDGIN_AVATAR(data);
-	GtkBuilder *builder = NULL;
 	GtkWidget *menu = NULL;
-	GMenuModel *model = NULL;
 
-	builder = gtk_builder_new_from_resource("/im/pidgin/Pidgin3/Avatar/menu.ui");
-	model = (GMenuModel *)gtk_builder_get_object(builder, "menu");
-
-	menu = gtk_popover_menu_new_from_model(model);
+	menu = gtk_popover_menu_new_from_model(avatar->menu);
 	gtk_widget_set_parent(menu, GTK_WIDGET(avatar));
 	gtk_popover_set_pointing_to(GTK_POPOVER(menu),
 	                            &(const GdkRectangle){(int)x, (int)y, 0, 0});
 
-	g_clear_object(&builder);
-
 	gtk_popover_popup(GTK_POPOVER(menu));
 
 	return TRUE;
@@ -535,10 +529,11 @@
 
 	gtk_widget_class_set_template_from_resource(
 	    widget_class,
-	    "/im/pidgin/Pidgin3/Avatar/avatar.ui"
+	    "/im/pidgin/Pidgin3/avatar.ui"
 	);
 
 	gtk_widget_class_bind_template_child(widget_class, PidginAvatar, icon);
+	gtk_widget_class_bind_template_child(widget_class, PidginAvatar, menu);
 
 	gtk_widget_class_bind_template_callback(widget_class,
 	                                        pidgin_avatar_button_press_handler);
diff --git a/pidgin/resources/Avatar/avatar.ui b/pidgin/resources/avatar.ui
rename from pidgin/resources/Avatar/avatar.ui
rename to pidgin/resources/avatar.ui
--- a/pidgin/resources/Avatar/avatar.ui
+++ b/pidgin/resources/avatar.ui
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 
-
+<!--
 Pidgin - Internet Messenger
 Copyright (C) Pidgin Developers <devel@pidgin.im>
 
@@ -15,9 +14,7 @@
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
+along with this program; if not, see <https://www.gnu.org/licenses/>.
 -->
 <interface>
   <requires lib="gtk" version="4.0"/>
@@ -46,4 +43,20 @@
       </object>
     </child>
   </template>
+  <menu id="menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Save Avatar As...</attribute>
+        <attribute name="action">avatar.save-avatar</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Set Custom Avatar...</attribute>
+        <attribute name="action">avatar.set-custom-avatar</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Clear Custom Avatar</attribute>
+        <attribute name="action">avatar.clear-custom-avatar</attribute>
+      </item>
+    </section>
+  </menu>
 </interface>
diff --git a/pidgin/resources/Avatar/menu.ui b/pidgin/resources/Avatar/menu.ui
deleted file mode 100644
--- a/pidgin/resources/Avatar/menu.ui
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-Pidgin - Internet Messenger
-Copyright (C) Pidgin Developers <devel@pidgin.im>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
--->
-<interface>
-  <requires lib="gtk" version="4.0"/>
-  <!-- interface-license-type gplv2 -->
-  <!-- interface-name Pidgin -->
-  <!-- interface-description Internet Messenger -->
-  <!-- interface-copyright Pidgin Developers <devel@pidgin.im> -->
-  <menu id="menu">
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">Save Avatar As...</attribute>
-        <attribute name="action">avatar.save-avatar</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">Set Custom Avatar...</attribute>
-        <attribute name="action">avatar.set-custom-avatar</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">Clear Custom Avatar</attribute>
-        <attribute name="action">avatar.clear-custom-avatar</attribute>
-      </item>
-    </section>
-  </menu>
-</interface>
diff --git a/pidgin/resources/pidgin.gresource.xml b/pidgin/resources/pidgin.gresource.xml
--- a/pidgin/resources/pidgin.gresource.xml
+++ b/pidgin/resources/pidgin.gresource.xml
@@ -9,8 +9,7 @@
     <file compressed="true" preprocess="xml-stripblanks">Accounts/display.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">Accounts/editor.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">Accounts/manager.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">Avatar/avatar.ui</file>
-    <file compressed="true" preprocess="xml-stripblanks">Avatar/menu.ui</file>
+    <file compressed="true" preprocess="xml-stripblanks">avatar.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">BuddyList/window.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">Conversations/conversation.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">Conversations/infopane.ui</file>
diff --git a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -304,8 +304,7 @@
 pidgin/resources/Accounts/chooser.ui
 pidgin/resources/Accounts/editor.ui
 pidgin/resources/Accounts/manager.ui
-pidgin/resources/Avatar/avatar.ui
-pidgin/resources/Avatar/menu.ui
+pidgin/resources/avatar.ui
 pidgin/resources/BuddyList/window.ui
 pidgin/resources/Conversations/infopane.ui
 pidgin/resources/Conversations/invite_dialog.ui
