diff options
-rw-r--r-- | doc/classes/GraphEdit.xml | 4 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 2 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/script_create_dialog.cpp | 13 | ||||
-rw-r--r-- | editor/script_create_dialog.h | 1 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 10 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 3041a7cb7f..d8732f4f49 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -316,6 +316,10 @@ </theme_item> <theme_item name="reset" type="Texture"> </theme_item> + <theme_item name="selection_fill" type="Color" default="Color( 1, 1, 1, 0.3 )"> + </theme_item> + <theme_item name="selection_stroke" type="Color" default="Color( 1, 1, 1, 0.8 )"> + </theme_item> <theme_item name="snap" type="Texture"> </theme_item> </theme_items> diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 15fb6a9521..2cacc767c8 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1012,6 +1012,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("grid_major", "GraphEdit", Color(0.0, 0.0, 0.0, 0.15)); theme->set_color("grid_minor", "GraphEdit", Color(0.0, 0.0, 0.0, 0.07)); } + theme->set_color("selection_fill", "GraphEdit", theme->get_color("box_selection_fill_color", "Editor")); + theme->set_color("selection_stroke", "GraphEdit", theme->get_color("box_selection_stroke_color", "Editor")); theme->set_color("activity", "GraphEdit", accent_color); theme->set_icon("minus", "GraphEdit", theme->get_icon("ZoomLess", "EditorIcons")); theme->set_icon("more", "GraphEdit", theme->get_icon("ZoomMore", "EditorIcons")); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 6b68d3f149..fb5c2b25c9 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1761,7 +1761,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected fpath = fpath.get_base_dir(); } make_script_dialog->config("Node", fpath.plus_file("new_script.gd"), false); - make_script_dialog->popup_centered(Size2(300, 300) * EDSCALE); + make_script_dialog->popup_centered(); } break; case FILE_COPY_PATH: { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 335466b0c5..d0bd57d658 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1004,8 +1004,8 @@ void ScriptEditor::_menu_option(int p_option) { ScriptEditorBase *current = _get_current_editor(); switch (p_option) { case FILE_NEW: { - script_create_dialog->config("Node", "new_script"); - script_create_dialog->popup_centered(Size2(300, 300) * EDSCALE); + script_create_dialog->config("Node", "new_script", false); + script_create_dialog->popup_centered(); } break; case FILE_NEW_TEXTFILE: { file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE); diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index e1f9ed497c..25bc13033c 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -678,6 +678,11 @@ void ScriptCreateDialog::_update_dialog() { } } + if (!_can_be_built_in()) { + internal->set_pressed(false); + } + internal->set_disabled(!_can_be_built_in()); + /* Is Script created or loaded from existing file */ if (is_built_in) { @@ -685,8 +690,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(true); parent_search_button->set_disabled(false); parent_browse_button->set_disabled(!can_inherit_from_file); - internal->set_visible(_can_be_built_in()); - internal_label->set_visible(_can_be_built_in()); _msg_path_valid(true, TTR("Built-in script (into scene file).")); } else if (is_new_script_created) { // New Script Created @@ -694,8 +697,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(true); parent_search_button->set_disabled(false); parent_browse_button->set_disabled(!can_inherit_from_file); - internal->set_visible(_can_be_built_in()); - internal_label->set_visible(_can_be_built_in()); if (is_path_valid) { _msg_path_valid(true, TTR("Will create a new script file.")); } @@ -705,7 +706,6 @@ void ScriptCreateDialog::_update_dialog() { parent_name->set_editable(false); parent_search_button->set_disabled(true); parent_browse_button->set_disabled(true); - internal->set_disabled(!_can_be_built_in()); if (is_path_valid) { _msg_path_valid(true, TTR("Will load an existing script file.")); } @@ -834,8 +834,7 @@ ScriptCreateDialog::ScriptCreateDialog() { internal = memnew(CheckBox); internal->set_text(TTR("On")); internal->connect("pressed", this, "_built_in_pressed"); - internal_label = memnew(Label(TTR("Built-in Script:"))); - gc->add_child(internal_label); + gc->add_child(memnew(Label(TTR("Built-in Script:")))); gc->add_child(internal); /* Path */ diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index 4d13bc9291..91d6315a78 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -58,7 +58,6 @@ class ScriptCreateDialog : public ConfirmationDialog { Button *path_button; EditorFileDialog *file_browse; CheckBox *internal; - Label *internal_label; VBoxContainer *path_vb; AcceptDialog *alert; CreateDialog *select_class; diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index d1650fea1e..be465751b6 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -777,14 +777,8 @@ void GraphEdit::_top_layer_draw() { } if (box_selecting) { - top_layer->draw_rect( - box_selecting_rect, - get_color("box_selection_fill_color", "Editor")); - - top_layer->draw_rect( - box_selecting_rect, - get_color("box_selection_stroke_color", "Editor"), - false); + top_layer->draw_rect(box_selecting_rect, get_color("selection_fill")); + top_layer->draw_rect(box_selecting_rect, get_color("selection_stroke"), false); } } diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 67351f07d2..cc76df62e5 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -851,6 +851,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("bg", "GraphEdit", make_stylebox(tree_bg_png, 4, 4, 4, 5)); theme->set_color("grid_minor", "GraphEdit", Color(1, 1, 1, 0.05)); theme->set_color("grid_major", "GraphEdit", Color(1, 1, 1, 0.2)); + theme->set_color("selection_fill", "GraphEdit", Color(1, 1, 1, 0.3)); + theme->set_color("selection_stroke", "GraphEdit", Color(1, 1, 1, 0.8)); theme->set_color("activity", "GraphEdit", Color(1, 1, 1)); theme->set_constant("bezier_len_pos", "GraphEdit", 80 * scale); theme->set_constant("bezier_len_neg", "GraphEdit", 160 * scale); |