Changeset 11741


Ignore:
Timestamp:
Jan 21, 2011, 5:31:35 PM (11 years ago)
Author:
jordan
Message:

(trunk gtk) set GtkLabel?'s "single-line-mode" flag to TRUE in the toolbar, in the stats dialog, and in the details dialog's info tab.

According to the GTK+ documentation, this "can be an advantage in situations where resizing the label because of text changes would be distracting, e.g. in a statusbar." It doesn't seem to prevent relayout in GTK+ 2.20.1, but maybe other versions of GTK+ will make better use of the flag.

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r11738 r11741  
    940940        /* size */
    941941        l = di->size_lb = gtk_label_new( NULL );
     942        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    942943        hig_workarea_add_row( t, &row, _( "Torrent size:" ), l, NULL );
    943944
    944945        /* have */
    945946        l = di->have_lb = gtk_label_new( NULL );
     947        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    946948        hig_workarea_add_row( t, &row, _( "Have:" ), l, NULL );
    947949
    948950        /* downloaded */
    949951        l = di->dl_lb = gtk_label_new( NULL );
     952        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    950953        hig_workarea_add_row( t, &row, _( "Downloaded:" ), l, NULL );
    951954
    952955        /* uploaded */
    953956        l = di->ul_lb = gtk_label_new( NULL );
     957        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    954958        hig_workarea_add_row( t, &row, _( "Uploaded:" ), l, NULL );
    955959
    956960        /* state */
    957961        l = di->state_lb = gtk_label_new( NULL );
     962        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    958963        hig_workarea_add_row( t, &row, _( "State:" ), l, NULL );
    959964
    960965        /* running for */
    961966        l = di->date_started_lb = gtk_label_new( NULL );
     967        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    962968        hig_workarea_add_row( t, &row, _( "Running time:" ), l, NULL );
    963969
    964970        /* eta */
    965971        l = di->eta_lb = gtk_label_new( NULL );
     972        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    966973        hig_workarea_add_row( t, &row, _( "Remaining time:" ), l, NULL );
    967974
    968975        /* last activity */
    969976        l = di->last_activity_lb = gtk_label_new( NULL );
     977        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    970978        hig_workarea_add_row( t, &row, _( "Last activity:" ), l, NULL );
    971979
     
    9971005        /* privacy */
    9981006        l = gtk_label_new( NULL );
     1007        gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    9991008        hig_workarea_add_row( t, &row, _( "Privacy:" ), l, NULL );
    10001009        di->privacy_lb = l;
  • trunk/gtk/stats.c

    r11738 r11741  
    161161    hig_workarea_add_section_title( t, &row, _( "Current Session" ) );
    162162    l = ui->one_up_lb = gtk_label_new( NULL );
     163    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    163164    hig_workarea_add_row( t, &row, _( "Uploaded:" ), l, NULL );
    164165    l = ui->one_down_lb = gtk_label_new( NULL );
     166    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    165167    hig_workarea_add_row( t, &row, _( "Downloaded:" ), l, NULL );
    166168    l = ui->one_ratio_lb = gtk_label_new( NULL );
     169    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    167170    hig_workarea_add_row( t, &row, _( "Ratio:" ), l, NULL );
    168171    l = ui->one_time_lb = gtk_label_new( NULL );
     172    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    169173    hig_workarea_add_row( t, &row, _( "Duration:" ), l, NULL );
    170174    hig_workarea_add_section_divider( t, &row );
    171175    hig_workarea_add_section_title( t, &row, _( "Total" ) );
    172176    l = ui->all_sessions_lb = gtk_label_new( _( "Started %'d time" ) );
     177    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    173178    hig_workarea_add_label_w( t, row++, l );
    174179    l = ui->all_up_lb = gtk_label_new( NULL );
     180    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    175181    hig_workarea_add_row( t, &row, _( "Uploaded:" ), l, NULL );
    176182    l = ui->all_down_lb = gtk_label_new( NULL );
     183    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    177184    hig_workarea_add_row( t, &row, _( "Downloaded:" ), l, NULL );
    178185    l = ui->all_ratio_lb = gtk_label_new( NULL );
     186    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    179187    hig_workarea_add_row( t, &row, _( "Ratio:" ), l, NULL );
    180188    l = ui->all_time_lb = gtk_label_new( NULL );
     189    gtk_label_set_single_line_mode( GTK_LABEL( l ), TRUE );
    181190    hig_workarea_add_row( t, &row, _( "Duration:" ), l, NULL );
    182191    hig_workarea_finish( t, &row );
  • trunk/gtk/tr-window.c

    r11740 r11741  
    657657
    658658        w = p->gutter_lb = gtk_label_new( "N Torrents" );
     659        gtk_label_set_single_line_mode( GTK_LABEL( w ), TRUE );
    659660        gtk_box_pack_start( GTK_BOX( h ), w, 1, 1, GUI_PAD );
    660661
     
    664665            gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    665666            w = p->ul_lb = gtk_label_new( NULL );
     667            gtk_label_set_single_line_mode( GTK_LABEL( w ), TRUE );
    666668            gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    667669            w = gtk_image_new_from_stock( GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU );
     
    674676            gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    675677            w = p->dl_lb = gtk_label_new( NULL );
     678            gtk_label_set_single_line_mode( GTK_LABEL( w ), TRUE );
    676679            gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    677680            w = gtk_image_new_from_stock( GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU );
     
    687690            gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    688691            w = p->stats_lb = gtk_label_new( NULL );
     692            gtk_label_set_single_line_mode( GTK_LABEL( w ), TRUE );
    689693            gtk_box_pack_end( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
    690694        gtk_box_pack_end( GTK_BOX( h ), hbox, FALSE, FALSE, 0 );
Note: See TracChangeset for help on using the changeset viewer.