mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-08-03 11:27:33 -04:00
apply suggestion
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
f7f7e1e336
commit
2bdd8c2d5a
@ -1673,7 +1673,7 @@ void Application::ShowGlobalSettings(class QWidget* parent, QString open_page)
|
||||
SettingsObject::Lock lock(APPLICATION->settings());
|
||||
PageDialog dlg(m_globalSettingsProvider.get(), open_page, parent);
|
||||
connect(&dlg, &PageDialog::applied, this, &Application::globalSettingsApplied);
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
dlg.showFullScreen();
|
||||
dlg.setFixedSize(dlg.width(), dlg.height());
|
||||
}
|
||||
|
@ -84,9 +84,9 @@ bool isSnap()
|
||||
#endif
|
||||
}
|
||||
|
||||
bool isGameScope()
|
||||
bool isSteamDeckGameScope()
|
||||
{
|
||||
return qgetenv("XDG_CURRENT_DESKTOP") == "gamescope";
|
||||
return qgetenv("XDG_CURRENT_DESKTOP") == "gamescope" && qgetenv("STEAM_DECK") == "1";
|
||||
}
|
||||
|
||||
} // namespace DesktopServices
|
||||
|
@ -45,5 +45,5 @@ bool isSnap();
|
||||
/**
|
||||
* Determine whether the launcher is running in a gamescope environment
|
||||
*/
|
||||
bool isGameScope();
|
||||
bool isSteamDeckGameScope();
|
||||
} // namespace DesktopServices
|
||||
|
@ -119,7 +119,7 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget* parent) : QMainWin
|
||||
{
|
||||
auto base64State = APPLICATION->settings()->get("ConsoleWindowState").toString().toUtf8();
|
||||
restoreState(QByteArray::fromBase64(base64State));
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else {
|
||||
|
@ -232,7 +232,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
||||
// add a close button at the end of the main toolbar when running on gamescope / steam deck
|
||||
// this is only needed on gamescope because it defaults to an X11/XWayland session and
|
||||
// does not implement decorations
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
ui->mainToolBar->addAction(ui->actionCloseWindow);
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
|
@ -181,7 +181,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDia
|
||||
connect(ui->closeButton, &QPushButton::clicked, this, &AboutDialog::close);
|
||||
|
||||
connect(ui->aboutQt, &QPushButton::clicked, &QApplication::aboutQt);
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ ExportInstanceDialog::ExportInstanceDialog(InstancePtr instance, QWidget* parent
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK"));
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ ExportToModListDialog::ExportToModListDialog(QString name, QList<Mod*> mods, QWi
|
||||
ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
|
||||
ui->buttonBox->button(QDialogButtonBox::Save)->setText(tr("Save"));
|
||||
triggerImp();
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ InstallLoaderDialog::InstallLoaderDialog(std::shared_ptr<PackProfile> profile, c
|
||||
connect(container, &PageContainer::selectedPageChanged, this, [this](BasePage* previous, BasePage* current) { validate(current); });
|
||||
pageCast(container->selectedPage())->selectSearch();
|
||||
validate(container->selectedPage());
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ NewInstanceDialog::NewInstanceDialog(const QString& initialGroup,
|
||||
|
||||
connect(m_container, &PageContainer::selectedPageChanged, this, &NewInstanceDialog::selectedPageChanged);
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else {
|
||||
|
@ -24,7 +24,7 @@ NewsDialog::NewsDialog(QList<NewsEntryPtr> entries, QWidget* parent) : QDialog(p
|
||||
|
||||
ui->currentArticleContentBrowser->setText(article_entry->content);
|
||||
ui->currentArticleContentBrowser->flush();
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ ModDownloadDialog::ModDownloadDialog(QWidget* parent, const std::shared_ptr<ModF
|
||||
initializeContainer();
|
||||
connectButtons();
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else if (!geometrySaveKey().isEmpty())
|
||||
@ -321,7 +321,7 @@ ResourcePackDownloadDialog::ResourcePackDownloadDialog(QWidget* parent,
|
||||
initializeContainer();
|
||||
connectButtons();
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else if (!geometrySaveKey().isEmpty())
|
||||
@ -349,7 +349,7 @@ TexturePackDownloadDialog::TexturePackDownloadDialog(QWidget* parent,
|
||||
initializeContainer();
|
||||
connectButtons();
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else if (!geometrySaveKey().isEmpty())
|
||||
@ -377,7 +377,7 @@ ShaderPackDownloadDialog::ShaderPackDownloadDialog(QWidget* parent,
|
||||
initializeContainer();
|
||||
connectButtons();
|
||||
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
showFullScreen();
|
||||
setFixedSize(this->width(), this->height());
|
||||
} else if (!geometrySaveKey().isEmpty())
|
||||
|
@ -91,7 +91,7 @@ VersionSelectDialog::VersionSelectDialog(BaseVersionList* vlist, QString title,
|
||||
if (!cancelable) {
|
||||
m_buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
|
||||
}
|
||||
if (DesktopServices::isGameScope()) {
|
||||
if (DesktopServices::isSteamDeckGameScope()) {
|
||||
this->showFullScreen();
|
||||
this->setFixedSize(this->width(), this->height());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user