FileManager: Show the root (/) directory in the treeview on the left
This gives you something to click on if you actually want to open the root directory. Previously, if you wanted to get to /, you had to use the "to parent directory" repeatedly. Silly. :^)
This commit is contained in:
parent
4d2782db5a
commit
17ae1c37bb
Notes:
sideshowbarker
2024-07-19 02:22:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/17ae1c37bbd
1 changed files with 4 additions and 1 deletions
|
@ -231,7 +231,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
|
||||
auto& splitter = widget.add<GUI::HorizontalSplitter>();
|
||||
auto& tree_view = splitter.add<GUI::TreeView>();
|
||||
auto directories_model = GUI::FileSystemModel::create("/", GUI::FileSystemModel::Mode::DirectoriesOnly);
|
||||
auto directories_model = GUI::FileSystemModel::create({}, GUI::FileSystemModel::Mode::DirectoriesOnly);
|
||||
tree_view.set_model(directories_model);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Icon, true);
|
||||
tree_view.set_column_hidden(GUI::FileSystemModel::Column::Size, true);
|
||||
|
@ -245,6 +245,9 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
tree_view.set_preferred_size(150, 0);
|
||||
auto& directory_view = splitter.add<DirectoryView>(DirectoryView::Mode::Normal);
|
||||
|
||||
// Open the root directory. FIXME: This is awkward.
|
||||
tree_view.toggle_index(directories_model->index(0, 0, {}));
|
||||
|
||||
auto& statusbar = widget.add<GUI::StatusBar>();
|
||||
|
||||
auto& progressbar = statusbar.add<GUI::ProgressBar>();
|
||||
|
|
Loading…
Add table
Reference in a new issue