mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
SpaceAnalyzer: Enable icons within the breadcrumbbar
The breadcrumbbar in here serves exactly the same purpose as the one in File Manager. Given that, I believe it's worth to keep these two visually consistent.
This commit is contained in:
parent
1600d5a446
commit
14c30af7d8
1 changed files with 12 additions and 4 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
#include <LibGUI/Breadcrumbbar.h>
|
#include <LibGUI/Breadcrumbbar.h>
|
||||||
#include <LibGUI/Clipboard.h>
|
#include <LibGUI/Clipboard.h>
|
||||||
|
#include <LibGUI/FileIconProvider.h>
|
||||||
#include <LibGUI/Icon.h>
|
#include <LibGUI/Icon.h>
|
||||||
#include <LibGUI/Menu.h>
|
#include <LibGUI/Menu.h>
|
||||||
#include <LibGUI/Menubar.h>
|
#include <LibGUI/Menubar.h>
|
||||||
|
@ -339,14 +340,21 @@ int main(int argc, char* argv[])
|
||||||
treemapwidget.set_viewpoint(index);
|
treemapwidget.set_viewpoint(index);
|
||||||
};
|
};
|
||||||
treemapwidget.on_path_change = [&]() {
|
treemapwidget.on_path_change = [&]() {
|
||||||
|
StringBuilder builder;
|
||||||
|
|
||||||
breadcrumbbar.clear_segments();
|
breadcrumbbar.clear_segments();
|
||||||
for (size_t k = 0; k < treemapwidget.path_size(); k++) {
|
for (size_t k = 0; k < treemapwidget.path_size(); k++) {
|
||||||
if (k == 0) {
|
if (k == 0) {
|
||||||
breadcrumbbar.append_segment("/");
|
breadcrumbbar.append_segment("/", GUI::FileIconProvider::icon_for_path("/").bitmap_for_size(16), "/", "/");
|
||||||
} else {
|
continue;
|
||||||
const SpaceAnalyzer::TreeMapNode* node = treemapwidget.path_node(k);
|
|
||||||
breadcrumbbar.append_segment(node->name());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SpaceAnalyzer::TreeMapNode* node = treemapwidget.path_node(k);
|
||||||
|
|
||||||
|
builder.append("/");
|
||||||
|
builder.append(node->name());
|
||||||
|
|
||||||
|
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());
|
breadcrumbbar.set_selected_segment(treemapwidget.viewpoint());
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue