Changeset 11074
- Timestamp:
- Jul 31, 2010, 3:43:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/torrent-cell-renderer.c
r10937 r11074 540 540 GtkCellRendererState flags ) 541 541 { 542 int w, h;543 542 GdkRectangle icon_area; 544 543 GdkRectangle name_area; … … 562 561 status = getShortStatusString( tor, st, p->upload_speed_KBps, p->download_speed_KBps ); 563 562 564 /* get the cell dimensions */565 g_object_set( p->icon_renderer, "pixbuf", icon, NULL );566 gtk_cell_renderer_get_size( p->icon_renderer, widget, NULL, NULL, NULL, &w, &h );567 icon_area.width = w;568 icon_area.height = h;569 text_renderer = get_text_renderer( st, cell );570 g_object_set( text_renderer, "text", name, "ellipsize", PANGO_ELLIPSIZE_NONE, "scale", 1.0, NULL );571 gtk_cell_renderer_get_size( text_renderer, widget, NULL, NULL, NULL, &w, &h );572 name_area.width = w;573 name_area.height = h;574 g_object_set( text_renderer, "text", status, "scale", SMALL_SCALE, NULL );575 gtk_cell_renderer_get_size( text_renderer, widget, NULL, NULL, NULL, &w, &h );576 stat_area.width = w;577 stat_area.height = h;578 prog_area.height = p->bar_height;579 580 h = 1;581 h = MAX( h, stat_area.height );582 h = MAX( h, name_area.height );583 h = MAX( h, icon_area.height );584 h = MAX( h, prog_area.height );585 586 /**587 *** LAYOUT588 **/589 590 563 fill_area = *background_area; 591 564 fill_area.x += cell->parent.xpad; … … 593 566 fill_area.width -= cell->parent.xpad * 2; 594 567 fill_area.height -= cell->parent.ypad * 2; 595 596 /* icon */ 568 icon_area = name_area = stat_area = prog_area = fill_area; 569 570 g_object_set( p->icon_renderer, "pixbuf", icon, NULL ); 571 gtk_cell_renderer_get_size( p->icon_renderer, widget, NULL, NULL, NULL, &icon_area.width, NULL ); 572 text_renderer = get_text_renderer( st, cell ); 573 g_object_set( text_renderer, "text", name, "ellipsize", PANGO_ELLIPSIZE_NONE, "scale", 1.0, NULL ); 574 gtk_cell_renderer_get_size( text_renderer, widget, NULL, NULL, NULL, &name_area.width, NULL ); 575 g_object_set( text_renderer, "text", status, "scale", SMALL_SCALE, NULL ); 576 gtk_cell_renderer_get_size( text_renderer, widget, NULL, NULL, NULL, &stat_area.width, NULL ); 577 597 578 icon_area.x = fill_area.x; 598 icon_area.y = fill_area.y;599 icon_area.height = h;600 601 /* progressbar */602 579 prog_area.x = fill_area.x + fill_area.width - BAR_WIDTH; 603 prog_area.y = fill_area.y;604 580 prog_area.width = BAR_WIDTH; 605 prog_area.height = h;606 607 /* short status (right justified) */608 581 stat_area.x = prog_area.x - GUI_PAD - stat_area.width; 609 stat_area.y = fill_area.y + ( h - stat_area.height ) / 2;610 611 /* name */612 582 name_area.x = icon_area.x + icon_area.width + GUI_PAD; 613 name_area.y = fill_area.y + ( h - name_area.height ) / 2;583 name_area.y = fill_area.y; 614 584 name_area.width = stat_area.x - GUI_PAD - name_area.x; 615 585
Note: See TracChangeset
for help on using the changeset viewer.