Commit 1d45cbd8 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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.
parent d51d73f1
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.
......
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.
......
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.
......
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.
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment