[PATCH] [Bug 516230] eel-editable-label text targets
- From: Christian Persch <chpe gnome org>
- To: nautilus-list <nautilus-list gnome org>
- Subject: [PATCH] [Bug 516230] eel-editable-label text targets
- Date: Wed, 13 Feb 2008 13:34:33 +0100
Hi;
attached patch fixes a little disparity between the text targets
eel-editable-label sets in the clipboard, and those that the normal
gtklabel/gtkentry widgets support. Ok to commit?
Regards,
Christian
Index: eel/eel-editable-label.c
===================================================================
--- eel/eel-editable-label.c (révision 2054)
+++ eel/eel-editable-label.c (copie de travail)
@@ -1921,12 +1921,6 @@ eel_editable_label_select_region_index (
gint anchor_index,
gint end_index)
{
- static const GtkTargetEntry targets[] = {
- { "STRING", 0, 0 },
- { "TEXT", 0, 0 },
- { "COMPOUND_TEXT", 0, 0 },
- { "UTF8_STRING", 0, 0 }
- };
GtkClipboard *clipboard;
g_return_if_fail (EEL_IS_EDITABLE_LABEL (label));
@@ -1945,12 +1939,23 @@ eel_editable_label_select_region_index (
if (anchor_index != end_index)
{
+ GtkTargetList *list;
+ GtkTargetEntry *targets;
+ guint n_targets;
+
+ list = gtk_target_list_new (NULL, 0);
+ gtk_target_list_add_text_targets (list, 0);
+ targets = gtk_target_table_new_from_list (list, &n_targets);
+
gtk_clipboard_set_with_owner (clipboard,
- targets,
- G_N_ELEMENTS (targets),
+ targets, n_targets,
get_text_callback,
clear_text_callback,
G_OBJECT (label));
+
+ gtk_clipboard_set_can_store (clipboard, NULL, 0);
+ gtk_target_table_free (targets, n_targets);
+ gtk_target_list_unref (list);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]