diff ui/mainwindow.cpp @ 1094:03a1f3761f45

(issue111) Move Version label into header. This makes the subtitle slightly larger so that the version label looks smaller.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 10:35:05 +0200
parents 153af47456d0
children a0fb21625cf3
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Mon Sep 15 10:17:17 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Sep 15 10:35:05 2014 +0200
@@ -611,10 +611,6 @@
     mLastCertUpdateContents = new QLabel(QString());
     mLastCertUpdate->hide();
     mLastCertUpdateContents->hide();
-    mSoftwareVersionLabel =
-        new QLabel(tr("TrustBridge Version:"));
-    mSoftwareVersionContents = new QLabel(QApplication::applicationVersion());
-
     const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime();
     if (lastCheck.isValid()) {
         const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT);
@@ -636,8 +632,6 @@
 
     // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment])
     updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2);
-    updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1);
-    updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1);
     updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1);
     updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1);
 //    updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1);
@@ -868,6 +862,7 @@
     QVBoxLayout *mainLayout = new QVBoxLayout;
     QHBoxLayout *headerLayout = new QHBoxLayout;
     QVBoxLayout *headerTextLayout = new QVBoxLayout;
+    QHBoxLayout *headerSubtitleLayout = new QHBoxLayout;
     QHBoxLayout *centerLayout = new QHBoxLayout;
     QVBoxLayout *buttonBarLayout = new QVBoxLayout;
     QHBoxLayout *bottomLayout = new QHBoxLayout;
@@ -879,9 +874,21 @@
     logo->setBackgroundRole(QPalette::Base);
     logo->setPixmap(QPixmap::fromImage(*logoImage));
     QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>");
-    QLabel *subTitle = new QLabel(tr("Trust in your digital communication"));
+    QLabel *subTitle = new QLabel(QString::fromLatin1("<h3>") +
+            tr("Trust in your digital communication") + QString::fromLatin1("</h3>"));
+    QLabel *swVersion = new QLabel(QString::fromLatin1("<i>") +
+            tr("Version") + " " + QApplication::applicationVersion() +
+            QString::fromLatin1("</i>"));
+
+    swVersion->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);
+    swVersion->setTextFormat(Qt::RichText);
+
+    headerSubtitleLayout->addWidget(subTitle);
+    headerSubtitleLayout->addStretch(-1);
+    headerSubtitleLayout->addWidget(swVersion);
+
     headerTextLayout->addWidget(title);
-    headerTextLayout->addWidget(subTitle);
+    headerTextLayout->addLayout(headerSubtitleLayout);
     headerLayout->addWidget(logo);
     headerLayout->addLayout(headerTextLayout);
     headerLayout->setStretch(0, 0);

http://wald.intevation.org/projects/trustbridge/