Set focus-on-click to FALSE for all buttons. Don't grab focus when a
2005-11-07 Matthias Clasen <mclasen@redhat.com> * gtk/gtkpathbar.[hc]: Set focus-on-click to FALSE for all buttons. Don't grab focus when a slider button is pressed, instead, use a bit in the pathbar struct to determine whether to scroll up or down. (#314486, Carlos Garnacho)
This commit is contained in:
committed by
Matthias Clasen
parent
fa490ed236
commit
b3a1c4cdb7
@@ -1,5 +1,14 @@
|
||||
2005-11-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkpathbar.[hc]: Set focus-on-click to FALSE for all buttons.
|
||||
Don't grab focus when a slider button is pressed, instead, use
|
||||
a bit in the pathbar struct to determine whether to scroll up
|
||||
or down. (#314486, Carlos Garnacho)
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_key_press_event): Handle
|
||||
Shift-G to go to the previous match, like firefox. (#320061,
|
||||
Christian Neumair)
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_popup):
|
||||
Don't popup the completions if the focus has already been
|
||||
moved somewhere else. (#319914, Christian Persch)
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
2005-11-07 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gtk/gtkpathbar.[hc]: Set focus-on-click to FALSE for all buttons.
|
||||
Don't grab focus when a slider button is pressed, instead, use
|
||||
a bit in the pathbar struct to determine whether to scroll up
|
||||
or down. (#314486, Carlos Garnacho)
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_search_key_press_event): Handle
|
||||
Shift-G to go to the previous match, like firefox. (#320061,
|
||||
Christian Neumair)
|
||||
|
||||
* gtk/gtkentrycompletion.c (_gtk_entry_completion_popup):
|
||||
Don't popup the completions if the focus has already been
|
||||
moved somewhere else. (#319914, Christian Persch)
|
||||
|
||||
@@ -127,6 +127,7 @@ get_slider_button (GtkPathBar *path_bar,
|
||||
gtk_widget_push_composite_child ();
|
||||
|
||||
button = gtk_button_new ();
|
||||
gtk_button_set_focus_on_click (button, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (button), gtk_arrow_new (arrow_type, GTK_SHADOW_OUT));
|
||||
gtk_container_add (GTK_CONTAINER (path_bar), button);
|
||||
gtk_widget_show_all (button);
|
||||
@@ -732,9 +733,9 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
|
||||
|
||||
if (path_bar->timer)
|
||||
{
|
||||
if (GTK_WIDGET_HAS_FOCUS (path_bar->up_slider_button))
|
||||
if (path_bar->scrolling_up)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
else if (GTK_WIDGET_HAS_FOCUS (path_bar->down_slider_button))
|
||||
else
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
|
||||
if (path_bar->need_timer)
|
||||
@@ -772,18 +773,21 @@ gtk_path_bar_slider_button_press (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
GtkPathBar *path_bar)
|
||||
{
|
||||
if (!GTK_WIDGET_HAS_FOCUS (widget))
|
||||
gtk_widget_grab_focus (widget);
|
||||
|
||||
if (event->type != GDK_BUTTON_PRESS || event->button != 1)
|
||||
return FALSE;
|
||||
|
||||
path_bar->ignore_click = FALSE;
|
||||
|
||||
if (widget == path_bar->up_slider_button)
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
{
|
||||
path_bar->scrolling_up = TRUE;
|
||||
gtk_path_bar_scroll_up (path_bar->up_slider_button, path_bar);
|
||||
}
|
||||
else if (widget == path_bar->down_slider_button)
|
||||
{
|
||||
path_bar->scrolling_up = FALSE;
|
||||
gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar);
|
||||
}
|
||||
|
||||
if (!path_bar->timer)
|
||||
{
|
||||
@@ -1149,6 +1153,7 @@ make_directory_button (GtkPathBar *path_bar,
|
||||
|
||||
button_data->type = find_button_type (path_bar, path);
|
||||
button_data->button = gtk_toggle_button_new ();
|
||||
gtk_button_set_focus_on_click (button_data->button, FALSE);
|
||||
|
||||
switch (button_data->type)
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ struct _GtkPathBar
|
||||
guint slider_visible : 1;
|
||||
guint need_timer : 1;
|
||||
guint ignore_click : 1;
|
||||
guint scrolling_up : 1;
|
||||
};
|
||||
|
||||
struct _GtkPathBarClass
|
||||
|
||||
@@ -12718,6 +12718,13 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
|
||||
&& (event->keyval == GDK_g || event->keyval == GDK_G))
|
||||
{
|
||||
gtk_tree_view_search_move (widget, tree_view, TRUE);
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
/* select next matching iter */
|
||||
if (event->keyval == GDK_Down || event->keyval == GDK_KP_Down)
|
||||
{
|
||||
@@ -12725,7 +12732,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
|
||||
retval = TRUE;
|
||||
}
|
||||
|
||||
if ((event->state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK
|
||||
if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
|
||||
&& (event->keyval == GDK_g || event->keyval == GDK_G))
|
||||
{
|
||||
gtk_tree_view_search_move (widget, tree_view, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user