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>
|
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)
|
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
|
||||||
|
|
||||||
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
2004-07-16 Matthias Clasen <mclasen@redhat.com>
|
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)
|
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
|
||||||
|
|
||||||
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
2004-07-16 Matthias Clasen <mclasen@redhat.com>
|
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)
|
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
|
||||||
|
|
||||||
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
2004-07-16 Matthias Clasen <mclasen@redhat.com>
|
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)
|
Add a combo box cell renderer (#139347, Lorenzo Gil Sanchez)
|
||||||
|
|
||||||
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
* gtk/gtkcellrenderercombo.[hc]: New Files.
|
||||||
|
@ -1886,29 +1886,26 @@ gtk_combo_box_scroll_event (GtkWidget *widget,
|
|||||||
|
|
||||||
index = gtk_combo_box_get_active (combo_box);
|
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);
|
new_index = index - 1;
|
||||||
|
while (new_index >= 0 && !row_is_sensitive (combo_box, new_index))
|
||||||
if (event->direction == GDK_SCROLL_UP)
|
new_index--;
|
||||||
{
|
if (new_index < 0)
|
||||||
new_index = index - 1;
|
new_index = index;
|
||||||
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));
|
|
||||||
}
|
}
|
||||||
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -4064,11 +4061,6 @@ gtk_cell_editable_key_press (GtkWidget *widget,
|
|||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
else if (event->keyval == GDK_space)
|
|
||||||
{
|
|
||||||
/* ignore */
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user