Hide file dialog confirm button when appropriate
This commit is contained in:
parent
d60eb6f659
commit
594dcc9230
1 changed files with 3 additions and 0 deletions
|
|
@ -159,6 +159,8 @@ namespace psemek::ui
|
|||
auto confirm_button = options.element_factory.make_button(options.type == file_dialog_type::save ? "Save" : "Open");
|
||||
auto cancel_button = options.element_factory.make_button("Cancel");
|
||||
|
||||
confirm_button->set_hidden(true);
|
||||
|
||||
bottom_layout->set(0, 1, status_label);
|
||||
bottom_layout->set(0, 2, confirm_button);
|
||||
bottom_layout->set(0, 3, cancel_button);
|
||||
|
|
@ -301,6 +303,7 @@ namespace psemek::ui
|
|||
path_edit->on_text_entered([=](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([=]{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue