diff options
author | raveit65 <[email protected]> | 2016-07-04 16:27:38 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-07-11 22:28:14 +0200 |
commit | a81b01d93ce1b197d36a1b3be2799d63237287f5 (patch) | |
tree | df9e4f90e8cbd9531b3e562ee34f5fd1e84eebcb | |
parent | f77ad856edec429eb91062d81ebf567f52a27346 (diff) | |
download | caja-a81b01d93ce1b197d36a1b3be2799d63237287f5.tar.bz2 caja-a81b01d93ce1b197d36a1b3be2799d63237287f5.tar.xz |
location-bar: don't pack an useless box in the bar
The bar is an horizontal box already, no need to pack another hbox in
it. This also fixes content not expanding in the available width, as
noted in https://bugzilla.gnome.org/show_bug.cgi?id=654389.
taken from:
https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-2&id=7596049
-rw-r--r-- | src/caja-location-bar.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c index 036a42c1..2a48b083 100644 --- a/src/caja-location-bar.c +++ b/src/caja-location-bar.c @@ -59,10 +59,6 @@ static const char untranslated_go_to_label[] = N_("Go To:"); #define LOCATION_LABEL _(untranslated_location_label) #define GO_TO_LABEL _(untranslated_go_to_label) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - struct CajaLocationBarDetails { GtkLabel *label; @@ -492,7 +488,6 @@ caja_location_bar_init (CajaLocationBar *bar) GtkWidget *label; GtkWidget *entry; GtkWidget *event_box; - GtkWidget *hbox; bar->details = G_TYPE_INSTANCE_GET_PRIVATE (bar, CAJA_TYPE_LOCATION_BAR, CajaLocationBarDetails); @@ -500,8 +495,6 @@ caja_location_bar_init (CajaLocationBar *bar) gtk_orientable_set_orientation (GTK_ORIENTABLE (bar), GTK_ORIENTATION_HORIZONTAL); - hbox = gtk_hbox_new (0, FALSE); - event_box = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (event_box), FALSE); @@ -518,7 +511,7 @@ caja_location_bar_init (CajaLocationBar *bar) g_signal_connect (label, "style_set", G_CALLBACK (style_set_handler), NULL); - gtk_box_pack_start (GTK_BOX (hbox), event_box, FALSE, TRUE, 4); + gtk_box_pack_start (GTK_BOX (bar), event_box, FALSE, TRUE, 4); entry = caja_location_entry_new (); @@ -527,13 +520,10 @@ caja_location_bar_init (CajaLocationBar *bar) g_signal_connect_object (entry, "changed", G_CALLBACK (editable_changed_callback), bar, 0); - gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (bar), entry, TRUE, TRUE, 0); eel_accessibility_set_up_label_widget_relation (label, entry); - gtk_container_add (GTK_CONTAINER (bar), hbox); - - /* Label context menu */ g_signal_connect (event_box, "button-press-event", G_CALLBACK (label_button_pressed_callback), NULL); @@ -554,10 +544,10 @@ caja_location_bar_init (CajaLocationBar *bar) g_signal_connect (bar, "drag_data_received", G_CALLBACK (drag_data_received_callback), NULL); - gtk_widget_show_all (hbox); - bar->details->label = GTK_LABEL (label); bar->details->entry = CAJA_ENTRY (entry); + + gtk_widget_show_all (GTK_WIDGET (bar)); } GtkWidget * |