# HG changeset patch
# Node ID 5a3bdc87313f
# Parent  71e6d642fcf2
diff --git a/talkatu/data/attachmentdialog.ui b/talkatu/data/attachmentdialog.ui
--- a/talkatu/data/attachmentdialog.ui
+++ b/talkatu/data/attachmentdialog.ui
@@ -18,103 +18,39 @@
 along with this library; if not, see <https://www.gnu.org/licenses/>.
 
 -->
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="3.18"/>
-  <!-- interface-license-type gplv2 -->
-  <!-- interface-name Talkatu -->
-  <!-- interface-description GTK widgets for chat applications -->
-  <!-- interface-copyright Gary Kramlich <grim@reaperworld.com> -->
+  <requires lib="gtk" version="4.0"/>
   <template class="TalkatuAttachmentDialog" parent="GtkDialog">
-    <property name="can_focus">False</property>
     <property name="border_width">12</property>
-    <property name="modal">True</property>
+    <property name="modal">1</property>
     <property name="type_hint">dialog</property>
     <child>
       <placeholder/>
     </child>
-    <child internal-child="vbox">
+    <child internal-child="content_area">
       <object class="GtkBox">
-        <property name="can_focus">False</property>
+        <property name="visible">0</property>
         <property name="orientation">vertical</property>
         <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkButtonBox">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="cancel">
-                <property name="label" translatable="yes">Cancel</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="upload">
-                <property name="label" translatable="yes">Upload</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <accelerator key="Return" signal="clicked"/>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkImage" id="preview">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="pixel_size">256</property>
             <property name="icon_name">text-x-generic-template</property>
             <property name="icon_size">6</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="filename">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="label" translatable="yes">&lt;filename&gt;</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
         </child>
         <child>
           <object class="GtkEntry" id="comment">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="has_focus">True</property>
+            <property name="focusable">1</property>
+            <property name="has_focus">1</property>
             <property name="placeholder_text" translatable="yes">Comment (optional)</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
-          </packing>
         </child>
       </object>
     </child>
@@ -122,5 +58,39 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-3">upload</action-widget>
     </action-widgets>
+    <child internal-child="action_area">
+      <object class="GtkButtonBox">
+        <property name="valign">center</property>
+        <property name="can_focus">False</property>
+        <property name="layout_style">end</property>
+        <child>
+          <object class="GtkButton" id="cancel">
+            <property name="label" translatable="yes">Cancel</property>
+            <property name="focusable">1</property>
+            <property name="receives_default">1</property>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButton" id="upload">
+            <property name="label" translatable="yes">Upload</property>
+            <property name="focusable">1</property>
+            <property name="can_default">True</property>
+            <property name="has_default">1</property>
+            <property name="receives_default">1</property>
+            <accelerator key="Return" signal="clicked"/>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
   </template>
 </interface>
diff --git a/talkatu/talkatuattachmentdialog.c b/talkatu/talkatuattachmentdialog.c
--- a/talkatu/talkatuattachmentdialog.c
+++ b/talkatu/talkatuattachmentdialog.c
@@ -57,8 +57,7 @@
 			gchar *filename = NULL;
 
 			if(G_IS_ICON(preview)) {
-				gtk_image_set_from_gicon(GTK_IMAGE(dialog->preview), preview,
-				                         GTK_ICON_SIZE_DIALOG);
+				gtk_image_set_from_gicon(GTK_IMAGE(dialog->preview), preview);
 				g_object_unref(G_OBJECT(preview));
 			}
 
@@ -77,7 +76,7 @@
                                       const gchar *comment)
 {
 	if(GTK_IS_ENTRY(dialog->comment)) {
-		gtk_entry_set_text(GTK_ENTRY(dialog->comment), comment);
+		gtk_editable_set_text(GTK_EDITABLE(dialog->comment), comment);
 
 		g_object_notify_by_pspec(G_OBJECT(dialog), properties[PROP_COMMENT]);
 	}
@@ -228,7 +227,7 @@
 	g_return_val_if_fail(TALKATU_IS_ATTACHMENT_DIALOG(dialog), "");
 
 	if(GTK_IS_ENTRY(dialog->comment)) {
-		return gtk_entry_get_text(GTK_ENTRY(dialog->comment));
+		return gtk_editable_get_text(GTK_EDITABLE(dialog->comment));
 	}
 
 	return "";
