[PATCH 1 of 3] (issue111) Move Version label into header

Wald Commits scm-commit at wald.intevation.org
Mon Sep 15 10:53:25 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1410770105 -7200
# Node ID 03a1f3761f45d751c5268e96768c793c5c8ba3db
# Parent  153af47456d09c1976e26346768d8dadc61910c7
(issue111) Move Version label into header.

    This makes the subtitle slightly larger so that the version
    label looks smaller.

diff -r 153af47456d0 -r 03a1f3761f45 ui/mainwindow.cpp
--- 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);


More information about the Trustbridge-commits mailing list