diff options
author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-09-12 17:49:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 20:20:18 +0200 |
commit | 5d567eb4ac2eda53244be5c8dab189ec01a7f516 (patch) | |
tree | aa7acdfca40fa0cbe18f8d572d4a4e4dc4c0c6e3 | |
parent | 71185f91a826c0966fbcb6bed5ca9392163089e4 (diff) | |
download | serenity-5d567eb4ac2eda53244be5c8dab189ec01a7f516.zip |
LibGUI: Make the Open button always active in the OpenFolder mode
We can just use the current opened directory as a path in that mode. :^)
-rw-r--r-- | Userland/Libraries/LibGUI/FilePicker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index a98993333b..4a8ce3ae88 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -179,7 +179,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filen ok_button.on_click = [this](auto) { on_file_return(); }; - ok_button.set_enabled(!m_filename_textbox->text().is_empty()); + ok_button.set_enabled(m_mode == Mode::OpenFolder || !m_filename_textbox->text().is_empty()); auto& cancel_button = *widget.find_descendant_of_type_named<GUI::Button>("cancel_button"); cancel_button.set_text("Cancel"); @@ -188,7 +188,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filen }; m_filename_textbox->on_change = [&] { - ok_button.set_enabled(!m_filename_textbox->text().is_empty()); + ok_button.set_enabled(m_mode == Mode::OpenFolder || !m_filename_textbox->text().is_empty()); }; m_view->on_selection_change = [this] { |