From 910febeeb00295492cddff43c4fc212450d21e6a Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Thu, 27 Mar 2025 00:37:39 +0000 Subject: [PATCH] Try to make getchoo requested changes Signed-off-by: TheKodeToad --- launcher/ui/pages/global/JavaPage.ui | 115 ++++------ launcher/ui/widgets/CustomCommands.cpp | 9 +- launcher/ui/widgets/CustomCommands.ui | 62 ++--- launcher/ui/widgets/EnvironmentVariables.cpp | 10 +- launcher/ui/widgets/EnvironmentVariables.ui | 41 ++-- launcher/ui/widgets/JavaSettingsWidget.ui | 108 ++++----- .../ui/widgets/MinecraftSettingsWidget.cpp | 9 +- .../ui/widgets/MinecraftSettingsWidget.ui | 212 ++++++++---------- 8 files changed, 266 insertions(+), 300 deletions(-) diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui index bc5e9523f..3b5d797d6 100644 --- a/launcher/ui/pages/global/JavaPage.ui +++ b/launcher/ui/pages/global/JavaPage.ui @@ -17,18 +17,6 @@ - - 0 - - - 0 - - - 0 - - - 0 - @@ -49,8 +37,8 @@ 0 0 - 535 - 606 + 523 + 594 @@ -65,64 +53,55 @@ - Management + Installations - - - Downloaded Java Versions + + + + + Download + + + + + + + Remove + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Refresh + + + + + + + + + + 0 + 0 + - - - - - - - Download - - - - - - - Remove - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Refresh - - - - - - - - - - 0 - 0 - - - - - diff --git a/launcher/ui/widgets/CustomCommands.cpp b/launcher/ui/widgets/CustomCommands.cpp index 9b98d7409..45bd0cbea 100644 --- a/launcher/ui/widgets/CustomCommands.cpp +++ b/launcher/ui/widgets/CustomCommands.cpp @@ -44,13 +44,14 @@ CustomCommands::~CustomCommands() CustomCommands::CustomCommands(QWidget* parent) : QWidget(parent), ui(new Ui::CustomCommands) { ui->setupUi(this); + connect(ui->overrideCheckBox, &QCheckBox::toggled, ui->customCommandsWidget, &QWidget::setEnabled); } void CustomCommands::initialize(bool checkable, bool checked, const QString& prelaunch, const QString& wrapper, const QString& postexit) { - ui->customCommandsGroupBox->setCheckable(checkable); + ui->overrideCheckBox->setVisible(checkable); if (checkable) { - ui->customCommandsGroupBox->setChecked(checked); + ui->overrideCheckBox->setChecked(checked); } ui->preLaunchCmdTextBox->setText(prelaunch); ui->wrapperCmdTextBox->setText(wrapper); @@ -64,9 +65,9 @@ void CustomCommands::retranslate() bool CustomCommands::checked() const { - if (!ui->customCommandsGroupBox->isCheckable()) + if (!ui->overrideCheckBox->isVisible()) return true; - return ui->customCommandsGroupBox->isChecked(); + return ui->overrideCheckBox->isChecked(); } QString CustomCommands::prelaunchCommand() const diff --git a/launcher/ui/widgets/CustomCommands.ui b/launcher/ui/widgets/CustomCommands.ui index b485c293e..53fca9419 100644 --- a/launcher/ui/widgets/CustomCommands.ui +++ b/launcher/ui/widgets/CustomCommands.ui @@ -24,20 +24,30 @@ 0 - + + + Override &Global Settings + + + true + + + + + true - - &Custom Commands - - - true - - - false - + + 0 + + + 0 + + + 0 + @@ -48,9 +58,25 @@ + + + + + + + P&ost-exit command: + + + labelPostExitCmd + + + + + + @@ -61,22 +87,6 @@ - - - - - - - P&ost-exit command: - - - postExitCmdTextBox - - - - - - diff --git a/launcher/ui/widgets/EnvironmentVariables.cpp b/launcher/ui/widgets/EnvironmentVariables.cpp index 633fc6122..653f0d23d 100644 --- a/launcher/ui/widgets/EnvironmentVariables.cpp +++ b/launcher/ui/widgets/EnvironmentVariables.cpp @@ -50,6 +50,8 @@ EnvironmentVariables::EnvironmentVariables(QWidget* parent) : QWidget(parent), u }); connect(ui->clear, &QPushButton::clicked, this, [this] { ui->list->clear(); }); + + connect(ui->overrideCheckBox, &QCheckBox::toggled, ui->settingsWidget, &QWidget::setEnabled); } EnvironmentVariables::~EnvironmentVariables() @@ -60,8 +62,8 @@ EnvironmentVariables::~EnvironmentVariables() void EnvironmentVariables::initialize(bool instance, bool override, const QMap& value) { // update widgets to settings - ui->groupBox->setCheckable(instance); - ui->groupBox->setChecked(override); + ui->overrideCheckBox->setVisible(instance); + ui->overrideCheckBox->setChecked(override); // populate ui->list->clear(); @@ -94,9 +96,9 @@ void EnvironmentVariables::retranslate() bool EnvironmentVariables::override() const { - if (!ui->groupBox->isCheckable()) + if (!ui->overrideCheckBox->isVisible()) return false; - return ui->groupBox->isChecked(); + return ui->overrideCheckBox->isChecked(); } QMap EnvironmentVariables::value() const diff --git a/launcher/ui/widgets/EnvironmentVariables.ui b/launcher/ui/widgets/EnvironmentVariables.ui index 828626d12..cc52b5d10 100644 --- a/launcher/ui/widgets/EnvironmentVariables.ui +++ b/launcher/ui/widgets/EnvironmentVariables.ui @@ -14,27 +14,34 @@ Form - - 0 - - - 0 - - - 0 - - - 0 - - - - &Environment Variables + + + Override &Global Settings - + true - + + + + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/launcher/ui/widgets/JavaSettingsWidget.ui b/launcher/ui/widgets/JavaSettingsWidget.ui index 5cc894b8e..3094aadc8 100644 --- a/launcher/ui/widgets/JavaSettingsWidget.ui +++ b/launcher/ui/widgets/JavaSettingsWidget.ui @@ -26,37 +26,6 @@ 0 - - - - - - Test S&ettings - - - - - - - Open Java &Downloader - - - - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - @@ -72,6 +41,16 @@ false + + + + Java &Executable + + + javaPathTextBox + + + @@ -99,23 +78,6 @@ - - - - If enabled, the launcher will not check if an instance is compatible with the selected Java version. - - - Skip Java compatibility checks - - - - - - - Auto-&detect Java version - - - @@ -136,16 +98,54 @@ - - + + - Java &Executable - - - javaPathTextBox + Auto-&detect Java version + + + + If enabled, the launcher will not check if an instance is compatible with the selected Java version. + + + Skip Java compatibility checks + + + + + + + + + Test S&ettings + + + + + + + Open Java &Downloader + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + diff --git a/launcher/ui/widgets/MinecraftSettingsWidget.cpp b/launcher/ui/widgets/MinecraftSettingsWidget.cpp index cec7f267f..2f22ae54a 100644 --- a/launcher/ui/widgets/MinecraftSettingsWidget.cpp +++ b/launcher/ui/widgets/MinecraftSettingsWidget.cpp @@ -50,14 +50,11 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance, m_ui->setupUi(this); if (m_instance == nullptr) { - for (int i = m_ui->settingsTabs->count() - 1; i >= 0; --i) { - const QString name = m_ui->settingsTabs->widget(i)->objectName(); - - if (name == "javaPage" || name == "launchPage") - m_ui->settingsTabs->removeTab(i); - } + m_ui->settingsTabs->removeTab(1); m_ui->openGlobalSettingsButton->setVisible(false); + m_ui->instanceAccountGroupBox->hide(); + m_ui->serverJoinGroupBox->hide(); } else { m_javaSettings = new JavaSettingsWidget(m_instance, this); m_ui->javaScrollArea->setWidget(m_javaSettings); diff --git a/launcher/ui/widgets/MinecraftSettingsWidget.ui b/launcher/ui/widgets/MinecraftSettingsWidget.ui index 34fa9af80..0edbeacb7 100644 --- a/launcher/ui/widgets/MinecraftSettingsWidget.ui +++ b/launcher/ui/widgets/MinecraftSettingsWidget.ui @@ -58,9 +58,9 @@ 0 - 0 - 610 - 610 + -125 + 603 + 786 @@ -203,6 +203,79 @@ + + + + &Override Default Account + + + true + + + false + + + + + + + 0 + 0 + + + + Account + + + + + + + + 0 + 0 + + + + + + + + + + + Enable &Auto-join + + + true + + + false + + + + + + Server address + + + + + + + + + + Singleplayer world + + + + + + + + + @@ -352,7 +425,7 @@ 0 0 624 - 291 + 287 @@ -375,8 +448,8 @@ 0 0 - 610 - 501 + 603 + 470 @@ -564,118 +637,6 @@ - - - Launch - - - - - - true - - - - - 0 - 0 - 624 - 291 - - - - - - - Override default &account - - - true - - - false - - - - - - - 0 - 0 - - - - Account - - - - - - - - 0 - 0 - - - - - - - - - - - Set a &target to join on launch - - - true - - - false - - - - - - Server address - - - - - - - - - - Singleplayer world - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Custom Commands @@ -691,6 +652,18 @@ Environment Variables + + 0 + + + 0 + + + 0 + + + 0 + @@ -737,9 +710,6 @@ enableMangoHud useDiscreteGpuCheck useZink - scrollArea_3 - instanceAccountGroupBox - serverJoinGroupBox serverJoinAddressButton serverJoinAddress worldJoinButton