From 5e3eb47e556c252d97a4b66dd031918e313d7901 Mon Sep 17 00:00:00 2001 From: Robert Loehning <robert.loehning@nokia.com> Date: Tue, 4 May 2010 17:24:29 +0200 Subject: [PATCH] Using bold underlined font for active git branch. --- src/plugins/git/branchmodel.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 301df702562..24ea0684c58 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -30,6 +30,7 @@ #include "branchmodel.h" #include "gitclient.h" +#include <QtGui/QFont> #include <QtCore/QDebug> #include <QtCore/QRegExp> #include <QtCore/QTimer> @@ -229,14 +230,16 @@ QVariant LocalBranchModel::data(const QModelIndex &index, int role) const return m_typeHere; case Qt::ToolTipRole: return m_typeHereToolTip; - case Qt::CheckStateRole: - return QVariant(false); } return QVariant(); } - if (role == Qt::CheckStateRole) - return index.row() == m_currentBranch ? Qt::Checked : Qt::Unchecked; + if (role == Qt::FontRole && index.row() == m_currentBranch) { + QFont font = RemoteBranchModel::data(index, role).value<QFont>(); + font.setBold(true); + font.setUnderline(true); + return font; + } return RemoteBranchModel::data(index, role); } -- GitLab