diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2017-04-03 13:55:47 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2017-04-03 14:06:12 +0000 |
commit | f23e45437000323851a3967b8512c2150a70d05a (patch) | |
tree | c95c97556f2ba75841137e8e402263703edc22ef /src | |
parent | f1b50837e40700d1f4f23dc1502016f580df5064 (diff) | |
download | qt-creator-f23e45437000323851a3967b8512c2150a70d05a.tar.gz |
ProjectExplorer: Small welcome page improvement
Use the complete height of the (unexpanded) session label for the click-
to-open region. Also, give some magic numbers a name.
Change-Id: Ie972d669cca943105cdd2e7e99394b61ca0a6e37
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/projectexplorer/projectwelcomepage.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index f7e442ed5e..9518891ece 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -56,6 +56,7 @@ using namespace Core; using namespace Utils; const int LINK_HEIGHT = 35; +const int SESSION_LINE_HEIGHT = 30; const char PROJECT_BASE_ID[] = "Welcome.OpenRecentProject"; namespace ProjectExplorer { @@ -292,7 +293,7 @@ public: if (isActiveSession && !isDefaultVirgin) fullSessionName = ProjectWelcomePage::tr("%1 (current session)").arg(fullSessionName); - const QRect switchRect = QRect(x, y, rc.width() - 24, firstBase + 3 - y); + const QRect switchRect = QRect(x, y, rc.width() - 24, SESSION_LINE_HEIGHT); const bool switchActive = switchRect.contains(mousePos); painter->setPen(linkColor); painter->setFont(sizedFont(13, option.widget, switchActive)); @@ -350,7 +351,7 @@ public: QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &idx) const final { - int h = 30; + int h = SESSION_LINE_HEIGHT; QString sessionName = idx.data(Qt::DisplayRole).toString(); if (m_expandedSessions.contains(sessionName)) { QStringList projects = SessionManager::projectsForSessionName(sessionName); @@ -364,7 +365,7 @@ public: { if (ev->type() == QEvent::MouseButtonRelease) { const QPoint pos = static_cast<QMouseEvent *>(ev)->pos(); - const QRect rc(option.rect.right() - 24, option.rect.top(), 24, 30); + const QRect rc(option.rect.right() - 24, option.rect.top(), 24, SESSION_LINE_HEIGHT); const QString sessionName = idx.data(Qt::DisplayRole).toString(); if (rc.contains(pos)) { // The expand/collapse "button". |