diff ui/mainwindow.cpp @ 787:07cc0aabf782

(issue60) Make update list button less prominent and icon only
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 14 Jul 2014 16:07:55 +0200
parents e65e2a0be7c8
children 399bc0df073d
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Mon Jul 14 15:51:48 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Jul 14 16:07:55 2014 +0200
@@ -513,6 +513,7 @@
     QGridLayout *updatesHeaderLayout = new QGridLayout;
 
     /* Header 1: Update date and search button */
+    QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout;
     mUpdatesHeader =
         new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>");
     mLastCertUpdate =
@@ -523,6 +524,7 @@
     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);
@@ -535,21 +537,26 @@
         mLastUpdateCheck->hide();
         mLastUpdateCheckContents->hide();
     }
-    QPushButton *searchUpdates = new QPushButton(" " + tr("Check for updates"));
-    searchUpdates->setIcon(QIcon(":/img/edit-find.png"));
+    QPushButton *searchUpdates = new QPushButton();
+    searchUpdates->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
+    searchUpdates->setToolTip(tr("Check for updates"));
+    searchUpdates->setIcon(QIcon(":/img/update-list.png"));
     connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates()));
+    updateDateAndSearchButton->addWidget(mLastUpdateCheckContents);
+    updateDateAndSearchButton->addWidget(searchUpdates);
 
     // 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->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1);
+    updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1);
+//    updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1);
     updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1);
     updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1);
     updatesHeaderLayout->setColumnStretch(3, 1);
 
-    updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight);
+//    updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight);
     updatesHeaderLayout->setRowMinimumHeight(4, 15);
 
     /* Header 2: Action text and buttons */

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