LibGUI: Switch cancel/confirm button order on file picker dialog

Most (all?) other dialogs in the system have the cancel button on the
right, so make the file picker consistent with the rest.
This commit is contained in:
Nico Weber 2021-01-26 10:08:15 -05:00 committed by Andreas Kling
parent 09b881797f
commit 97234a5b9d

View file

@ -210,13 +210,6 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, Options options, const
button_container.layout()->set_spacing(4);
button_container.layout()->add_spacer();
auto& cancel_button = button_container.add<Button>();
cancel_button.set_fixed_width(80);
cancel_button.set_text("Cancel");
cancel_button.on_click = [this](auto) {
done(ExecCancel);
};
auto& ok_button = button_container.add<Button>();
ok_button.set_fixed_width(80);
ok_button.set_text(ok_button_name(m_mode));
@ -224,6 +217,13 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, Options options, const
on_file_return();
};
auto& cancel_button = button_container.add<Button>();
cancel_button.set_fixed_width(80);
cancel_button.set_text("Cancel");
cancel_button.on_click = [this](auto) {
done(ExecCancel);
};
m_view->on_activation = [this](auto& index) {
auto& filter_model = (SortingProxyModel&)*m_view->model();
auto local_index = filter_model.map_to_source(index);