mirror of
https://github.com/86Box/86Box.git
synced 2026-02-28 01:44:22 -07:00
Qt: Move the program icon path to qt_defs.hpp
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
* Copyright 2022 dob205
|
||||
*/
|
||||
#include "qt_about.hpp"
|
||||
#include "qt_defs.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -57,15 +58,7 @@ About::About(QWidget *parent)
|
||||
webSiteButton->connect(webSiteButton, &QPushButton::released, []() {
|
||||
QDesktopServices::openUrl(QUrl("https://" EMU_SITE));
|
||||
});
|
||||
#ifdef RELEASE_BUILD
|
||||
setIconPixmap(QIcon(":/settings/qt/icons/86Box-green.ico").pixmap(32, 32));
|
||||
#elif defined ALPHA_BUILD
|
||||
setIconPixmap(QIcon(":/settings/qt/icons/86Box-red.ico").pixmap(32, 32));
|
||||
#elif defined BETA_BUILD
|
||||
setIconPixmap(QIcon(":/settings/qt/icons/86Box-yellow.ico").pixmap(32, 32));
|
||||
#else
|
||||
setIconPixmap(QIcon(":/settings/qt/icons/86Box-gray.ico").pixmap(32, 32));
|
||||
#endif
|
||||
setIconPixmap(QIcon(EMU_ICON_PATH).pixmap(32, 32));
|
||||
setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,19 @@
|
||||
#define QT_DEFS_HPP
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||
#define CHECK_STATE_CHANGED checkStateChanged
|
||||
# define CHECK_STATE_CHANGED checkStateChanged
|
||||
#else
|
||||
#define CHECK_STATE_CHANGED stateChanged
|
||||
# define CHECK_STATE_CHANGED stateChanged
|
||||
#endif
|
||||
|
||||
#ifdef RELEASE_BUILD
|
||||
# define EMU_ICON_PATH ":/settings/qt/icons/86Box-green.ico"
|
||||
#elif defined ALPHA_BUILD
|
||||
# define EMU_ICON_PATH ":/settings/qt/icons/86Box-red.ico"
|
||||
#elif defined BETA_BUILD
|
||||
# define EMU_ICON_PATH ":/settings/qt/icons/86Box-yellow.ico"
|
||||
#else
|
||||
# define EMU_ICON_PATH ":/settings/qt/icons/86Box-gray.ico"
|
||||
#endif
|
||||
|
||||
#endif // QT_DEFS_HPP
|
||||
|
||||
@@ -75,6 +75,7 @@ extern "C" {
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
#include "qt_defs.hpp"
|
||||
#include "qt_mainwindow.hpp"
|
||||
#include "qt_progsettings.hpp"
|
||||
#include "qt_settings.hpp"
|
||||
@@ -627,16 +628,7 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
# ifdef RELEASE_BUILD
|
||||
app.setWindowIcon(QIcon(":/settings/qt/icons/86Box-green.ico"));
|
||||
# elif defined ALPHA_BUILD
|
||||
app.setWindowIcon(QIcon(":/settings/qt/icons/86Box-red.ico"));
|
||||
# elif defined BETA_BUILD
|
||||
app.setWindowIcon(QIcon(":/settings/qt/icons/86Box-yellow.ico"));
|
||||
# else
|
||||
app.setWindowIcon(QIcon(":/settings/qt/icons/86Box-gray.ico"));
|
||||
# endif
|
||||
|
||||
app.setWindowIcon(QIcon(EMU_ICON_PATH));
|
||||
# ifdef Q_OS_UNIX
|
||||
app.setDesktopFileName("net.86box.86Box");
|
||||
# endif
|
||||
|
||||
Reference in New Issue
Block a user