mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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:
parent
d51d73f1b1
commit
1d45cbd831
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user