gimp r26457 - in branches/soc-2008-tagging: . app/widgets
- From: aurisj svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26457 - in branches/soc-2008-tagging: . app/widgets
- Date: Fri, 8 Aug 2008 22:49:34 +0000 (UTC)
Author: aurisj
Date: Fri Aug 8 22:49:33 2008
New Revision: 26457
URL: http://svn.gnome.org/viewvc/gimp?rev=26457&view=rev
Log:
2008-08-09 Aurimas JuÅka <aurisj svn gnome org>
* app/widgets/gimptagentry.c: when deleting a tag, in which side to
delete whitespace depends whether Delete or Backspace keys are used.
Modified:
branches/soc-2008-tagging/ChangeLog
branches/soc-2008-tagging/app/widgets/gimptagentry.c
Modified: branches/soc-2008-tagging/app/widgets/gimptagentry.c
==============================================================================
--- branches/soc-2008-tagging/app/widgets/gimptagentry.c (original)
+++ branches/soc-2008-tagging/app/widgets/gimptagentry.c Fri Aug 8 22:49:33 2008
@@ -135,6 +135,9 @@
static void gimp_tag_entry_next_tag (GimpTagEntry *tag_entry);
static void gimp_tag_entry_previous_tag (GimpTagEntry *tag_entry);
+static void gimp_tag_entry_select_for_deletion (GimpTagEntry *tag_entry,
+ GimpTagSearchDir search_dir);
+
GType
gimp_tag_entry_mode_get_type (void)
@@ -519,11 +522,6 @@
{
end_pos++;
}
- while (end_pos <= tag_entry->mask->len
- && (tag_entry->mask->str[end_pos] == 'w'))
- {
- end_pos++;
- }
}
gtk_editable_delete_text (editable, start_pos, end_pos);
@@ -1250,6 +1248,10 @@
{
return TRUE;
}
+ else
+ {
+ gimp_tag_entry_select_for_deletion (tag_entry, TAG_SEARCH_LEFT);
+ }
}
break;
@@ -1266,6 +1268,10 @@
{
return TRUE;
}
+ else
+ {
+ gimp_tag_entry_select_for_deletion (tag_entry, TAG_SEARCH_RIGHT);
+ }
}
break;
@@ -1798,3 +1804,47 @@
gtk_editable_set_position (GTK_EDITABLE (tag_entry), position);
}
+static void
+gimp_tag_entry_select_for_deletion (GimpTagEntry *tag_entry,
+ GimpTagSearchDir search_dir)
+{
+ gint start_pos;
+ gint end_pos;
+
+ gtk_editable_get_selection_bounds (GTK_EDITABLE (tag_entry), &start_pos, &end_pos);
+ while (start_pos > 0
+ && (tag_entry->mask->str[start_pos - 1] == 't'))
+ {
+ start_pos--;
+ }
+ if (search_dir == TAG_SEARCH_LEFT)
+ {
+ while (start_pos > 0
+ && (tag_entry->mask->str[start_pos - 1] == 'w'))
+ {
+ start_pos--;
+ }
+ }
+
+ if (end_pos > start_pos
+ && (tag_entry->mask->str[end_pos - 1] == 't'
+ || tag_entry->mask->str[end_pos - 1] == 's'))
+ {
+ while (end_pos <= tag_entry->mask->len
+ && (tag_entry->mask->str[end_pos] == 's'))
+ {
+ end_pos++;
+ }
+ if (search_dir == TAG_SEARCH_RIGHT)
+ {
+ while (end_pos <= tag_entry->mask->len
+ && (tag_entry->mask->str[end_pos] == 'w'))
+ {
+ end_pos++;
+ }
+ }
+ }
+
+ gtk_editable_select_region (GTK_EDITABLE (tag_entry), start_pos, end_pos);
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]