]> git.sur5r.net Git - minitube/commitdiff
Preliminar work for HiDpi mode
authorFlavio <flavio@odisseo.local>
Mon, 13 Aug 2012 15:02:01 +0000 (17:02 +0200)
committerFlavio <flavio@odisseo.local>
Mon, 13 Aug 2012 15:02:01 +0000 (17:02 +0200)
src/AboutView.cpp
src/SearchView.cpp
src/refinesearchwidget.cpp

index 4114631821fea54af5a55a9c60d7a83453e9bdd9..868c018bbadef6a29f62365345d3a2a6e57c3c5d 100644 (file)
@@ -1,5 +1,8 @@
 #include "AboutView.h"
 #include "constants.h"
+#ifndef Q_WS_X11
+#include "extra.h"
+#endif
 
 AboutView::AboutView(QWidget *parent) : QWidget(parent) {
 
@@ -9,7 +12,11 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
     aboutlayout->setSpacing(30);
 
     QLabel *logo = new QLabel(this);
-    logo->setPixmap(QPixmap(":/images/app.png"));
+    QString resource = "app";
+#ifndef Q_WS_X11
+    resource = Extra::resourceName(resource);
+#endif
+    logo->setPixmap(QPixmap(":/images/" + resource + ".png"));
     aboutlayout->addWidget(logo, 0, Qt::AlignTop);
 
     QBoxLayout *layout = new QVBoxLayout();
@@ -62,14 +69,21 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
 
     QLayout *buttonLayout = new QHBoxLayout();
     buttonLayout->setAlignment(Qt::AlignLeft);
+
     QPushButton *closeButton = new QPushButton(tr("&Close"), this);
     closeButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
-
     closeButton->setDefault(true);
     closeButton->setFocus(Qt::OtherFocusReason);
     connect(closeButton, SIGNAL(clicked()), parent, SLOT(goBack()));
     buttonLayout->addWidget(closeButton);
 
+    /*
+    QPushButton *issueButton = new QPushButton(tr("&Report an issue"), this);
+    issueButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
+    connect(issueButton, SIGNAL(clicked()), window(), SLOT(reportIssue()));
+    buttonLayout->addWidget(issueButton);
+    */
+
     layout->addLayout(buttonLayout);
 
 }
index 3388f34448b194dd7c1b81f22d2b47811954fdb2..6ffee109c15ee8272bd918a3911af97bdf8a28f2 100644 (file)
@@ -9,6 +9,12 @@
 #else
 #include "searchlineedit.h"
 #endif
+#ifndef Q_WS_X11
+#include "extra.h"
+#endif
+#ifdef APP_MAC
+#include <QtSvg>
+#endif
 
 namespace The {
     QMap<QString, QAction*>* globalActions();
@@ -66,7 +72,13 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) {
     mainLayout->addLayout(hLayout);
 
     QLabel *logo = new QLabel(this);
-    logo->setPixmap(QPixmap(":/images/app.png"));
+    QString resource = "app";
+#ifndef Q_WS_X11
+    resource = Extra::resourceName(resource);
+    logo->setMaximumSize(128, 128);
+    logo->setScaledContents(true);
+#endif
+    logo->setPixmap(QPixmap(":/images/" + resource + ".png"));
     hLayout->addWidget(logo, 0, Qt::AlignTop);
     hLayout->addSpacing(PADDING);
 
index 69f143d99842ac9dc0c56048f353bfee08b06d88..9edad1ee9825203c77266adc8b07c55835ca08ca 100644 (file)
@@ -1,6 +1,9 @@
 #include "refinesearchwidget.h"
 #include "fontutils.h"
 #include "searchparams.h"
+#ifndef Q_WS_X11
+#include "extra.h"
+#endif
 
 RefineSearchWidget::RefineSearchWidget(QWidget *parent) :
     QWidget(parent) {
@@ -130,8 +133,11 @@ void RefineSearchWidget::setupLabel(QString text, QBoxLayout *layout, QString pa
 
     QLabel *icon = new QLabel(this);
     icon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    // TODO
-    QPixmap pixmap = QPixmap(":/images/search-" + paramName + ".png");
+    QString resource = paramName;
+#ifndef Q_WS_X11
+    resource = Extra::resourceName(resource);
+#endif
+    QPixmap pixmap = QPixmap(":/images/search-" + resource + ".png");
     QPixmap translucentPixmap(pixmap.size());
     translucentPixmap.fill(Qt::transparent);
     QPainter painter;