mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Qt: Use global Appicon instead of setting it in every Dialog
This commit is contained in:
parent
222c0e0fc5
commit
61ca9df45c
@ -63,6 +63,9 @@ rpcs3_app::rpcs3_app(int& argc, char** argv) : QApplication(argc, argv)
|
||||
|
||||
void rpcs3_app::Init()
|
||||
{
|
||||
setApplicationName("RPCS3");
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
|
||||
Emu.Init();
|
||||
|
||||
guiSettings.reset(new gui_settings());
|
||||
@ -79,7 +82,6 @@ void rpcs3_app::Init()
|
||||
|
||||
RPCS3MainWin->Init();
|
||||
|
||||
setApplicationName("RPCS3");
|
||||
RPCS3MainWin->show();
|
||||
|
||||
// Create the thumbnail toolbar after the main_window is created
|
||||
|
@ -76,8 +76,6 @@ void main_window::Init()
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
m_appIcon = QIcon(":/rpcs3.ico");
|
||||
|
||||
// hide utilities from the average user
|
||||
ui->menuUtilities->menuAction()->setVisible(guiSettings->GetValue(GUI::m_showDebugTab).toBool());
|
||||
|
||||
@ -107,7 +105,6 @@ void main_window::Init()
|
||||
|
||||
setMinimumSize(350, minimumSizeHint().height()); // seems fine on win 10
|
||||
setWindowTitle(QString::fromStdString("RPCS3 v" + rpcs3::version.to_string()));
|
||||
!m_appIcon.isNull() ? setWindowIcon(m_appIcon) : LOG_WARNING(GENERAL, "AppImage could not be loaded!");
|
||||
|
||||
Q_EMIT RequestGlobalStylesheetChange(guiSettings->GetCurrentStylesheetPath());
|
||||
ConfigureGuiFromSettings(true);
|
||||
@ -131,7 +128,6 @@ void main_window::Init()
|
||||
|
||||
QMessageBox msg;
|
||||
msg.setWindowTitle("Experimental Build Warning");
|
||||
msg.setWindowIcon(m_appIcon);
|
||||
msg.setIcon(QMessageBox::Critical);
|
||||
msg.setTextFormat(Qt::RichText);
|
||||
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
@ -196,7 +192,7 @@ QIcon main_window::GetAppIcon()
|
||||
}
|
||||
|
||||
// loads the appIcon from path and embeds it centered into an empty square icon
|
||||
void main_window::SetAppIconFromPath(const std::string path)
|
||||
void main_window::SetAppIconFromPath(const std::string& path)
|
||||
{
|
||||
// get Icon for the gs_frame from path. this handles presumably all possible use cases
|
||||
QString qpath = qstr(path);
|
||||
@ -214,7 +210,7 @@ void main_window::SetAppIconFromPath(const std::string path)
|
||||
// load the image from path. It will most likely be a rectangle
|
||||
QImage source = QImage(qstr(ico));
|
||||
int edgeMax = std::max(source.width(), source.height());
|
||||
|
||||
|
||||
// create a new transparent image with square size and same format as source (maybe handle other formats than RGB32 as well?)
|
||||
QImage::Format format = source.format() == QImage::Format_RGB32 ? QImage::Format_ARGB32 : source.format();
|
||||
QImage dest = QImage(edgeMax, edgeMax, format);
|
||||
@ -236,7 +232,7 @@ void main_window::SetAppIconFromPath(const std::string path)
|
||||
}
|
||||
}
|
||||
// if nothing was found reset the icon to default
|
||||
m_appIcon = QIcon(":/rpcs3.ico");
|
||||
m_appIcon = QApplication::windowIcon();
|
||||
}
|
||||
|
||||
void main_window::BootElf()
|
||||
|
@ -100,7 +100,7 @@ protected:
|
||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||
void dragMoveEvent(QDragMoveEvent* event) override;
|
||||
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
||||
void SetAppIconFromPath(const std::string path);
|
||||
void SetAppIconFromPath(const std::string& path);
|
||||
private:
|
||||
void RepaintToolbar();
|
||||
void RepaintToolBarIcons();
|
||||
|
@ -81,8 +81,6 @@ public:
|
||||
explicit custom_dialog(bool disableCancel, QWidget* parent = 0)
|
||||
: QDialog(parent), m_disable_cancel(disableCancel)
|
||||
{
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
|
||||
if (m_disable_cancel)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowCloseButtonHint);
|
||||
|
@ -11,7 +11,6 @@ save_data_info_dialog::save_data_info_dialog(const SaveDataEntry& save, QWidget*
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Save Data Information"));
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
|
||||
// Table
|
||||
m_list = new QTableWidget(this);
|
||||
|
@ -32,7 +32,6 @@ save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& e
|
||||
setWindowTitle(tr("Save Data Interface (Save)"));
|
||||
}
|
||||
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
setMinimumSize(QSize(400, 400));
|
||||
|
||||
// Table
|
||||
|
@ -85,7 +85,6 @@ save_manager_dialog::save_manager_dialog(std::string dir, QWidget* parent) : QDi
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Save Manager"));
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
setMinimumSize(QSize(400, 400));
|
||||
|
||||
Init(dir);
|
||||
|
@ -43,7 +43,6 @@ trophy_manager_dialog::trophy_manager_dialog() : QWidget(), m_sort_column(0), m_
|
||||
// Nonspecific widget settings
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setWindowTitle(tr("Trophy Manager"));
|
||||
setWindowIcon(QIcon(":/rpcs3.ico"));
|
||||
|
||||
// HACK: dev_hdd0 must be mounted for vfs to work for loading trophies.
|
||||
const std::string emu_dir_ = g_cfg.vfs.emulator_dir;
|
||||
|
Loading…
Reference in New Issue
Block a user