Better file dialog confirm button behavior

This commit is contained in:
Nikita Lisitsa 2023-01-05 16:10:50 +03:00
parent 1b8339ed5d
commit ea726c7a93

View file

@ -318,11 +318,12 @@ namespace psemek::ui
}
};
path_edit->on_text_entered([=](std::u32string_view const & text_u32){
path_edit->on_text_changed([=](std::u32string_view const & text_u32){
std::string text = util::to_utf8(std::u32string(text_u32));
*selected_path = *current_path / text;
confirm_button->set_hidden(text.empty());
}, false);
});
cancel_button->on_click([=]{
window->close();