# HG changeset patch # User Chris Cannam # Date 1320945546 0 # Node ID b5a342a71218f6c9e74eaa521d37af23cf77fdb8 # Parent a17c06f773cde7ad60785b13d7356c8e60f81777 Bookmarks display now... OK diff -r a17c06f773cd -r b5a342a71218 src/changeset.cpp --- a/src/changeset.cpp Wed Nov 09 13:04:00 2011 +0000 +++ b/src/changeset.cpp Thu Nov 10 17:19:06 2011 +0000 @@ -82,7 +82,8 @@ << QObject::tr("Author:") << QObject::tr("Date:") << QObject::tr("Branch:") - << QObject::tr("Tag:") + << QObject::tr("Tags:") + << QObject::tr("Bookmarks:") << QObject::tr("Comment:"); for (int i = 0; i < propNames.size(); ++i) { diff -r a17c06f773cd -r b5a342a71218 src/changesetitem.cpp --- a/src/changesetitem.cpp Wed Nov 09 13:04:00 2011 +0000 +++ b/src/changesetitem.cpp Thu Nov 10 17:19:06 2011 +0000 @@ -338,6 +338,40 @@ int height = (lineCount + 1) * fh + 2; QRectF r(x0, 0, width - 3, height); + QColor textColour = Qt::black; + textColour.setAlpha(alpha); + + if (m_showBranch && showText) { + // write branch name + paint->save(); + f.setBold(true); + paint->setFont(f); + paint->setPen(QPen(branchColour)); + QString branch = m_changeset->branch(); + if (branch == "") branch = "default"; + int wid = width - 3; + branch = TextAbbrev::abbreviate(branch, QFontMetrics(f), wid); + paint->drawText(x0, -fh + fm.ascent() - 4, branch); + f.setBold(false); + paint->restore(); + } + + QStringList bookmarks = m_changeset->bookmarks(); + if (!bookmarks.empty() && showText) { + QString bmText = bookmarks.join(" ").trimmed(); + int bw = fm.width(bmText); + int bx = x0 + width - bw - 14; + if (m_current) bx = bx - fh*1.5 + 3; + paint->save(); + paint->setPen(QPen(branchColour, 2)); +// paint->setBrush(QBrush(Qt::white)); + paint->setBrush(QBrush(branchColour)); + paint->drawRoundedRect(QRectF(bx, -fh - 4, bw + 4, fh * 2), 5, 5); + paint->setPen(QPen(Qt::white)); + paint->drawText(bx + 2, -fh + fm.ascent() - 4, bmText); + paint->restore(); + } + if (showProperLines) { if (m_new) { @@ -380,9 +414,6 @@ fm, textwid); paint->drawText(x0 + 3, fm.ascent(), person); - QColor textColour = Qt::black; - textColour.setAlpha(alpha); - paint->setPen(QPen(textColour)); QStringList tags = m_changeset->tags(); @@ -407,32 +438,6 @@ } } - if (m_showBranch) { - // write branch name - paint->save(); - f.setBold(true); - paint->setFont(f); - paint->setPen(QPen(branchColour)); - QString branch = m_changeset->branch(); - if (branch == "") branch = "default"; - int wid = width - 3; - branch = TextAbbrev::abbreviate(branch, QFontMetrics(f), wid); - paint->drawText(x0, -fh + fm.ascent() - 4, branch); - f.setBold(false); - paint->restore(); - } - - QStringList bookmarks = m_changeset->bookmarks(); - if (!bookmarks.empty()) { - QString bmText = bookmarks.join(" ").trimmed(); - int bw = fm.width(bmText); - paint->fillRect(QRectF(x0 + width - fh*2 - bw, -fh - 4, - bw + 4, fh - 1), - QBrush(Qt::yellow)); - paint->drawText(x0 + width - fh*2 - bw + 2, - -fh + fm.ascent() - 4, bmText); - } - paint->setPen(QPen(branchColour, 2)); paint->setBrush(Qt::NoBrush); paint->drawRoundedRect(r, 7, 7); diff -r a17c06f773cd -r b5a342a71218 src/mainwindow.cpp --- a/src/mainwindow.cpp Wed Nov 09 13:04:00 2011 +0000 +++ b/src/mainwindow.cpp Thu Nov 10 17:19:06 2011 +0000 @@ -2227,7 +2227,7 @@ void MainWindow::commandCompleted(HgAction completedAction, QString output) { - std::cerr << "commandCompleted: " << completedAction.action << std::endl; +// std::cerr << "commandCompleted: " << completedAction.action << std::endl; restoreFileSystemWatcher(); HGACTIONS action = completedAction.action;