# HG changeset patch
# Node ID b5354976e15a
# Parent  916a6708a756
diff --git a/talkatu/data/attachmentpreview.ui b/talkatu/data/attachmentpreview.ui
--- a/talkatu/data/attachmentpreview.ui
+++ b/talkatu/data/attachmentpreview.ui
@@ -19,112 +19,62 @@ along with this library; if not, see <ht
 
 -->
 <interface>
-  <requires lib="gtk+" version="3.18"/>
+  <requires lib="gtk" version="4.0"/>
   <!-- interface-license-type gplv2 -->
   <!-- interface-name Talkatu -->
   <!-- interface-description GTK widgets for chat applications -->
   <!-- interface-copyright Gary Kramlich <grim@reaperworld.com> -->
-  <template class="TalkatuAttachmentPreview" parent="GtkInfoBar">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <child internal-child="action_area">
-      <object class="GtkButtonBox">
-        <property name="can_focus">False</property>
-        <property name="spacing">6</property>
-        <property name="layout_style">end</property>
-        <child>
-          <object class="GtkButton">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="relief">none</property>
-            <signal name="clicked" handler="talkatu_attachment_preview_download_cb" object="TalkatuAttachmentPreview" swapped="no"/>
+  <template class="TalkatuAttachmentPreview" parent="GtkWidget">
+    <child>
+      <object class="GtkInfoBar">
+        <property name="hexpand">1</property>
+        <signal name="response" handler="talkatu_attachment_preview_download_cb" object="TalkatuAttachmentPreview" swapped="no"/>
+        <child type="action">
+          <object class="GtkButton" id="download_button">
             <child>
               <object class="GtkImage">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="icon_name">document-save-symbolic</property>
-                <property name="icon_size">5</property>
               </object>
             </child>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-            <property name="non_homogeneous">True</property>
-          </packing>
         </child>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">False</property>
-        <property name="position">0</property>
-      </packing>
-    </child>
-    <child internal-child="content_area">
-      <object class="GtkBox">
-        <property name="can_focus">False</property>
-        <property name="spacing">16</property>
-        <child>
-          <object class="GtkImage" id="preview">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="icon_name">text-x-generic</property>
-            <property name="icon_size">6</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
+        <action-widgets>
+          <action-widget response="0">download_button</action-widget>
+        </action-widgets>
         <child>
           <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">0</property>
+            <property name="spacing">16</property>
             <child>
-              <object class="GtkLabel" id="filename">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">unknown</property>
-                <property name="xalign">0</property>
+              <object class="GtkImage" id="preview">
+                <property name="can_focus">0</property>
+                <property name="icon_name">text-x-generic</property>
+                <property name="icon_size">large</property>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="filesize">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
+              <object class="GtkBox">
+                <property name="hexpand">1</property>
+                <property name="can_focus">0</property>
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkLabel" id="filename">
+                    <property name="can_focus">0</property>
+                    <property name="label" translatable="yes">unknown</property>
+                    <property name="xalign">0</property>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="filesize">
+                    <property name="can_focus">0</property>
+                    <property name="xalign">0</property>
+                  </object>
+                </child>
               </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
             </child>
           </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>
-      <placeholder/>
     </child>
   </template>
 </interface>
diff --git a/talkatu/talkatuattachmentpreview.h b/talkatu/talkatuattachmentpreview.h
--- a/talkatu/talkatuattachmentpreview.h
+++ b/talkatu/talkatuattachmentpreview.h
@@ -33,7 +33,7 @@
 G_BEGIN_DECLS
 
 #define TALKATU_TYPE_ATTACHMENT_PREVIEW (talkatu_attachment_preview_get_type())
-G_DECLARE_FINAL_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, TALKATU, ATTACHMENT_PREVIEW, GtkInfoBar)
+G_DECLARE_FINAL_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, TALKATU, ATTACHMENT_PREVIEW, GtkWidget)
 
 GtkWidget *talkatu_attachment_preview_new(TalkatuAttachment *attachment);
 
diff --git a/talkatu/talkatuattachmentpreview.c b/talkatu/talkatuattachmentpreview.c
--- a/talkatu/talkatuattachmentpreview.c
+++ b/talkatu/talkatuattachmentpreview.c
@@ -27,7 +27,7 @@
  * user to save it.
  */
 struct _TalkatuAttachmentPreview {
-	GtkInfoBar parent;
+	GtkWidget parent;
 
 	TalkatuAttachment *attachment;
 
@@ -47,9 +47,11 @@ static GParamSpec *properties[N_PROPERTI
 /******************************************************************************
  * Callbacks
  *****************************************************************************/
-static gboolean
-talkatu_attachment_preview_download_cb(GtkButton *button, gpointer data) {
-	return FALSE;
+static void
+talkatu_attachment_preview_download_cb(G_GNUC_UNUSED GtkInfoBar *self,
+                                       G_GNUC_UNUSED gint response_id,
+                                       G_GNUC_UNUSED gpointer user_data)
+{
 }
 
 /******************************************************************************
@@ -66,8 +68,7 @@ talkatu_attachment_preview_set_attachmen
 			gchar *filesize = NULL;
 
 			if(G_IS_ICON(icon)) {
-				gtk_image_set_from_gicon(GTK_IMAGE(preview->preview), icon,
-				                         GTK_ICON_SIZE_DIALOG);
+				gtk_image_set_from_gicon(GTK_IMAGE(preview->preview), icon);
 				g_object_unref(G_OBJECT(icon));
 			}
 
@@ -88,7 +89,7 @@ talkatu_attachment_preview_set_attachmen
 /******************************************************************************
  * GObject Implementation
  *****************************************************************************/
-G_DEFINE_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, GTK_TYPE_INFO_BAR)
+G_DEFINE_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, GTK_TYPE_WIDGET)
 
 static void
 talkatu_attachment_preview_get_property(GObject *obj, guint prop_id,
