diff options
author | marynate <mary.w.nate@gmail.com> | 2014-06-17 13:38:27 +0800 |
---|---|---|
committer | marynate <mary.w.nate@gmail.com> | 2014-06-17 13:39:01 +0800 |
commit | b9a8c39af5b1cb30affaeecb99c99fbb9141cee9 (patch) | |
tree | b0fe0bf93074db0fd6ea9821539fab414e82aaf6 | |
parent | 8b31ae491f63a7d8b6fabe099b77ab2bf332d45b (diff) |
Use toolbutton for clear search term
-rw-r--r-- | tools/editor/project_manager.cpp | 11 | ||||
-rw-r--r-- | tools/editor/project_manager.h | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 000e61085f..5983a5c32d 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -1023,6 +1023,14 @@ void ProjectListFilter::_filter_option_selected(int p_idx) { } } +void ProjectListFilter::_notification(int p_what) { + switch(p_what) { + case NOTIFICATION_ENTER_SCENE: { + clear_search_button->set_icon(get_icon("CloseHover","EditorIcons")); + } break; + } +} + void ProjectListFilter::_bind_methods() { ObjectTypeDB::bind_method(_MD("_command"),&ProjectListFilter::_command); @@ -1049,8 +1057,7 @@ ProjectListFilter::ProjectListFilter() { search_box->set_h_size_flags(SIZE_EXPAND_FILL); add_child(search_box); - clear_search_button = memnew( Button ); - clear_search_button->set_text("clear"); + clear_search_button = memnew( ToolButton ); clear_search_button->connect("pressed",this,"_command",make_binds(CMD_CLEAR_FILTER)); add_child(clear_search_button); diff --git a/tools/editor/project_manager.h b/tools/editor/project_manager.h index b2b3144c3d..c51a885d7d 100644 --- a/tools/editor/project_manager.h +++ b/tools/editor/project_manager.h @@ -33,6 +33,7 @@ #include "scene/gui/tree.h" #include "scene/gui/scroll_container.h" #include "scene/gui/file_dialog.h" +#include "scene/gui/tool_button.h" class NewProjectDialog; class ProjectListFilter; @@ -104,7 +105,7 @@ private: OptionButton *filter_option; LineEdit *search_box; - Button *clear_search_button; + ToolButton *clear_search_button; enum FilterOption { FILTER_NAME, @@ -118,7 +119,7 @@ private: void _filter_option_selected(int p_idx); protected: - + void _notification(int p_what); static void _bind_methods(); public: |