diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-09-29 18:52:56 +0200 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-09-29 18:52:56 +0200 |
commit | 20eb17a685bb426b2de4a1e791d90241e1a5b5e6 (patch) | |
tree | c08d1ff68ab467dff08eb3c5b8bb4184b23bd6af | |
parent | 4f39ce32b9195405f934445b20059e86632b47f9 (diff) |
EditorSettings: Move interface/ properties to interface/editor
Fixes inconsistent behaviour where clicking on the "Interface"
in the Editor Settings wouldn't collapse the category as is the
case for all the other categories.
-rw-r--r-- | editor/code_editor.cpp | 4 | ||||
-rw-r--r-- | editor/editor_fonts.cpp | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 26 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 46 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 2 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 | ||||
-rw-r--r-- | editor/property_editor.cpp | 2 |
7 files changed, 43 insertions, 43 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index a7516c091f..985b336d20 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1010,7 +1010,7 @@ void CodeTextEditor::_reset_zoom() { Ref<DynamicFont> font = text_editor->get_font("font"); // reset source font size to default if (font.is_valid()) { - EditorSettings::get_singleton()->set("interface/source_font_size", 14); + EditorSettings::get_singleton()->set("interface/editor/source_font_size", 14); font->set_size(14); } } @@ -1066,7 +1066,7 @@ void CodeTextEditor::_font_resize_timeout() { if (font.is_valid()) { int new_size = CLAMP(font->get_size() + font_resize_val, 8 * EDSCALE, 96 * EDSCALE); if (new_size != font->get_size()) { - EditorSettings::get_singleton()->set("interface/source_font_size", new_size / EDSCALE); + EditorSettings::get_singleton()->set("interface/editor/source_font_size", new_size / EDSCALE); font->set_size(new_size); } diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 110b2a6a8c..cf6259bede 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -122,7 +122,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { dfmono->set_font_ptr(_font_Hack_Regular, _font_Hack_Regular_size); //dfd->set_force_autohinter(true); //just looks better..i think? - MAKE_DEFAULT_FONT(df, int(EditorSettings::get_singleton()->get("interface/font_size")) * EDSCALE); + MAKE_DEFAULT_FONT(df, int(EditorSettings::get_singleton()->get("interface/editor/font_size")) * EDSCALE); p_theme->set_default_theme_font(df); @@ -142,7 +142,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { Ref<DynamicFont> df_code; df_code.instance(); - df_code->set_size(int(EditorSettings::get_singleton()->get("interface/source_font_size")) * EDSCALE); + df_code->set_size(int(EditorSettings::get_singleton()->get("interface/editor/source_font_size")) * EDSCALE); df_code->set_font_data(dfmono); MAKE_FALLBACKS(df_code); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 21520875cd..49cb2a7e5a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -114,7 +114,7 @@ EditorNode *EditorNode::singleton = NULL; void EditorNode::_update_scene_tabs() { - bool show_rb = EditorSettings::get_singleton()->get("interface/show_script_in_scene_tabs"); + bool show_rb = EditorSettings::get_singleton()->get("interface/editor/show_script_in_scene_tabs"); scene_tabs->clear_tabs(); Ref<Texture> script_icon = gui_base->get_icon("Script", "EditorIcons"); @@ -282,8 +282,8 @@ void EditorNode::_notification(int p_what) { } if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); - property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true))); + scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/editor/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); + property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/editor/capitalize_properties", true))); Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); theme_base->set_theme(theme); @@ -2240,10 +2240,10 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case RUN_PROJECT_MANAGER: { if (!p_confirmed) { - bool save_each = EDITOR_DEF("interface/save_each_scene_on_quit", true); + bool save_each = EDITOR_DEF("interface/editor/save_each_scene_on_quit", true); if (_next_unsaved_scene(!save_each) == -1) { - bool confirm = EDITOR_DEF("interface/quit_confirmation", true); + bool confirm = EDITOR_DEF("interface/editor/quit_confirmation", true); if (confirm) { confirmation->get_ok()->set_text(p_option == FILE_QUIT ? TTR("Quit") : TTR("Yes")); @@ -2568,7 +2568,7 @@ void EditorNode::_editor_select(int p_which) { editor_data.get_editor_plugin(i)->notify_main_screen_changed(editor_plugin_screen->get_name()); } - if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) { + if (EditorSettings::get_singleton()->get("interface/editor/separate_distraction_mode")) { if (p_which == EDITOR_SCRIPT) { set_distraction_free_mode(script_distraction); } else { @@ -4101,7 +4101,7 @@ bool EditorNode::get_docks_visible() const { void EditorNode::_toggle_distraction_free_mode() { - if (EditorSettings::get_singleton()->get("interface/separate_distraction_mode")) { + if (EditorSettings::get_singleton()->get("interface/editor/separate_distraction_mode")) { int screen = -1; for (int i = 0; i < editor_table.size(); i++) { if (editor_plugin_screen == editor_table[i]) { @@ -4385,7 +4385,7 @@ void EditorNode::_open_imported() { void EditorNode::dim_editor(bool p_dimming) { static int dim_count = 0; - bool dim_ui = EditorSettings::get_singleton()->get("interface/dim_editor_on_dialog_popup"); + bool dim_ui = EditorSettings::get_singleton()->get("interface/editor/dim_editor_on_dialog_popup"); if (p_dimming) { if (dim_ui) { if (dim_count == 0) { @@ -4412,9 +4412,9 @@ void EditorNode::_start_dimming(bool p_dimming) { void EditorNode::_dim_timeout() { _dim_time += _dim_timer->get_wait_time(); - float wait_time = EditorSettings::get_singleton()->get("interface/dim_transition_time"); + float wait_time = EditorSettings::get_singleton()->get("interface/editor/dim_transition_time"); - float c = 1.0f - (float)EditorSettings::get_singleton()->get("interface/dim_amount"); + float c = 1.0f - (float)EditorSettings::get_singleton()->get("interface/editor/dim_amount"); Color base = _dimming ? Color(1, 1, 1) : Color(c, c, c); Color final = _dimming ? Color(c, c, c) : Color(1, 1, 1); @@ -4586,7 +4586,7 @@ EditorNode::EditorNode() { EditorSettings::create(); { - int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); + int dpi_mode = EditorSettings::get_singleton()->get("interface/editor/hidpi_mode"); if (dpi_mode == 0) { editor_set_scale(OS::get_singleton()->get_screen_dpi(0) >= 192 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); } else if (dpi_mode == 1) { @@ -4837,7 +4837,7 @@ EditorNode::EditorNode() { scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_align(Tabs::ALIGN_LEFT); - scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); + scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/editor/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE); scene_tabs->connect("tab_changed", this, "_scene_tab_changed"); scene_tabs->connect("right_button_pressed", this, "_scene_tab_script_edited"); @@ -5291,7 +5291,7 @@ EditorNode::EditorNode() { property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); property_editor->set_use_doc_hints(true); property_editor->set_hide_script(false); - property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true))); + property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/editor/capitalize_properties", true))); property_editor->hide_top_label(); property_editor->register_text_enter(search_box); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 325f30a453..d8c2d7cca4 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -453,7 +453,7 @@ String EditorSettings::get_settings_path() const { void EditorSettings::setup_language() { - String lang = get("interface/editor_language"); + String lang = get("interface/editor/editor_language"); if (lang == "en") return; //none to do @@ -555,29 +555,29 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { best = "en"; } - _initial_set("interface/editor_language", best); - hints["interface/editor_language"] = PropertyInfo(Variant::STRING, "interface/editor_language", PROPERTY_HINT_ENUM, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/editor_language", best); + hints["interface/editor/editor_language"] = PropertyInfo(Variant::STRING, "interface/editor/editor_language", PROPERTY_HINT_ENUM, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); } - _initial_set("interface/hidpi_mode", 0); - hints["interface/hidpi_mode"] = PropertyInfo(Variant::INT, "interface/hidpi_mode", PROPERTY_HINT_ENUM, "Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/show_script_in_scene_tabs", false); - _initial_set("interface/font_size", 14); - hints["interface/font_size"] = PropertyInfo(Variant::INT, "interface/font_size", PROPERTY_HINT_RANGE, "10,40,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/source_font_size", 14); - hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/custom_font", ""); - hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); - _initial_set("interface/dim_editor_on_dialog_popup", true); - _initial_set("interface/dim_amount", 0.6f); - hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/dim_transition_time", 0.08f); - hints["interface/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); - - _initial_set("interface/separate_distraction_mode", false); - - _initial_set("interface/save_each_scene_on_quit", true); // Regression - _initial_set("interface/quit_confirmation", true); + _initial_set("interface/editor/hidpi_mode", 0); + hints["interface/editor/hidpi_mode"] = PropertyInfo(Variant::INT, "interface/editor/hidpi_mode", PROPERTY_HINT_ENUM, "Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/show_script_in_scene_tabs", false); + _initial_set("interface/editor/font_size", 14); + hints["interface/editor/font_size"] = PropertyInfo(Variant::INT, "interface/editor/font_size", PROPERTY_HINT_RANGE, "10,40,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/source_font_size", 14); + hints["interface/editor/source_font_size"] = PropertyInfo(Variant::INT, "interface/editor/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/custom_font", ""); + hints["interface/editor/custom_font"] = PropertyInfo(Variant::STRING, "interface/editor/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + _initial_set("interface/editor/dim_editor_on_dialog_popup", true); + _initial_set("interface/editor/dim_amount", 0.6f); + hints["interface/editor/dim_amount"] = PropertyInfo(Variant::REAL, "interface/editor/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); + _initial_set("interface/editor/dim_transition_time", 0.08f); + hints["interface/editor/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/editor/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); + + _initial_set("interface/editor/separate_distraction_mode", false); + + _initial_set("interface/editor/save_each_scene_on_quit", true); // Regression + _initial_set("interface/editor/quit_confirmation", true); _initial_set("interface/theme/preset", 0); hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Light,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); @@ -610,7 +610,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["filesystem/directories/default_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/default_project_path", PROPERTY_HINT_GLOBAL_DIR); _initial_set("filesystem/directories/default_project_export_path", ""); hints["global/default_project_export_path"] = PropertyInfo(Variant::STRING, "global/default_project_export_path", PROPERTY_HINT_GLOBAL_DIR); - _initial_set("interface/show_script_in_scene_tabs", false); + _initial_set("interface/editor/show_script_in_scene_tabs", false); _initial_set("text_editor/theme/color_theme", "Adaptive"); hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Adaptive,Default"); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index b33c36867a..63cffa125a 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -990,7 +990,7 @@ Ref<Theme> create_custom_theme() { theme = ResourceLoader::load(custom_theme); } - String global_font = EditorSettings::get_singleton()->get("interface/custom_font"); + String global_font = EditorSettings::get_singleton()->get("interface/editor/custom_font"); if (global_font != "") { Ref<Font> fnt = ResourceLoader::load(global_font); if (fnt.is_valid()) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c679b44342..1a767dad05 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1418,7 +1418,7 @@ ProjectManager::ProjectManager() { EditorSettings::get_singleton()->set_optimize_save(false); //just write settings as they came { - int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); + int dpi_mode = EditorSettings::get_singleton()->get("interface/editor/hidpi_mode"); if (dpi_mode == 0) { editor_set_scale(OS::get_singleton()->get_screen_dpi(0) >= 192 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x > 2000 ? 2.0 : 1.0); } else if (dpi_mode == 1) { diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index fcae4c04fb..9665f48e42 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -4257,7 +4257,7 @@ PropertyEditor::PropertyEditor() { use_filter = false; subsection_selectable = false; property_selectable = false; - show_type_icons = EDITOR_DEF("interface/show_type_icons", false); + show_type_icons = EDITOR_DEF("interface/editor/show_type_icons", false); } PropertyEditor::~PropertyEditor() { |