From: Flavio Date: Mon, 13 Aug 2012 15:02:01 +0000 (+0200) Subject: Preliminar work for HiDpi mode X-Git-Tag: 1.9~17 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=572f1b296e52c3e98c1feb57b859de6716c42a07;p=minitube Preliminar work for HiDpi mode --- diff --git a/src/AboutView.cpp b/src/AboutView.cpp index 4114631..868c018 100644 --- a/src/AboutView.cpp +++ b/src/AboutView.cpp @@ -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); } diff --git a/src/SearchView.cpp b/src/SearchView.cpp index 3388f34..6ffee10 100644 --- a/src/SearchView.cpp +++ b/src/SearchView.cpp @@ -9,6 +9,12 @@ #else #include "searchlineedit.h" #endif +#ifndef Q_WS_X11 +#include "extra.h" +#endif +#ifdef APP_MAC +#include +#endif namespace The { QMap* 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); diff --git a/src/refinesearchwidget.cpp b/src/refinesearchwidget.cpp index 69f143d..9edad1e 100644 --- a/src/refinesearchwidget.cpp +++ b/src/refinesearchwidget.cpp @@ -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;