X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-sidebar.c;h=f687d10f4dc379ac38e061021b4370fbb37a654a;hb=0b77ab6efe83e32698b0f1390916c1a7d7738261;hp=3f296075a84c7e9fb9e382da0cbb4da6c1346de8;hpb=e6e647fb236b236df1399ff4dba8faf0172002a1;p=evince.git diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c index 3f296075..f687d10f 100644 --- a/shell/ev-sidebar.c +++ b/shell/ev-sidebar.c @@ -45,7 +45,6 @@ enum struct _EvSidebarPrivate { GtkWidget *notebook; GtkWidget *menu; - GtkWidget *frame; GtkWidget *hbox; GtkWidget *label; @@ -116,6 +115,15 @@ ev_sidebar_select_button_press_cb (GtkWidget *widget, EvSidebar *ev_sidebar = EV_SIDEBAR (user_data); if (event->button == 1) { + GtkRequisition requisition; + gint width; + + width = widget->allocation.width; + gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1); + gtk_widget_size_request (ev_sidebar->priv->menu, &requisition); + gtk_widget_set_size_request (ev_sidebar->priv->menu, + MAX (width, requisition.width), -1); + gtk_widget_grab_focus (widget); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); @@ -215,7 +223,6 @@ ev_sidebar_menu_item_activate_cb (GtkWidget *widget, static void ev_sidebar_init (EvSidebar *ev_sidebar) { - GtkWidget *frame; GtkWidget *hbox; GtkWidget *close_button; GtkWidget *select_button; @@ -234,14 +241,9 @@ ev_sidebar_init (EvSidebar *ev_sidebar) G_TYPE_INT); /* top option menu */ - frame = gtk_frame_new (NULL); - ev_sidebar->priv->frame = frame; - gtk_box_pack_start (GTK_BOX (ev_sidebar), frame, FALSE, FALSE, 0); - gtk_widget_show (frame); - hbox = gtk_hbox_new (FALSE, 0); ev_sidebar->priv->hbox = hbox; - gtk_container_add (GTK_CONTAINER (frame), hbox); + gtk_box_pack_start (GTK_BOX (ev_sidebar), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); select_button = gtk_toggle_button_new ();