# HG changeset patch # User Chris Cannam # Date 1306254091 -3600 # Node ID ef31a55c86b604f9b39e6a35e5991e9a2f44c324 # Parent 496f2042155aa75366defb615f1e600747f518be Add little yellow star to current item diff -r 496f2042155a -r ef31a55c86b6 easyhg.qrc --- a/easyhg.qrc Tue May 24 16:54:24 2011 +0100 +++ b/easyhg.qrc Tue May 24 17:21:31 2011 +0100 @@ -22,6 +22,7 @@ images/hdd_unmount.png images/hdd_unmount-64.png images/fileopen.png + images/star.png images/easyhg-icon.png easyhg.py easyhg_en.qm diff -r 496f2042155a -r ef31a55c86b6 images/star.png Binary file images/star.png has changed diff -r 496f2042155a -r ef31a55c86b6 src/changesetitem.cpp --- a/src/changesetitem.cpp Tue May 24 16:54:24 2011 +0100 +++ b/src/changesetitem.cpp Tue May 24 17:21:31 2011 +0100 @@ -33,6 +33,8 @@ #include #include +QImage *ChangesetItem::m_star = 0; + ChangesetItem::ChangesetItem(Changeset *cs) : m_changeset(cs), m_detail(0), m_showBranch(false), m_column(0), m_row(0), m_wide(false), @@ -43,6 +45,8 @@ m_font.setBold(false); m_font.setItalic(false); setCursor(Qt::ArrowCursor); + + if (!m_star) m_star = new QImage(":images/star.png"); } QString @@ -385,6 +389,14 @@ paint->setBrush(Qt::NoBrush); paint->drawRoundedRect(r, 7, 7); + if (m_current && showProperLines) { + paint->setRenderHint(QPainter::SmoothPixmapTransform, true); + int starSize = fh * 1.5; + paint->drawImage(QRectF(x0 + width - starSize, + -fh, starSize, starSize), + *m_star); + } + if (m_showBranch) { // write branch name paint->save(); @@ -444,6 +456,22 @@ int x0 = -size/2 + 25; paint->setBrush(Qt::white); + + if (showProperLines) { + + if (m_current) { + paint->drawEllipse(QRectF(x0 - 4, fh - 4, size + 8, size + 8)); + } + + if (m_new) { + paint->save(); + paint->setPen(Qt::yellow); + paint->setBrush(Qt::NoBrush); + paint->drawEllipse(QRectF(x0 - 2, fh - 2, size + 4, size + 4)); + paint->restore(); + } + } + paint->drawEllipse(QRectF(x0, fh, size, size)); if (m_showBranch) { @@ -461,6 +489,14 @@ paint->restore(); } + if (m_current && showProperLines) { + paint->setRenderHint(QPainter::SmoothPixmapTransform, true); + int starSize = fh * 1.5; + paint->drawImage(QRectF(x0 + size - starSize/2, + 0, starSize, starSize), + *m_star); + } + paint->restore(); } diff -r 496f2042155a -r ef31a55c86b6 src/changesetitem.h --- a/src/changesetitem.h Tue May 24 16:54:24 2011 +0100 +++ b/src/changesetitem.h Tue May 24 17:21:31 2011 +0100 @@ -25,6 +25,7 @@ class ChangesetDetailItem; class QAction; +class QImage; class ChangesetItem : public QGraphicsObject { @@ -101,6 +102,8 @@ QMap m_parentDiffActions; QMap m_summaryActions; + static QImage *m_star; + bool isMerge() const; virtual void paintNormal(QPainter *); virtual void paintMerge(QPainter *); diff -r 496f2042155a -r ef31a55c86b6 src/connectionitem.cpp --- a/src/connectionitem.cpp Tue May 24 16:54:24 2011 +0100 +++ b/src/connectionitem.cpp Tue May 24 17:21:31 2011 +0100 @@ -42,7 +42,7 @@ return QRectF(xscale * c_col + size/2 - 2, yscale * c_row + size - 22, - xscale * p_col - xscale * c_col + 4, + xscale * p_col - xscale * c_col + 6, yscale * p_row - yscale * c_row - size + 44) .normalized(); }