diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-11-07 20:10:04 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-11-07 20:10:04 +0000 |
commit | fb02547e1e9817c25bd2a3d5f832e4c42a733b54 (patch) | |
tree | 82778a5461f2d4a5e47fd2ebda95cfeb30a9aa74 /gtk/gtkpathbar.c | |
parent | 4309a349b5fbd21535be270a71f3d4f57da81490 (diff) | |
download | gtk+-fb02547e1e9817c25bd2a3d5f832e4c42a733b54.tar.gz |
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)
Diffstat (limited to 'gtk/gtkpathbar.c')
-rw-r--r-- | gtk/gtkpathbar.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index cfaff68000..ade55d2197 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -125,6 +125,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); @@ -730,9 +731,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) @@ -770,18 +771,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); + { + 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) - gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar); + { + path_bar->scrolling_up = FALSE; + gtk_path_bar_scroll_down (path_bar->down_slider_button, path_bar); + } if (!path_bar->timer) { @@ -1147,6 +1151,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) { |