mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
LibGUI: Update FilePicker location textbox when changing directory
Fixes #2662.
This commit is contained in:
parent
5acc457c06
commit
2e183e3292
Notes:
sideshowbarker
2024-07-19 05:19:11 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2e183e32928 Pull-request: https://github.com/SerenityOS/serenity/pull/2664 Issue: https://github.com/SerenityOS/serenity/issues/2662
1 changed files with 5 additions and 2 deletions
|
@ -122,14 +122,17 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
|||
m_view->set_column_hidden(FileSystemModel::Column::SymlinkTarget, true);
|
||||
m_model->set_root_path(path);
|
||||
|
||||
m_model->on_update = [&] {
|
||||
location_textbox.set_text(m_model->root_path());
|
||||
clear_preview();
|
||||
};
|
||||
|
||||
location_textbox.on_return_pressed = [&] {
|
||||
m_model->set_root_path(location_textbox.text());
|
||||
clear_preview();
|
||||
};
|
||||
|
||||
auto open_parent_directory_action = Action::create("Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"), [this](const Action&) {
|
||||
m_model->set_root_path(String::format("%s/..", m_model->root_path().characters()));
|
||||
clear_preview();
|
||||
});
|
||||
toolbar.add_action(*open_parent_directory_action);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue