diff --git a/src/lib/adblock/adblockicon.cpp b/src/lib/adblock/adblockicon.cpp index 965ed3e41..26be32687 100644 --- a/src/lib/adblock/adblockicon.cpp +++ b/src/lib/adblock/adblockicon.cpp @@ -25,6 +25,7 @@ #include "tabbedwebview.h" #include "tabwidget.h" #include "desktopnotificationsfactory.h" +#include "qztools.h" #include #include @@ -39,7 +40,7 @@ AdBlockIcon::AdBlockIcon(BrowserWindow* window, QWidget* parent) { setCursor(Qt::PointingHandCursor); setToolTip(tr("AdBlock lets you block unwanted content on web pages")); - setMinimumSize(16, 16); + setFixedSize(16, 16); connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); connect(AdBlockManager::instance(), SIGNAL(enabledChanged(bool)), this, SLOT(setEnabled(bool))); @@ -187,7 +188,7 @@ void AdBlockIcon::animateIcon() } if (pixmap()->isNull()) { - setPixmap(QPixmap(":icons/other/adblock.png")); + setPixmap(QIcon(QSL(":icons/other/adblock.png")).pixmap(16)); } else { setPixmap(QPixmap()); @@ -206,10 +207,10 @@ void AdBlockIcon::stopAnimation() void AdBlockIcon::setEnabled(bool enabled) { if (enabled) { - setPixmap(QPixmap(":icons/other/adblock.png")); + setPixmap(QIcon(QSL(":icons/other/adblock.png")).pixmap(16)); } else { - setPixmap(QPixmap(":icons/other/adblock-disabled.png")); + setPixmap(QIcon(QSL(":icons/other/adblock-disabled.png")).pixmap(16)); } m_enabled = enabled; diff --git a/src/lib/data/icons.qrc b/src/lib/data/icons.qrc index 7720e9a3f..8e8bbcda0 100644 --- a/src/lib/data/icons.qrc +++ b/src/lib/data/icons.qrc @@ -25,7 +25,7 @@ icons/preferences/applications-graphics.png icons/preferences/document-properties.png icons/other/adblock.png - icons/notifications/download.png + icons/notifications/download.svg icons/other/bighistory.png icons/preferences/style-default.png icons/other/adblock-disabled.png diff --git a/src/lib/data/icons/notifications/download.png b/src/lib/data/icons/notifications/download.png deleted file mode 100644 index e81619b1b..000000000 Binary files a/src/lib/data/icons/notifications/download.png and /dev/null differ diff --git a/src/lib/data/icons/notifications/download.svg b/src/lib/data/icons/notifications/download.svg new file mode 100644 index 000000000..e332fc160 --- /dev/null +++ b/src/lib/data/icons/notifications/download.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/lib/data/icons/other/adblock-disabled.png b/src/lib/data/icons/other/adblock-disabled.png index 422557e52..83503b38e 100644 Binary files a/src/lib/data/icons/other/adblock-disabled.png and b/src/lib/data/icons/other/adblock-disabled.png differ diff --git a/src/lib/data/icons/other/adblock.png b/src/lib/data/icons/other/adblock.png index a672e7d78..70066f90a 100644 Binary files a/src/lib/data/icons/other/adblock.png and b/src/lib/data/icons/other/adblock.png differ diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 8f53e9fb0..27aabb688 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -330,7 +330,7 @@ void DownloadManager::downloadFinished(bool success) if (downloadingAllFilesFinished) { if (success && qApp->activeWindow() != this) { - mApp->desktopNotifications()->showNotification(QIcon::fromTheme(QSL("download"), QIcon(":icons/notifications/download.png")).pixmap(48), tr("Download Finished"), tr("All files have been successfully downloaded.")); + mApp->desktopNotifications()->showNotification(QIcon::fromTheme(QSL("download"), QIcon(":icons/notifications/download.svg")).pixmap(48), tr("Download Finished"), tr("All files have been successfully downloaded.")); if (!m_closeOnFinish) { raise(); activateWindow(); diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 198d6b485..b9c011958 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -170,7 +170,7 @@ QString QupZillaSchemeReply::startPage() sPage.append(QzTools::readAllFileContents(":html/start.html")); sPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png")); sPage.replace(QLatin1String("%BOX-BORDER%"), QLatin1String("qrc:html/box-border.png")); - sPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QIcon(":icons/other/startpage.png").pixmap(200, 155)).toString()); + sPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QzTools::dpiAwarePixmap(QSL(":icons/other/startpage.png"))).toString()); sPage.replace(QLatin1String("%TITLE%"), tr("Start Page")); sPage.replace(QLatin1String("%BUTTON-LABEL%"), tr("Search on Web")); @@ -191,7 +191,7 @@ QString QupZillaSchemeReply::aboutPage() aPage.append(QzTools::readAllFileContents(":html/about.html")); aPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png")); aPage.replace(QLatin1String("%BOX-BORDER%"), QLatin1String("qrc:html/box-border.png")); - aPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QIcon(QSL(":icons/other/about.png")).pixmap(300, 130)).toString()); + aPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QzTools::dpiAwarePixmap(QSL(":icons/other/about.png"))).toString()); aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), QzTools::readAllFileContents(":html/copyright").toHtmlEscaped()); aPage.replace(QLatin1String("%TITLE%"), tr("About QupZilla")); @@ -356,7 +356,7 @@ QString QupZillaSchemeReply::configPage() cPage.append(QzTools::readAllFileContents(":html/config.html")); cPage.replace(QLatin1String("%FAVICON%"), QLatin1String("qrc:icons/qupzilla.png")); cPage.replace(QLatin1String("%BOX-BORDER%"), QLatin1String("qrc:html/box-border.png")); - cPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QIcon(QSL(":icons/other/about.png")).pixmap(300, 130)).toString()); + cPage.replace(QLatin1String("%ABOUT-IMG%"), QzTools::pixmapToDataUrl(QzTools::dpiAwarePixmap(QSL(":icons/other/about.png"))).toString()); cPage.replace(QLatin1String("%TITLE%"), tr("Configuration Information")); cPage.replace(QLatin1String("%CONFIG%"), tr("Configuration Information")); diff --git a/src/lib/tools/qztools.cpp b/src/lib/tools/qztools.cpp index 4e2a7b380..5bf8e11e8 100644 --- a/src/lib/tools/qztools.cpp +++ b/src/lib/tools/qztools.cpp @@ -81,6 +81,15 @@ QUrl QzTools::pixmapToDataUrl(const QPixmap &pix) return data.isEmpty() ? QUrl() : QUrl(QSL("data:image/png;base64,") + data); } +QPixmap QzTools::dpiAwarePixmap(const QString &path) +{ + const QIcon icon(path); + if (icon.availableSizes().isEmpty()) { + return QPixmap(path); + } + return icon.pixmap(icon.availableSizes().at(0)); +} + QString QzTools::readAllFileContents(const QString &filename) { return QString::fromUtf8(readAllFileByteContents(filename)); diff --git a/src/lib/tools/qztools.h b/src/lib/tools/qztools.h index 1aca74ab9..33d5b5080 100644 --- a/src/lib/tools/qztools.h +++ b/src/lib/tools/qztools.h @@ -35,6 +35,7 @@ public: static QByteArray pixmapToByteArray(const QPixmap &pix); static QPixmap pixmapFromByteArray(const QByteArray &data); static QUrl pixmapToDataUrl(const QPixmap &pix); + static QPixmap dpiAwarePixmap(const QString &path); static QString readAllFileContents(const QString &filename); static QByteArray readAllFileByteContents(const QString &filename);