1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Use toolbutton for clear search term

This commit is contained in:
marynate
2014-06-17 13:38:27 +08:00
parent 8b31ae491f
commit b9a8c39af5
2 changed files with 12 additions and 4 deletions

View File

@@ -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);