From 5836710e8fbc9a40fd744fd18e576f5c290c2589 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Fri, 9 Jul 2021 14:16:25 +0200 Subject: [PATCH] SpaceAnalyzer: Show folder total size --- Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index 0f29992617..1af61c3fc9 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -97,10 +97,12 @@ void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, const TreeMapNode& n painter.add_clip_rect(cell_rect); Gfx::IntRect text_rect = remainder; text_rect.translate_by(2, 2); - painter.draw_text(text_rect, node.name(), font(), Gfx::TextAlignment::TopLeft, Color::Black); if (node_is_leaf(node)) { + painter.draw_text(text_rect, node.name(), font(), Gfx::TextAlignment::TopLeft, Color::Black); text_rect.translate_by(0, font().presentation_size() + 1); painter.draw_text(text_rect, human_readable_size(node.area()), font(), Gfx::TextAlignment::TopLeft, Color::Black); + } else { + painter.draw_text(text_rect, String::formatted("{} - {}", node.name(), human_readable_size(node.area())), font(), Gfx::TextAlignment::TopLeft, Color::Black); } painter.clear_clip_rect(); }