mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:17:45 +00:00
SpaceAnalyzer: Keep the current path via filenames, not indices
The tree map widget keeps the current path to allow the user to navigate between directories. This path was being kept as indices into the children array. The indices might change after the tree is regenerated and this change is required to keep the user's current place after a re-analysis
This commit is contained in:
parent
ba33267132
commit
c045ae1a96
2 changed files with 15 additions and 12 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tree.h"
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
|
||||
|
@ -49,10 +50,10 @@ private:
|
|||
template<typename Function>
|
||||
void lay_out_children(TreeNode const&, Gfx::IntRect const&, int depth, Function);
|
||||
void paint_cell_frame(GUI::Painter&, TreeNode const&, Gfx::IntRect const&, Gfx::IntRect const&, int depth, HasLabel has_label) const;
|
||||
Vector<int> path_to_position(Gfx::IntPoint);
|
||||
Vector<DeprecatedString> path_to_position(Gfx::IntPoint);
|
||||
|
||||
RefPtr<Tree> m_tree;
|
||||
Vector<int> m_path;
|
||||
Vector<DeprecatedString> m_path;
|
||||
size_t m_viewpoint { 0 };
|
||||
void const* m_selected_node_cache;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue