static gboolean compose_headerentry_key_press_event_cb(GtkWidget *entry,
GdkEventKey *event,
ComposeHeaderEntry *headerentry);
+static gboolean compose_headerentry_button_clicked_cb (GtkWidget *button,
+ ComposeHeaderEntry *headerentry);
static void compose_show_first_last_header (Compose *compose, gboolean show_first);
GtkWidget *combo;
GtkWidget *entry;
+ GtkWidget *button;
+ GtkWidget *hbox;
gchar **string;
const gchar *header = NULL;
ComposeHeaderEntry *headerentry;
g_signal_connect_after(G_OBJECT(gtk_bin_get_child(GTK_BIN((combo)))), "grab_focus",
G_CALLBACK(compose_grab_focus_cb), compose);
- /* Entry field */
+ /* Entry field with cleanup button */
+ button = gtk_button_new();
+ gtk_button_set_image(GTK_BUTTON(button),
+ gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON));
+ gtk_widget_show(button);
+ CLAWS_SET_TIP(button,
+ _("Delete entry contents"));
entry = gtk_entry_new();
gtk_widget_show(entry);
CLAWS_SET_TIP(entry,
_("Use <tab> to autocomplete from addressbook"));
- gtk_table_attach(GTK_TABLE(compose->header_table), entry, 1, 2,
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show(hbox);
+ gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+ gtk_table_attach(GTK_TABLE(compose->header_table), hbox, 1, 2,
compose->header_nextrow, compose->header_nextrow+1,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
headerentry);
g_signal_connect_after(G_OBJECT(entry), "grab_focus",
G_CALLBACK(compose_grab_focus_cb), compose);
+
+ g_signal_connect(G_OBJECT(button), "clicked",
+ G_CALLBACK(compose_headerentry_button_clicked_cb),
+ headerentry);
/* email dnd */
gtk_drag_dest_set(entry, GTK_DEST_DEFAULT_ALL, compose_mime_types,
headerentry->compose = compose;
headerentry->combo = combo;
headerentry->entry = entry;
+ headerentry->button = button;
+ headerentry->hbox = hbox;
headerentry->headernum = compose->header_nextrow;
compose->header_nextrow++;
compose->remove_references = FALSE;
}
+static gboolean compose_headerentry_button_clicked_cb (GtkWidget *button,
+ ComposeHeaderEntry *headerentry)
+{
+ gtk_entry_set_text(GTK_ENTRY(headerentry->entry), "");
+ return FALSE;
+}
+
static gboolean compose_headerentry_key_press_event_cb(GtkWidget *entry,
GdkEventKey *event,
ComposeHeaderEntry *headerentry)