Make scrolling work if no item is selected. (gtk_cell_editable_key_press):

2004-07-16  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
	scrolling work if no item is selected.
	(gtk_cell_editable_key_press): Don't eat space.
This commit is contained in:
Matthias Clasen 2004-07-16 21:13:21 +00:00 committed by Matthias Clasen
parent d51d73f1b1
commit 1d45cbd831
5 changed files with 34 additions and 26 deletions

View File

@ -1,5 +1,9 @@
2004-07-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
scrolling work if no item is selected.
(gtk_cell_editable_key_press): Don't eat space.
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.

View File

@ -1,5 +1,9 @@
2004-07-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
scrolling work if no item is selected.
(gtk_cell_editable_key_press): Don't eat space.
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.

View File

@ -1,5 +1,9 @@
2004-07-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
scrolling work if no item is selected.
(gtk_cell_editable_key_press): Don't eat space.
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.

View File

@ -1,5 +1,9 @@
2004-07-16 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcombobox.c (gtk_combo_box_scroll_event): Make
scrolling work if no item is selected.
(gtk_cell_editable_key_press): Don't eat space.
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
* gtk/gtkcellrenderercombo.[hc]: New Files.

View File

@ -1886,29 +1886,26 @@ gtk_combo_box_scroll_event (GtkWidget *widget,
index = gtk_combo_box_get_active (combo_box);
if (index != -1)
items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
if (event->direction == GDK_SCROLL_UP)
{
items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
if (event->direction == GDK_SCROLL_UP)
{
new_index = index - 1;
while (new_index >= 0 && !row_is_sensitive (combo_box, new_index))
new_index--;
if (new_index < 0)
new_index = index;
}
else
{
new_index = index + 1;
while (new_index < items && !row_is_sensitive (combo_box, new_index))
new_index++;
if (new_index == items)
new_index = index;
}
gtk_combo_box_set_active (combo_box, CLAMP (new_index, 0, items - 1));
new_index = index - 1;
while (new_index >= 0 && !row_is_sensitive (combo_box, new_index))
new_index--;
if (new_index < 0)
new_index = index;
}
else
{
new_index = index + 1;
while (new_index < items && !row_is_sensitive (combo_box, new_index))
new_index++;
if (new_index == items)
new_index = index;
}
gtk_combo_box_set_active (combo_box, new_index);
return TRUE;
}
@ -4064,11 +4061,6 @@ gtk_cell_editable_key_press (GtkWidget *widget,
return TRUE;
}
else if (event->keyval == GDK_space)
{
/* ignore */
return TRUE;
}
return FALSE;
}