diff --git a/dist/icons/citra.png b/dist/icons/citra.png deleted file mode 100644 index 83fa499dd..000000000 Binary files a/dist/icons/citra.png and /dev/null differ diff --git a/dist/icons/icons.qrc b/dist/icons/icons.qrc deleted file mode 100644 index a25804907..000000000 --- a/dist/icons/icons.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - checked.png - failed.png - citra.png - - diff --git a/dist/qt_themes/default/default.qrc b/dist/qt_themes/default/default.qrc new file mode 100644 index 000000000..a3e21645a --- /dev/null +++ b/dist/qt_themes/default/default.qrc @@ -0,0 +1,11 @@ + + + icons/index.theme + + icons/16x16/checked.png + + icons/16x16/failed.png + + icons/256x256/citra.png + + diff --git a/dist/icons/checked.png b/dist/qt_themes/default/icons/16x16/checked.png similarity index 100% rename from dist/icons/checked.png rename to dist/qt_themes/default/icons/16x16/checked.png diff --git a/dist/icons/failed.png b/dist/qt_themes/default/icons/16x16/failed.png similarity index 100% rename from dist/icons/failed.png rename to dist/qt_themes/default/icons/16x16/failed.png diff --git a/dist/qt_themes/default/icons/256x256/citra.png b/dist/qt_themes/default/icons/256x256/citra.png new file mode 100644 index 000000000..dbbfa7473 Binary files /dev/null and b/dist/qt_themes/default/icons/256x256/citra.png differ diff --git a/dist/qt_themes/default/icons/index.theme b/dist/qt_themes/default/icons/index.theme new file mode 100644 index 000000000..ac67cb236 --- /dev/null +++ b/dist/qt_themes/default/icons/index.theme @@ -0,0 +1,10 @@ +[Icon Theme] +Name=default +Comment=default theme +Directories=16x16,256x256 + +[16x16] +Size=16 + +[256x256] +Size=256 \ No newline at end of file diff --git a/dist/qt_themes/qdarkstyle/icons/index.theme b/dist/qt_themes/qdarkstyle/icons/index.theme new file mode 100644 index 000000000..558ece40b --- /dev/null +++ b/dist/qt_themes/qdarkstyle/icons/index.theme @@ -0,0 +1,11 @@ +[Icon Theme] +Name=qdarkstyle +Comment=dark theme +Inherits=default +Directories=16x16,256x256 + +[16x16] +Size=16 + +[256x256] +Size=256 \ No newline at end of file diff --git a/dist/qt_themes/qdarkstyle/style.qrc b/dist/qt_themes/qdarkstyle/style.qrc index ac14bc501..efbd0b9dc 100644 --- a/dist/qt_themes/qdarkstyle/style.qrc +++ b/dist/qt_themes/qdarkstyle/style.qrc @@ -1,4 +1,7 @@ + + icons/index.theme + rc/up_arrow_disabled.png rc/Hmovetoolbar.png diff --git a/src/citra_qt/aboutdialog.cpp b/src/citra_qt/aboutdialog.cpp index 9c11168ba..06587341a 100644 --- a/src/citra_qt/aboutdialog.cpp +++ b/src/citra_qt/aboutdialog.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include "aboutdialog.h" #include "common/scm_rev.h" #include "ui_aboutdialog.h" @@ -10,6 +11,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), ui(new Ui::AboutDialog) { ui->setupUi(this); + ui->labelLogo->setPixmap(QIcon::fromTheme("citra").pixmap(200)); ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); } diff --git a/src/citra_qt/configuration/configure_web.cpp b/src/citra_qt/configuration/configure_web.cpp index 42f2c9991..22d01e9f8 100644 --- a/src/citra_qt/configuration/configure_web.cpp +++ b/src/citra_qt/configuration/configure_web.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include "citra_qt/configuration/configure_web.h" #include "core/settings.h" @@ -67,12 +68,12 @@ void ConfigureWeb::RefreshTelemetryID() { void ConfigureWeb::OnLoginChanged() { if (ui->edit_username->text().isEmpty() && ui->edit_token->text().isEmpty()) { user_verified = true; - ui->label_username_verified->setPixmap(QPixmap(":/icons/checked.png")); - ui->label_token_verified->setPixmap(QPixmap(":/icons/checked.png")); + ui->label_username_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); + ui->label_token_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); } else { user_verified = false; - ui->label_username_verified->setPixmap(QPixmap(":/icons/failed.png")); - ui->label_token_verified->setPixmap(QPixmap(":/icons/failed.png")); + ui->label_username_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); + ui->label_token_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); } } @@ -89,11 +90,11 @@ void ConfigureWeb::OnLoginVerified() { ui->button_verify_login->setText(tr("Verify")); if (verified.get()) { user_verified = true; - ui->label_username_verified->setPixmap(QPixmap(":/icons/checked.png")); - ui->label_token_verified->setPixmap(QPixmap(":/icons/checked.png")); + ui->label_username_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); + ui->label_token_verified->setPixmap(QIcon::fromTheme("checked").pixmap(16)); } else { - ui->label_username_verified->setPixmap(QPixmap(":/icons/failed.png")); - ui->label_token_verified->setPixmap(QPixmap(":/icons/failed.png")); + ui->label_username_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); + ui->label_token_verified->setPixmap(QIcon::fromTheme("failed").pixmap(16)); QMessageBox::critical( this, tr("Verification failed"), tr("Verification failed. Check that you have entered your username and token " diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 9a2cb8368..9eac0f40d 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -130,6 +130,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); + default_theme_paths = QIcon::themeSearchPaths(); UpdateUITheme(); // Show one-time "callout" messages to the user @@ -1226,7 +1227,9 @@ void GMainWindow::filterBarSetChecked(bool state) { } void GMainWindow::UpdateUITheme() { - if (UISettings::values.theme != UISettings::themes[0].second) { + QStringList theme_paths(default_theme_paths); + if (UISettings::values.theme != UISettings::themes[0].second && + !UISettings::values.theme.isEmpty()) { QString theme_uri(":" + UISettings::values.theme + "/style.qss"); QFile f(theme_uri); if (!f.exists()) { @@ -1237,10 +1240,15 @@ void GMainWindow::UpdateUITheme() { qApp->setStyleSheet(ts.readAll()); GMainWindow::setStyleSheet(ts.readAll()); } + theme_paths.append(QStringList{":/icons/default", ":/icons/" + UISettings::values.theme}); + QIcon::setThemeName(":/icons/" + UISettings::values.theme); } else { qApp->setStyleSheet(""); GMainWindow::setStyleSheet(""); + theme_paths.append(QStringList{":/icons/default"}); + QIcon::setThemeName(":/icons/default"); } + QIcon::setThemeSearchPaths(theme_paths); } void GMainWindow::LoadTranslation() { diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 85fbc7d02..04fe742ea 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -206,6 +206,9 @@ private: QTranslator translator; + // stores default icon theme search paths for the platform + QStringList default_theme_paths; + protected: void dropEvent(QDropEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override;