mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-10 13:17:36 +00:00
LibGUI: Disable changing the view on error in the FilePicker
Prior to this change, changing the view would hide the error label and show an empty directory.
This commit is contained in:
committed by
Gunnar Beutner
parent
80e3cf3ef7
commit
99d46caa28
@@ -219,11 +219,19 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filen
|
||||
m_model->on_directory_change_error = [&](int, char const* error_string) {
|
||||
m_error_label->set_text(String::formatted("Could not open {}:\n{}", m_model->root_path(), error_string));
|
||||
m_view->set_active_widget(m_error_label);
|
||||
|
||||
m_view->view_as_icons_action().set_enabled(false);
|
||||
m_view->view_as_table_action().set_enabled(false);
|
||||
m_view->view_as_columns_action().set_enabled(false);
|
||||
};
|
||||
m_model->on_complete = [&] {
|
||||
m_view->set_active_widget(&m_view->current_view());
|
||||
for (auto location_button : m_common_location_buttons)
|
||||
location_button.button.set_checked(m_model->root_path() == location_button.path);
|
||||
|
||||
m_view->view_as_icons_action().set_enabled(true);
|
||||
m_view->view_as_table_action().set_enabled(true);
|
||||
m_view->view_as_columns_action().set_enabled(true);
|
||||
};
|
||||
|
||||
for (auto& location : CommonLocationsProvider::common_locations()) {
|
||||
|
||||
Reference in New Issue
Block a user