From addc397073e1599d8179e1338eed190db05f38aa Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 27 May 2016 10:34:20 +0200 Subject: [PATCH] Core: HighDPI-aware Qt Creator logo This change makes sure that the usage of Qt Creator logo is HigDPI aware. We use qrc file name aliases to be able to use the "@2x" mechanism. Change-Id: I8dbb77b6cd9a3b6ab4530b84c18e0f83a662d710 Reviewed-by: David Schulz --- src/plugins/coreplugin/core.qrc | 4 ++-- src/plugins/coreplugin/coreicons.cpp | 8 ++------ src/plugins/coreplugin/coreicons.h | 4 +--- src/plugins/coreplugin/mainwindow.cpp | 2 +- src/plugins/coreplugin/versiondialog.cpp | 4 ++-- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/plugins/coreplugin/core.qrc b/src/plugins/coreplugin/core.qrc index 28d34b3dc0..be8904f44d 100644 --- a/src/plugins/coreplugin/core.qrc +++ b/src/plugins/coreplugin/core.qrc @@ -13,8 +13,8 @@ images/fileopen.png images/filesave.png images/filesave@2x.png - images/logo/128/QtProject-qtcreator.png - images/logo/32/QtProject-qtcreator.png + images/logo/128/QtProject-qtcreator.png + images/logo/256/QtProject-qtcreator.png images/inputfield.png images/inputfield@2x.png images/inputfield_disabled.png diff --git a/src/plugins/coreplugin/coreicons.cpp b/src/plugins/coreplugin/coreicons.cpp index 831e0e0570..0638c3d023 100644 --- a/src/plugins/coreplugin/coreicons.cpp +++ b/src/plugins/coreplugin/coreicons.cpp @@ -70,12 +70,8 @@ const Icon FIND_REGEXP( QLatin1String(":/find/images/regexp.png")); const Icon FIND_PRESERVE_CASE( QLatin1String(":/find/images/preservecase.png")); -const Icon QTLOGO_32( - QLatin1String(":/core/images/logo/32/QtProject-qtcreator.png")); -const Icon QTLOGO_64( - QLatin1String(":/core/images/logo/64/QtProject-qtcreator.png")); -const Icon QTLOGO_128( - QLatin1String(":/core/images/logo/128/QtProject-qtcreator.png")); +const Icon QTCREATORLOGO_BIG( + QLatin1String(":/core/images/qtcreatorlogo-big.png")); const Icon ARROW_UP({ {QLatin1String(":/core/images/arrowup.png"), Theme::IconsBaseColor}}); diff --git a/src/plugins/coreplugin/coreicons.h b/src/plugins/coreplugin/coreicons.h index cff021968d..bd28a5194a 100644 --- a/src/plugins/coreplugin/coreicons.h +++ b/src/plugins/coreplugin/coreicons.h @@ -52,9 +52,7 @@ CORE_EXPORT extern const Utils::Icon FIND_CASE_INSENSITIVELY; CORE_EXPORT extern const Utils::Icon FIND_WHOLE_WORD; CORE_EXPORT extern const Utils::Icon FIND_REGEXP; CORE_EXPORT extern const Utils::Icon FIND_PRESERVE_CASE; -CORE_EXPORT extern const Utils::Icon QTLOGO_32; -CORE_EXPORT extern const Utils::Icon QTLOGO_64; -CORE_EXPORT extern const Utils::Icon QTLOGO_128; +CORE_EXPORT extern const Utils::Icon QTCREATORLOGO_BIG; CORE_EXPORT extern const Utils::Icon ARROW_UP; CORE_EXPORT extern const Utils::Icon ARROW_DOWN; diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index e1d5e62b8f..3447029b76 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -147,7 +147,7 @@ MainWindow::MainWindow() : setWindowTitle(tr("Qt Creator")); if (HostOsInfo::isLinuxHost()) - QApplication::setWindowIcon(Icons::QTLOGO_128.icon()); + QApplication::setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); QCoreApplication::setApplicationName(QLatin1String("QtCreator")); QCoreApplication::setApplicationVersion(QLatin1String(Constants::IDE_VERSION_LONG)); QCoreApplication::setOrganizationName(QLatin1String(Constants::IDE_SETTINGSVARIANT_STR)); diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 8ca808516c..42f5e647da 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -47,7 +47,7 @@ VersionDialog::VersionDialog(QWidget *parent) // We need to set the window icon explicitly here since for some reason the // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) if (Utils::HostOsInfo::isLinuxHost()) - setWindowIcon(Icons::QTLOGO_128.icon()); + setWindowIcon(Icons::QTCREATORLOGO_BIG.icon()); setWindowTitle(tr("About Qt Creator")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -101,7 +101,7 @@ VersionDialog::VersionDialog(QWidget *parent) connect(buttonBox , &QDialogButtonBox::rejected, this, &QDialog::reject); QLabel *logoLabel = new QLabel; - logoLabel->setPixmap(Icons::QTLOGO_128.pixmap()); + logoLabel->setPixmap(Icons::QTCREATORLOGO_BIG.pixmap()); layout->addWidget(logoLabel , 0, 0, 1, 1); layout->addWidget(copyRightLabel, 0, 1, 4, 4); layout->addWidget(buttonBox, 4, 0, 1, 5); -- GitLab