mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add a new editor theme
Co-authored-by: passivestar <60579014+passivestar@users.noreply.github.com>
This commit is contained in:
@@ -59,7 +59,7 @@ void QuickSettingsDialog::_fetch_setting_values() {
|
||||
#ifndef ANDROID_ENABLED
|
||||
editor_languages = pi.hint_string.split(";", false);
|
||||
#endif
|
||||
} else if (pi.name == "interface/theme/preset") {
|
||||
} else if (pi.name == "interface/theme/color_preset") {
|
||||
editor_themes = pi.hint_string.split(",");
|
||||
} else if (pi.name == "interface/editor/display_scale") {
|
||||
editor_scales = pi.hint_string.split(",");
|
||||
@@ -93,7 +93,7 @@ void QuickSettingsDialog::_update_current_values() {
|
||||
|
||||
// Theme options.
|
||||
{
|
||||
const String current_theme = EDITOR_GET("interface/theme/preset");
|
||||
const String current_theme = EDITOR_GET("interface/theme/color_preset");
|
||||
|
||||
for (int i = 0; i < editor_themes.size(); i++) {
|
||||
const String &theme_value = editor_themes[i];
|
||||
@@ -185,7 +185,7 @@ void QuickSettingsDialog::_language_selected(int p_id) {
|
||||
|
||||
void QuickSettingsDialog::_theme_selected(int p_id) {
|
||||
const String selected_theme = theme_option_button->get_item_text(p_id);
|
||||
_set_setting_value("interface/theme/preset", selected_theme);
|
||||
_set_setting_value("interface/theme/color_preset", selected_theme);
|
||||
|
||||
custom_theme_label->set_visible(selected_theme == "Custom");
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void QuickSettingsDialog::update_size_limits(const Size2 &p_max_popup_size) {
|
||||
void QuickSettingsDialog::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
settings_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles)));
|
||||
settings_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("quick_settings_panel"), SNAME("ProjectManager")));
|
||||
|
||||
restart_required_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
|
||||
custom_theme_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor)));
|
||||
@@ -307,7 +307,7 @@ QuickSettingsDialog::QuickSettingsDialog() {
|
||||
theme_option_button->add_item(theme_value, i);
|
||||
}
|
||||
|
||||
_add_setting_control(TTRC("Interface Theme"), theme_option_button);
|
||||
_add_setting_control(TTRC("Color Preset"), theme_option_button);
|
||||
|
||||
custom_theme_label = memnew(Label(TTRC("Custom preset can be further configured in the editor.")));
|
||||
custom_theme_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
|
||||
|
||||
Reference in New Issue
Block a user