[patch] [bug 326774] don't focus path bar buttons on click
- From: Christian Persch <chpe gnome org>
- To: nautilus-list gnome org
- Subject: [patch] [bug 326774] don't focus path bar buttons on click
- Date: Tue, 24 Jul 2007 13:00:41 +0200
Hi;
The path bar and the path bar/url entry toggle, the ViewAs combo, and
the zoom control, all are in what looks like a toolbar--- but isn't one.
IMHO they should also act like they were toolbar buttons, i.e. not focus
on click. Attached patch from
http://bugzilla.gnome.org/show_bug.cgi?id=326774 does that; ok to
commit?
Regards,
Christian
Index: src/nautilus-navigation-window.c
===================================================================
--- src/nautilus-navigation-window.c (révision 13011)
+++ src/nautilus-navigation-window.c (copie de travail)
@@ -179,6 +178,7 @@ location_button_create (NautilusNavigati
button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
"image", image,
+ "focus-on-click", FALSE,
"active", location_button_should_be_active (window),
NULL);
@@ -315,6 +315,7 @@ nautilus_navigation_window_init (Nautilu
item, -1);
window->view_as_combo_box = gtk_combo_box_new_text ();
+ gtk_combo_box_set_focus_on_click (GTK_COMBO_BOX (window->view_as_combo_box), FALSE);
gtk_box_pack_end (GTK_BOX (view_as_menu_vbox), window->view_as_combo_box, TRUE, FALSE, 0);
gtk_widget_show (window->view_as_combo_box);
g_signal_connect_object (window->view_as_combo_box, "changed",
Index: src/nautilus-pathbar.c
===================================================================
--- src/nautilus-pathbar.c (révision 13010)
+++ src/nautilus-pathbar.c (copie de travail)
@@ -150,6 +150,7 @@ get_slider_button (NautilusPathBar *pat
gtk_widget_push_composite_child ();
button = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (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);
@@ -1330,6 +1331,7 @@ make_directory_button (NautilusPathBar
button_data->type = find_button_type (path_bar, path, button_data);
button_data->button = gtk_toggle_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (button_data->button), FALSE);
switch (button_data->type) {
case ROOT_BUTTON:
Index: src/nautilus-zoom-control.c
===================================================================
--- src/nautilus-zoom-control.c (révision 13010)
+++ src/nautilus-zoom-control.c (copie de travail)
@@ -114,7 +114,6 @@ static void
nautilus_zoom_control_finalize (GObject *object)
{
g_list_free (NAUTILUS_ZOOM_CONTROL (object)->details->preferred_zoom_levels);
- g_free (NAUTILUS_ZOOM_CONTROL (object)->details);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -278,7 +277,7 @@ nautilus_zoom_control_instance_init (Nau
GtkWidget *image;
int i;
- zoom_control->details = g_new0 (NautilusZoomControlDetails, 1);
+ zoom_control->details = G_TYPE_INSTANCE_GET_PRIVATE (zoom_control, NAUTILUS_TYPE_ZOOM_CONTROL, NautilusZoomControlDetails);
zoom_control->details->zoom_level = NAUTILUS_ZOOM_LEVEL_STANDARD;
zoom_control->details->min_zoom_level = NAUTILUS_ZOOM_LEVEL_SMALLEST;
@@ -294,6 +293,7 @@ nautilus_zoom_control_instance_init (Nau
image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_OUT, GTK_ICON_SIZE_MENU);
zoom_control->details->zoom_out = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_out), FALSE);
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_out),
GTK_RELIEF_NONE);
g_signal_connect (G_OBJECT (zoom_control->details->zoom_out),
@@ -304,6 +304,7 @@ nautilus_zoom_control_instance_init (Nau
zoom_control->details->zoom_out, FALSE, FALSE, 0);
zoom_control->details->zoom_button = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_button), FALSE);
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_button),
GTK_RELIEF_NONE);
@@ -339,6 +340,7 @@ nautilus_zoom_control_instance_init (Nau
image = gtk_image_new_from_stock (GTK_STOCK_ZOOM_IN, GTK_ICON_SIZE_MENU);
zoom_control->details->zoom_in = gtk_button_new ();
+ gtk_button_set_focus_on_click (GTK_BUTTON (zoom_control->details->zoom_in), FALSE);
gtk_button_set_relief (GTK_BUTTON (zoom_control->details->zoom_in),
GTK_RELIEF_NONE);
g_signal_connect (G_OBJECT (zoom_control->details->zoom_in),
@@ -714,6 +716,8 @@ nautilus_zoom_control_class_init (Nautil
"change_value",
1, GTK_TYPE_SCROLL_TYPE,
GTK_SCROLL_STEP_UP);
+
+ g_type_class_add_private (G_OBJECT_CLASS (class), sizeof (NautilusZoomControlDetails));
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]