// Implementation of QTreeFileStripe. #include <clientapi.h> #include <qcanvas.h> #include "qtreeitem.h" #include "changesorter.h" #include "filehead.h" #include "filelogcache.h" #include "clientchangeuser.h" #include "qtreechangenum.h" #include "qtreechangebar.h" #include "qtreerevtext.h" #include "qtreerevball.h" #include "qtreefiletext.h" #include "qtreefilestripe.h" QTreeFileStripe::QTreeFileStripe ( QCanvas* canvas, FileHead* file, int width, int y, char col, bool trunc ) : QCanvasRectangle( canvas ), filehead( file ), stripecolor( col ) { setZ( TREE_ZSTRIPE ); filehead = file; setSize( width, TREE_STRIPEHEIGHT ); setPen( QPen::NoPen ); move( 0, y ); filetext = new QTreeFileText( canvas, file->name.Text(), file ); int vspace = TREE_STRIPEHEIGHT - filetext->boundingRect().height(); filetext->move( 0, y + vspace ); filetext->show(); revballs = new QTreeRevBall*[file->size]; FileRev* filer = file->head; for ( int a = 0; a < file->size; a++ ) { if ( filer->change.Length() && ( !trunc || filer->hasarrow ) ) { revballs[a] = new QTreeRevBall( canvas, filer, y, vspace, trunc ); revballs[a]->show(); } else revballs[a] = NULL; filer = filer->next; } } QTreeFileStripe::~QTreeFileStripe() { } void QTreeFileStripe::MoveY( double y ) { double dy = y - this->y(); for ( int rb = 0 ; rb < filehead->size ; rb++ ) { revballs[rb]->moveBy( 0, dy ); revballs[rb]->revtext->moveBy( 0, dy ); } filetext->moveBy( 0, dy ); moveBy( 0, dy ); } void QTreeFileStripe::UpdateBrush() { switch ( stripecolor ) { case 'A': setBrush( QBrush( QColor( TREE_COLSTRIPEA ) ) ); break; case 'B': setBrush( QBrush( QColor( TREE_COLSTRIPEB ) ) ); break; case 'M': setBrush( QBrush( QColor( TREE_COLSTRIPEM ) ) ); break; } for ( FileRev* fr = filehead->head ; fr ; fr = fr->next ) { if ( fr->revball ) fr->revball->UpdateBrush(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 4422 | Sam Stafford |
Finished implementing alphabetical sort. Along the way, I gained new appreciation for the OpenGL canvas system I implemented for Revision Graph, for it is vastly superior to this QCanvas crud in many ways. Might go ahead and implement this in Revision Graph just to marvel at how many fewer lines of new code it takes. Turn on alphabetical sort by adding the "-n" option to the command line ("-n" for "name sort"). This feature is not accessible from the settings dialog, nor does it persist after a refresh, but it DOES stack with "-o outputfile", which as far as I know is all that anyone needs. |
||
#1 | 2377 | Sam Stafford | P4QTree. |