Changeset 7994


Ignore:
Timestamp:
Mar 2, 2009, 11:28:45 PM (13 years ago)
Author:
charles
Message:

(1.5x gtk) #1886: faster main window renderering in gtk client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/gtk/tr-window.c

    r7664 r7994  
    148148    view = gtk_tree_view_new( );
    149149    gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
     150    gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW( view ), TRUE );
    150151
    151152    p->selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
    152153
     154    p->column = col = GTK_TREE_VIEW_COLUMN (g_object_new (GTK_TYPE_TREE_VIEW_COLUMN,                 
     155        "title", _("Torrent"),
     156        "resizable", TRUE,
     157        "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
     158        NULL));
     159
    153160    p->renderer = r = torrent_cell_renderer_new( );
    154     p->column = col = gtk_tree_view_column_new_with_attributes(
    155                     _( "Torrent" ), r, "torrent", MC_TORRENT_RAW, NULL );
    156     g_object_set( G_OBJECT( col ), "resizable", TRUE,
    157                   "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
    158                   NULL );
     161    gtk_tree_view_column_pack_start( col, r, FALSE );
     162    gtk_tree_view_column_add_attribute( col, r, "torrent", MC_TORRENT_RAW );
     163   
    159164    gtk_tree_view_append_column( GTK_TREE_VIEW( view ), col );
    160165    g_object_set( r, "xpad", GUI_PAD_SMALL, "ypad", GUI_PAD_SMALL, NULL );
     
    199204    {
    200205        g_object_set( p->renderer, "minimal", pref_flag_get( key ), NULL );
    201         gtk_tree_view_column_queue_resize( p->column );
    202         gtk_widget_queue_draw( p->view );
     206        /* since the cell size has changed, we need gtktreeview to revalidate
     207         * its fixed-height mode values.  Unfortunately there's not an API call
     208         * for that, but it *does* revalidate when it thinks the style's been tweaked */
     209        g_signal_emit_by_name( p->view, "style-set", NULL, NULL );
    203210    }
    204211    else if( !strcmp( key, PREF_KEY_STATUSBAR ) )
Note: See TracChangeset for help on using the changeset viewer.