Introduce editor theme spacing presets

This change adds a new editor setting related to theming
which controls base and additional spacing used in the
generated editor theme. These values can also be changed
manually by the user to customize their experience.

Limited effort was applied to make sure both Compact and
Spacious presets work and look fine, but further tuning
and adjustments are totally expected. Some controls will
require layout changes or additional fixes to their constants.
This commit is contained in:
Yuri Sizov 2024-01-15 13:14:55 +01:00
parent 635b8a1474
commit dc3b07e551
7 changed files with 155 additions and 101 deletions

View file

@ -62,8 +62,12 @@ void EditorSettingsDialog::_settings_changed() {
void EditorSettingsDialog::_settings_property_edited(const String &p_name) {
String full_name = inspector->get_full_item_path(p_name);
// Set theme presets to Custom when controlled settings change.
if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast" || full_name == "interface/theme/draw_extra_borders") {
EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom"); // set preset to Custom
EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom");
} else if (full_name == "interface/theme/base_spacing" || full_name == "interface/theme/additional_spacing") {
EditorSettings::get_singleton()->set_manually("interface/theme/spacing_preset", "Custom");
} else if (full_name.begins_with("text_editor/theme/highlighting")) {
EditorSettings::get_singleton()->set_manually("text_editor/theme/color_theme", "Custom");
}