summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-08-06 12:31:38 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-08-06 12:31:38 +0200
commitf544c461f0150ea92e8fe25bb63552407122d46f (patch)
treef5809a0ae6f11b51a3a88be08ac262396db9d17f /editor
parented991f890e33251a5f15b5a03628c83088e56af3 (diff)
parenteaf85e65828468480cbea468cff01e11563633cb (diff)
downloadredot-engine-f544c461f0150ea92e8fe25bb63552407122d46f.tar.gz
Merge pull request #95082 from m4gr3d/fix_display_scale_project_settings
[Android editor] Enable the display scale option in the Project manager's quick settings
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager/quick_settings_dialog.cpp19
-rw-r--r--editor/project_manager/quick_settings_dialog.h8
2 files changed, 20 insertions, 7 deletions
diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp
index ee53bd7927..a98d9073b0 100644
--- a/editor/project_manager/quick_settings_dialog.cpp
+++ b/editor/project_manager/quick_settings_dialog.cpp
@@ -43,7 +43,9 @@
#include "scene/gui/panel_container.h"
void QuickSettingsDialog::_fetch_setting_values() {
+#ifndef ANDROID_ENABLED
editor_languages.clear();
+#endif
editor_themes.clear();
editor_scales.clear();
editor_network_modes.clear();
@@ -55,7 +57,9 @@ void QuickSettingsDialog::_fetch_setting_values() {
for (const PropertyInfo &pi : editor_settings_properties) {
if (pi.name == "interface/editor/editor_language") {
+#ifndef ANDROID_ENABLED
editor_languages = pi.hint_string.split(",");
+#endif
} else if (pi.name == "interface/theme/preset") {
editor_themes = pi.hint_string.split(",");
} else if (pi.name == "interface/editor/display_scale") {
@@ -70,6 +74,7 @@ void QuickSettingsDialog::_fetch_setting_values() {
}
void QuickSettingsDialog::_update_current_values() {
+#ifndef ANDROID_ENABLED
// Language options.
{
const String current_lang = EDITOR_GET("interface/editor/editor_language");
@@ -82,6 +87,7 @@ void QuickSettingsDialog::_update_current_values() {
}
}
}
+#endif
// Theme options.
{
@@ -151,10 +157,12 @@ void QuickSettingsDialog::_add_setting_control(const String &p_text, Control *p_
container->add_child(p_control);
}
+#ifndef ANDROID_ENABLED
void QuickSettingsDialog::_language_selected(int p_id) {
const String selected_language = language_option_button->get_item_metadata(p_id);
_set_setting_value("interface/editor/editor_language", selected_language, true);
}
+#endif
void QuickSettingsDialog::_theme_selected(int p_id) {
const String selected_theme = theme_option_button->get_item_text(p_id);
@@ -195,7 +203,9 @@ void QuickSettingsDialog::_request_restart() {
}
void QuickSettingsDialog::update_size_limits(const Size2 &p_max_popup_size) {
+#ifndef ANDROID_ENABLED
language_option_button->get_popup()->set_max_size(p_max_popup_size);
+#endif
}
void QuickSettingsDialog::_notification(int p_what) {
@@ -237,6 +247,7 @@ QuickSettingsDialog::QuickSettingsDialog() {
settings_list = memnew(VBoxContainer);
settings_list_panel->add_child(settings_list);
+#ifndef ANDROID_ENABLED
// Language options.
{
language_option_button = memnew(OptionButton);
@@ -252,6 +263,7 @@ QuickSettingsDialog::QuickSettingsDialog() {
_add_setting_control(TTR("Language"), language_option_button);
}
+#endif
// Theme options.
{
@@ -319,13 +331,6 @@ QuickSettingsDialog::QuickSettingsDialog() {
}
_update_current_values();
-
-#ifdef ANDROID_ENABLED
- // The language selection dropdown doesn't work on Android (as the setting isn't saved), see GH-60353.
- // Also, the dropdown it spawns is very tall and can't be scrolled without a hardware mouse.
- language_option_button->hide();
- scale_option_button->hide();
-#endif
}
// Restart required panel.
diff --git a/editor/project_manager/quick_settings_dialog.h b/editor/project_manager/quick_settings_dialog.h
index 7a03996934..938a6de16d 100644
--- a/editor/project_manager/quick_settings_dialog.h
+++ b/editor/project_manager/quick_settings_dialog.h
@@ -43,7 +43,9 @@ class VBoxContainer;
class QuickSettingsDialog : public AcceptDialog {
GDCLASS(QuickSettingsDialog, AcceptDialog);
+#ifndef ANDROID_ENABLED
Vector<String> editor_languages;
+#endif
Vector<String> editor_themes;
Vector<String> editor_scales;
Vector<String> editor_network_modes;
@@ -57,7 +59,11 @@ class QuickSettingsDialog : public AcceptDialog {
void _add_setting_control(const String &p_text, Control *p_control);
+#ifndef ANDROID_ENABLED
+ // The language selection dropdown doesn't work on Android (as the setting isn't saved), see GH-60353.
+ // Also, the dropdown it spawns is very tall and can't be scrolled without a hardware mouse.
OptionButton *language_option_button = nullptr;
+#endif
OptionButton *theme_option_button = nullptr;
OptionButton *scale_option_button = nullptr;
OptionButton *network_mode_option_button = nullptr;
@@ -65,7 +71,9 @@ class QuickSettingsDialog : public AcceptDialog {
Label *custom_theme_label = nullptr;
+#ifndef ANDROID_ENABLED
void _language_selected(int p_id);
+#endif
void _theme_selected(int p_id);
void _scale_selected(int p_id);
void _network_mode_selected(int p_id);