mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
Qt: Set game icon as window icon in Game Properties
This commit is contained in:
@@ -671,7 +671,7 @@ void MainWindow::onSystemGameChanged(const QString& path, const QString& game_se
|
|||||||
s_current_game_path = path;
|
s_current_game_path = path;
|
||||||
s_current_game_title = game_title;
|
s_current_game_title = game_title;
|
||||||
s_current_game_serial = game_serial;
|
s_current_game_serial = game_serial;
|
||||||
s_current_game_icon = m_game_list_widget->getModel()->getIconForGame(path);
|
s_current_game_icon = getIconForGame(path);
|
||||||
|
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
}
|
}
|
||||||
@@ -3027,6 +3027,11 @@ void MainWindow::cancelGameListRefresh()
|
|||||||
m_game_list_widget->cancelRefresh();
|
m_game_list_widget->cancelRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon MainWindow::getIconForGame(const QString& path)
|
||||||
|
{
|
||||||
|
return m_game_list_widget->getModel()->getIconForGame(path);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::runOnUIThread(const std::function<void()>& func)
|
void MainWindow::runOnUIThread(const std::function<void()>& func)
|
||||||
{
|
{
|
||||||
func();
|
func();
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ public:
|
|||||||
void refreshGameList(bool invalidate_cache);
|
void refreshGameList(bool invalidate_cache);
|
||||||
void refreshGameListModel();
|
void refreshGameListModel();
|
||||||
void cancelGameListRefresh();
|
void cancelGameListRefresh();
|
||||||
|
QIcon getIconForGame(const QString& path);
|
||||||
|
|
||||||
void runOnUIThread(const std::function<void()>& func);
|
void runOnUIThread(const std::function<void()>& func);
|
||||||
void requestShutdown(bool allow_confirm, bool allow_save_to_state, bool save_state, bool check_safety,
|
void requestShutdown(bool allow_confirm, bool allow_save_to_state, bool save_state, bool check_safety,
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ SettingsWindow::SettingsWindow(const GameList::Entry* entry, std::unique_ptr<INI
|
|||||||
m_hash(entry->hash)
|
m_hash(entry->hash)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
|
if (const QIcon icon = g_main_window->getIconForGame(QString::fromStdString(entry->path)); !icon.isNull())
|
||||||
|
setWindowIcon(icon);
|
||||||
|
|
||||||
setGameTitle(entry->GetDisplayTitle(GameList::ShouldShowLocalizedTitles()));
|
setGameTitle(entry->GetDisplayTitle(GameList::ShouldShowLocalizedTitles()));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user