mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
SpaceAnalyzer: Display the current location in the window title :^)
This commit is contained in:
parent
d8ceaf7870
commit
64cfe2b163
Notes:
sideshowbarker
2024-07-17 07:08:37 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/64cfe2b163 Pull-request: https://github.com/SerenityOS/serenity/pull/16397 Reviewed-by: https://github.com/linusg
@ -412,6 +412,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
breadcrumbbar.clear_segments();
|
||||
for (size_t k = 0; k < treemapwidget.path_size(); k++) {
|
||||
if (k == 0) {
|
||||
if (treemapwidget.viewpoint() == 0)
|
||||
window->set_title("/ - SpaceAnalyzer");
|
||||
|
||||
breadcrumbbar.append_segment("/", GUI::FileIconProvider::icon_for_path("/").bitmap_for_size(16), "/", "/");
|
||||
continue;
|
||||
}
|
||||
@ -421,6 +424,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
builder.append('/');
|
||||
builder.append(node->name());
|
||||
|
||||
// Sneakily set the window title here, while the StringBuilder holds the right amount of the path.
|
||||
if (k == treemapwidget.viewpoint())
|
||||
window->set_title(DeprecatedString::formatted("{} - SpaceAnalyzer", builder.string_view()));
|
||||
|
||||
breadcrumbbar.append_segment(node->name(), GUI::FileIconProvider::icon_for_path(builder.string_view()).bitmap_for_size(16), builder.string_view(), builder.string_view());
|
||||
}
|
||||
breadcrumbbar.set_selected_segment(treemapwidget.viewpoint());
|
||||
|
Loading…
Reference in New Issue
Block a user