From e8a435c8cdc5778ebae5e66d983a7bc720f81e85 Mon Sep 17 00:00:00 2001 From: Ɓukasz Rutkowski Date: Thu, 26 Jul 2018 13:45:38 +0200 Subject: Add clear text button to LineEdit - Add pressed state to clear button - Enable clear button on all inputs with search icon - Remove duplicate clear buttons - Fix rendering of icon for center and right alignments - Add clear button to more search fields - Add clear icon to default theme - Add method to control enabled state of clear button - Add property to enable clear button from inspector --- editor/plugins/asset_library_editor_plugin.cpp | 4 ++++ editor/plugins/script_editor_plugin.cpp | 3 +++ editor/plugins/tile_map_editor_plugin.cpp | 1 + 3 files changed, 8 insertions(+) (limited to 'editor/plugins') diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index e98dfceb90..b7dc82bfb0 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -554,6 +554,8 @@ void EditorAssetLibrary::_notification(int p_what) { error_tr->set_texture(get_icon("Error", "EditorIcons")); reverse->set_icon(get_icon("Sort", "EditorIcons")); + filter->add_icon_override("right_icon", get_icon("Search", "EditorIcons")); + filter->set_clear_button_enabled(true); error_label->raise(); } break; @@ -604,6 +606,8 @@ void EditorAssetLibrary::_notification(int p_what) { library_scroll_bg->add_style_override("panel", get_stylebox("bg", "Tree")); error_tr->set_texture(get_icon("Error", "EditorIcons")); reverse->set_icon(get_icon("Sort", "EditorIcons")); + filter->add_icon_override("right_icon", get_icon("Search", "EditorIcons")); + filter->set_clear_button_enabled(true); } break; } } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index af242e2d98..55d2353d39 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -219,6 +219,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { connect("confirmed", this, "_confirmed"); + + search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons")); + search_box->set_clear_button_enabled(true); } break; } } diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 0b84535c19..78f73bbdba 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -74,6 +74,7 @@ void TileMapEditor::_notification(int p_what) { rotate_270->set_icon(get_icon("Rotate270", "EditorIcons")); search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons")); + search_box->set_clear_button_enabled(true); PopupMenu *p = options->get_popup(); p->set_item_icon(p->get_item_index(OPTION_PAINTING), get_icon("Edit", "EditorIcons")); -- cgit v1.2.3