diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/file_dialog.cpp | 11 | ||||
-rw-r--r-- | scene/gui/grid_container.cpp | 1 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index a7ff1431bd..fbcfdb69bb 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -156,7 +156,6 @@ void FileDialog::_action_pressed() { if (mode==MODE_SAVE_FILE) { - String ext = f.extension(); bool valid=false; if (filter->get_selected()==filter->get_item_count()-1) { @@ -184,7 +183,8 @@ void FileDialog::_action_pressed() { if (idx>=0 && idx<filters.size()) { String flt=filters[idx].get_slice(";",0); - for (int j=0;j<flt.get_slice_count(",");j++) { + int filterSliceCount=flt.get_slice_count(","); + for (int j=0;j<filterSliceCount;j++) { String str = (flt.get_slice(",",j).strip_edges()); if (f.match(str)) { @@ -192,6 +192,13 @@ void FileDialog::_action_pressed() { break; } } + + if (!valid && filterSliceCount>0) { + String str = (flt.get_slice(",",0).strip_edges()); + f+=str.substr(1, str.length()-1); + file->set_text(f.get_file()); + valid=true; + } } else { valid=true; } diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index f54345cdb8..582693eb3a 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -226,5 +226,6 @@ Size2 GridContainer::get_minimum_size() const { GridContainer::GridContainer() { + set_stop_mouse(false); columns=1; } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index d589b93049..8855627bb4 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -298,7 +298,7 @@ void TextEdit::_update_scrollbars() { int hscroll_rows = ((hmin.height-1)/get_row_height())+1; int visible_rows = get_visible_rows(); - int total_rows = text.size() * cache.line_spacing; + int total_rows = text.size(); int vscroll_pixels = v_scroll->get_combined_minimum_size().width; int visible_width = size.width - cache.style_normal->get_minimum_size().width; |