Changeset 9900


Ignore:
Timestamp:
Jan 10, 2010, 1:43:04 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #2739 "the status bar oscillates ostensibly" -- implemented for 1.80

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-window.c

    r9857 r9900  
    9090    GtkWidget *           status;
    9191    GtkWidget *           status_menu;
    92     GtkWidget *           ul_hbox;
    93     GtkWidget *           dl_hbox;
    9492    GtkWidget *           ul_lb;
    9593    GtkWidget *           dl_lb;
     
    969967        gtk_box_pack_start( GTK_BOX( h ), w, 1, 1, GUI_PAD_BIG );
    970968
    971         hbox = p->ul_hbox = gtk_hbox_new( FALSE, GUI_PAD_SMALL );
     969        hbox = gtk_hbox_new( FALSE, GUI_PAD_SMALL );
    972970            w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    973971            gtk_widget_set_size_request( w, GUI_PAD, 0u );
     
    979977        gtk_box_pack_end( GTK_BOX( h ), hbox, FALSE, FALSE, 0 );
    980978
    981         hbox = p->dl_hbox = gtk_hbox_new( FALSE, GUI_PAD_SMALL );
     979        hbox = gtk_hbox_new( FALSE, GUI_PAD_SMALL );
    982980            w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    983981            gtk_widget_set_size_request( w, GUI_PAD, 0u );
     
    10571055    }
    10581056
     1057    {
     1058        int w=0, h=0;
     1059        /* this is to determine the maximum width/height for the label */
     1060        PangoLayout * pango_layout =
     1061            gtk_widget_create_pango_layout( p->ul_lb, _( "999.9 KB/s" ) );
     1062        pango_layout_get_pixel_size( pango_layout, &w, &h );
     1063        g_message( "w %d h %d", w, h );
     1064        gtk_widget_set_size_request( p->ul_lb, w, h );
     1065        gtk_widget_set_size_request( p->dl_lb, w, h );
     1066        gtk_misc_set_alignment( GTK_MISC( p->ul_lb ), 1.0, 0.5 );
     1067        gtk_misc_set_alignment( GTK_MISC( p->dl_lb ), 1.0, 0.5 );
     1068        g_object_unref( G_OBJECT( pango_layout ) );
     1069    }
     1070
    10591071    /* show all but the window */
    10601072    gtk_widget_show_all( vbox );
     
    11771189        tr_strlspeed( buf, down, sizeof( buf ) );
    11781190        gtk_label_set_text( GTK_LABEL( p->dl_lb ), buf );
    1179         g_object_set( p->dl_hbox, "visible", down>0, NULL );
    11801191
    11811192        tr_strlspeed( buf, up, sizeof( buf ) );
    11821193        gtk_label_set_text( GTK_LABEL( p->ul_lb ), buf );
    1183         g_object_set( p->ul_hbox, "visible", up>0, NULL );
    11841194    }
    11851195}
Note: See TracChangeset for help on using the changeset viewer.