Changeset 4729


Ignore:
Timestamp:
Jan 17, 2008, 6:03:59 PM (14 years ago)
Author:
charles
Message:

(gtk 1.0x) #632 combine the two status bars

Location:
branches/1.0x/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0x/gtk/tr_window.c

    r4700 r4729  
    461461    gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 );
    462462
    463     /* status menu */
    464     menu = p->status_menu = gtk_menu_new( );
    465     status_stats_mode = 0;
    466     l = NULL;
    467     pch = pref_string_get( PREF_KEY_STATUS_BAR_STATS );
    468     for( i=0, n=G_N_ELEMENTS(stats_modes); i<n; ++i )
    469     {
    470         const char * val = stats_modes[i].val;
    471         w = gtk_radio_menu_item_new_with_label( l, _( stats_modes[i].i18n ) );
    472         l = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(w) );
    473         gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(w), !strcmp( val, pch ) );
    474         g_object_set_data( G_OBJECT(w), STATS_MODE, (gpointer)stats_modes[i].val );
    475         g_signal_connect( w, "toggled", G_CALLBACK(status_menu_toggled_cb), p );
    476         gtk_menu_shell_append( GTK_MENU_SHELL(menu), w );
    477         gtk_widget_show( w );
    478     }
    479     g_free( pch );
    480 
    481     /* statusbar */
    482     h = p->status = gtk_hbox_new( FALSE, GUI_PAD );
    483     gtk_container_set_border_width( GTK_CONTAINER(h), GUI_PAD );
    484      
    485     w = p->ul_lb = gtk_label_new( NULL );
    486     gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
    487     w = gtk_image_new_from_stock( GTK_STOCK_GO_UP, GTK_ICON_SIZE_SMALL_TOOLBAR );
    488     gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
    489     w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
    490     gtk_widget_set_usize( w, GUI_PAD, 0u );
    491     gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
    492     w = p->dl_lb = gtk_label_new( NULL );
    493     gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
    494     w = gtk_image_new_from_stock( GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_SMALL_TOOLBAR );
    495     gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
    496 
    497     w = gtk_image_new_from_stock( GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR );
    498     c = gtk_event_box_new( );
    499     gtk_container_add( GTK_CONTAINER(c), w );
    500     w = c;
    501     g_signal_connect( w, "button-release-event", G_CALLBACK(onYinYangReleased), p );
    502     gtk_box_pack_start( GTK_BOX(h), w, FALSE, FALSE, 0 );
    503     w = p->stats_lb = gtk_label_new( NULL );
    504     gtk_box_pack_start( GTK_BOX(h), w, FALSE, FALSE, 0 );
    505     gtk_box_pack_start( GTK_BOX(vbox), h, FALSE, FALSE, 0 );
    506 
    507     w = gtk_hseparator_new( );
    508     gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 );
    509 
    510463    /* filter */
    511464    toggles = NULL;
     
    533486    g_signal_connect( s, "changed", G_CALLBACK( filter_entry_changed ), p );
    534487
     488    w = gtk_hseparator_new( );
     489    gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 );
     490
     491    /* status menu */
     492    menu = p->status_menu = gtk_menu_new( );
     493    status_stats_mode = 0;
     494    l = NULL;
     495    pch = pref_string_get( PREF_KEY_STATUS_BAR_STATS );
     496    for( i=0, n=G_N_ELEMENTS(stats_modes); i<n; ++i )
     497    {
     498        const char * val = stats_modes[i].val;
     499        w = gtk_radio_menu_item_new_with_label( l, _( stats_modes[i].i18n ) );
     500        l = gtk_radio_menu_item_get_group( GTK_RADIO_MENU_ITEM(w) );
     501        gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM(w), !strcmp( val, pch ) );
     502        g_object_set_data( G_OBJECT(w), STATS_MODE, (gpointer)stats_modes[i].val );
     503        g_signal_connect( w, "toggled", G_CALLBACK(status_menu_toggled_cb), p );
     504        gtk_menu_shell_append( GTK_MENU_SHELL(menu), w );
     505        gtk_widget_show( w );
     506    }
     507    g_free( pch );
     508
     509    /* status */
     510    h = p->status = gtk_hbox_new( FALSE, GUI_PAD );
     511    gtk_container_set_border_width( GTK_CONTAINER( h ), GUI_PAD );
     512    w = p->gutter_lb = gtk_label_new( "N transfers" );
     513    gtk_box_pack_start( GTK_BOX(h), w, 0, 0, 0 );
     514    w = p->ul_lb = gtk_label_new( NULL );
     515    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     516    w = gtk_image_new_from_stock( GTK_STOCK_GO_UP, GTK_ICON_SIZE_SMALL_TOOLBAR );
     517    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     518    w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
     519    gtk_widget_set_usize( w, GUI_PAD, 0u );
     520    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     521    w = p->dl_lb = gtk_label_new( NULL );
     522    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     523    w = gtk_image_new_from_stock( GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_SMALL_TOOLBAR );
     524    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     525    w = gtk_alignment_new( 0.0f, 0.0f, 0.0f, 0.0f );
     526    gtk_widget_set_usize( w, GUI_PAD, 0u );
     527    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     528    w = p->stats_lb = gtk_label_new( NULL );
     529    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     530    w = gtk_image_new_from_stock( GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR );
     531    c = gtk_event_box_new( );
     532    gtk_container_add( GTK_CONTAINER(c), w );
     533    w = c;
     534    gtk_box_pack_end( GTK_BOX(h), w, FALSE, FALSE, 0 );
     535    g_signal_connect( w, "button-release-event", G_CALLBACK(onYinYangReleased), p );
     536    gtk_box_pack_start( GTK_BOX(vbox), h, FALSE, FALSE, 0 );
     537
    535538    menu = gtk_menu_new( );
    536539    l = NULL;
     
    547550    g_signal_connect( s, "icon-released", G_CALLBACK(entry_icon_released), menu );
    548551
    549 
    550552    /* workarea */
    551553    p->view = makeview( p, core );
     
    554556    gtk_box_pack_start_defaults( GTK_BOX(vbox), w );
    555557    gtk_container_set_focus_child( GTK_CONTAINER( vbox ), w );
    556 
    557     /* spacer */
    558     w = gtk_alignment_new (0.0f, 0.0f, 0.0f, 0.0f);
    559     gtk_widget_set_usize (w, 0u, 6u);
    560     gtk_box_pack_start( GTK_BOX(vbox), w, FALSE, FALSE, 0 );
    561 
    562     /* status */
    563     h = gtk_hbox_new( FALSE, GUI_PAD );
    564     w = p->gutter_lb = gtk_label_new( "N transfers" );
    565     gtk_box_pack_start_defaults( GTK_BOX(h), w );
    566     gtk_box_pack_start( GTK_BOX(vbox), h, FALSE, FALSE, 0 );
    567558
    568559    /* show all but the window */
  • branches/1.0x/gtk/ui.h

    r4318 r4729  
    2525"      <menuitem action='minimal-view'/>\n"
    2626"      <menuitem action='show-toolbar'/>\n"
     27"      <menuitem action='show-filter-bar'/>\n"
    2728"      <menuitem action='show-status-bar'/>\n"
    28 "      <menuitem action='show-filter-bar'/>\n"
    2929"      <separator/>\n"
    3030"      <menuitem action='sort-by-activity'/>\n"
Note: See TracChangeset for help on using the changeset viewer.