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
This commit is contained in:
Łukasz Rutkowski 2018-07-26 13:45:38 +02:00
parent 0fc1c4eda8
commit e8a435c8cd
23 changed files with 250 additions and 194 deletions

View file

@ -197,6 +197,7 @@ void FileSystemDock::_notification(int p_what) {
button_hist_next->connect("pressed", this, "_fw_history");
button_hist_prev->connect("pressed", this, "_bw_history");
search_box->add_icon_override("right_icon", get_icon("Search", ei));
search_box->set_clear_button_enabled(true);
button_hist_next->set_icon(get_icon("Forward", ei));
button_hist_prev->set_icon(get_icon("Back", ei));
@ -253,6 +254,7 @@ void FileSystemDock::_notification(int p_what) {
button_hist_prev->set_icon(get_icon("Back", ei));
search_box->add_icon_override("right_icon", get_icon("Search", ei));
search_box->set_clear_button_enabled(true);
if (new_mode != display_mode) {
set_display_mode(new_mode);