--- a/talkatu/data/attachmentdialog.ui Sat Jan 15 23:09:20 2022 -0600
+++ b/talkatu/data/attachmentdialog.ui Sun Jan 16 00:10:38 2022 -0600
@@ -19,102 +19,40 @@
- <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="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 internal-child="vbox">
+ <child internal-child="content_area"> - <property name="can_focus">False</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>
- <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>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- <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"/>
- <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>
<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>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
<object class="GtkLabel" id="filename">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
<property name="label" translatable="yes"><filename></property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
<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>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
@@ -122,5 +60,39 @@
<action-widget response="-6">cancel</action-widget>
<action-widget response="-3">upload</action-widget>
+ <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> + <object class="GtkButton" id="cancel"> + <property name="label" translatable="yes">Cancel</property> + <property name="focusable">1</property> + <property name="receives_default">1</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + <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"/> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> --- a/talkatu/talkatuattachmentdialog.c Sat Jan 15 23:09:20 2022 -0600
+++ b/talkatu/talkatuattachmentdialog.c Sun Jan 16 00:10:38 2022 -0600
@@ -57,8 +57,7 @@
- gtk_image_set_from_gicon(GTK_IMAGE(dialog->preview), preview,
+ gtk_image_set_from_gicon(GTK_IMAGE(dialog->preview), preview); g_object_unref(G_OBJECT(preview));
@@ -77,7 +76,7 @@
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));