--- a/talkatu/data/attachmentpreview.ui Sun Jan 16 01:56:34 2022 -0600
+++ b/talkatu/data/attachmentpreview.ui Sat Jan 29 21:49:25 2022 -0600
@@ -19,112 +19,62 @@
- <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>
- <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"> + <object class="GtkInfoBar"> + <property name="hexpand">1</property> + <signal name="response" handler="talkatu_attachment_preview_download_cb" object="TalkatuAttachmentPreview" swapped="no"/> + <object class="GtkButton" id="download_button"> <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>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- <property name="non_homogeneous">True</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- <child internal-child="content_area">
- <object class="GtkBox">
- <property name="can_focus">False</property>
- <property name="spacing">16</property>
- <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>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <action-widget response="0">download_button</action-widget> - <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> - <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>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <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> + <object class="GtkLabel" id="filename"> + <property name="can_focus">0</property> + <property name="label" translatable="yes">unknown</property> + <property name="xalign">0</property> + <object class="GtkLabel" id="filesize"> + <property name="can_focus">0</property> + <property name="xalign">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
--- a/talkatu/talkatuattachmentpreview.c Sun Jan 16 01:56:34 2022 -0600
+++ b/talkatu/talkatuattachmentpreview.c Sat Jan 29 21:49:25 2022 -0600
@@ -27,7 +27,7 @@
struct _TalkatuAttachmentPreview {
TalkatuAttachment *attachment;
@@ -47,9 +47,11 @@
/******************************************************************************
*****************************************************************************/
-talkatu_attachment_preview_download_cb(GtkButton *button, gpointer data) {
+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 @@
- gtk_image_set_from_gicon(GTK_IMAGE(preview->preview), icon,
+ gtk_image_set_from_gicon(GTK_IMAGE(preview->preview), icon); g_object_unref(G_OBJECT(icon));
@@ -88,7 +89,7 @@
/******************************************************************************
*****************************************************************************/
-G_DEFINE_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, GTK_TYPE_INFO_BAR)
+G_DEFINE_TYPE(TalkatuAttachmentPreview, talkatu_attachment_preview, GTK_TYPE_WIDGET) talkatu_attachment_preview_get_property(GObject *obj, guint prop_id,
--- a/talkatu/talkatuattachmentpreview.h Sun Jan 16 01:56:34 2022 -0600
+++ b/talkatu/talkatuattachmentpreview.h Sat Jan 29 21:49:25 2022 -0600
@@ -33,7 +33,7 @@
#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);