]> git.sur5r.net Git - minitube/blobdiff - src/aboutview.cpp
HiDPI support
[minitube] / src / aboutview.cpp
index 92d6638c804cd589b78753ab71d464235ab8ce1b..19c5ee547ea88b41d94464e35dfc269c79931563 100644 (file)
@@ -30,8 +30,10 @@ $END_LICENSE */
 #include "macutils.h"
 #include "mac_startup.h"
 #endif
+#include "fontutils.h"
+#include "iconutils.h"
 
-AboutView::AboutView(QWidget *parent) : QWidget(parent) {
+AboutView::AboutView(QWidget *parent) : View(parent) {
 
     QBoxLayout *hLayout = new QHBoxLayout(this);
     hLayout->setAlignment(Qt::AlignCenter);
@@ -39,7 +41,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
     hLayout->setSpacing(30);
 
     QLabel *logo = new QLabel(this);
-    logo->setPixmap(QPixmap(":/images/app.png"));
+    logo->setPixmap(IconUtils::pixmap(":/images/app.png"));
     hLayout->addWidget(logo, 0, Qt::AlignTop);
 
     QBoxLayout *layout = new QVBoxLayout();
@@ -47,8 +49,13 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
     layout->setSpacing(30);
     hLayout->addLayout(layout);
 
-    QString info = "<html><style>a { color: palette(text); text-decoration: none; font-weight: bold }</style><body>"
-            "<h1 style='font-weight:normal'>" + QString(Constants::NAME) + "</h1>"
+    QString css = "a { color: palette(text); text-decoration: none; font-weight: bold } h1 { font-weight: 100 }";
+#ifdef APP_MAC
+    css += " h1 { font-family: 'Helvetica Neue' }";
+#endif
+
+    QString info = "<html><style>" + css + "</style><body>"
+            "<h1>" + QString(Constants::NAME) + "</h1>"
             "<p>" + tr("There's life outside the browser!") + "</p>"
             "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
             + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE);
@@ -82,14 +89,14 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
             + "</p>"
 
             "<p>"
-            + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.com/'>David Nel</a>")
+            + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.co.za/'>David Nel</a>")
             + "</p>"
 
         #ifndef APP_EXTRA
             "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
             .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
         #endif
-            "<p>&copy; 2009-2014 " + Constants::ORG_NAME + "</p>"
+            "<p>&copy; 2009-2015 " + Constants::ORG_NAME + "</p>"
             "</body></html>";
     QLabel *infoLabel = new QLabel(info, this);
     infoLabel->setOpenExternalLinks(true);
@@ -110,25 +117,33 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
     layout->addLayout(buttonLayout);
 }
 
-void AboutView::paintEvent(QPaintEvent * /*event*/) {
+void AboutView::appear() {
+#ifdef APP_MAC
+    mac::uncloseWindow(window()->winId());
+#ifdef APP_ACTIVATION
+    mac::CheckForUpdates();
+#endif
+#endif
+    closeButton->setFocus();
+}
+
+void AboutView::paintEvent(QPaintEvent *event) {
+    QWidget::paintEvent(event);
 #if defined(APP_MAC) | defined(APP_WIN)
     QBrush brush;
     if (window()->isActiveWindow()) {
-        brush = QBrush(QColor(0xdd, 0xe4, 0xeb));
+        brush = Qt::white;
     } else {
         brush = palette().window();
     }
     QPainter painter(this);
     painter.fillRect(0, 0, width(), height(), brush);
+    painter.end();
 #endif
-}
-
-void AboutView::appear() {
-#ifdef APP_MAC
-    mac::uncloseWindow(window()->winId());
-#ifdef APP_ACTIVATION
-    mac::CheckForUpdates();
+#ifdef APP_UBUNTU
+    QStyleOption o;
+    o.initFrom(this);
+    QPainter p(this);
+    style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
 #endif
-#endif
-    closeButton->setFocus();
 }