mirror of https://github.com/stella-emu/stella.git
updated PathWidget to skip reloading if path has not changed
This commit is contained in:
parent
7dc71fec94
commit
c90908327c
|
@ -154,6 +154,11 @@ NavigationWidget::PathWidget::PathWidget(GuiObject* boss, CommandReceiver* targe
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void NavigationWidget::PathWidget::setPath(const string& path)
|
||||
{
|
||||
if(path == myLastPath)
|
||||
return;
|
||||
|
||||
myLastPath = path;
|
||||
|
||||
const int fontWidth = _font.getMaxCharWidth();
|
||||
int x = _x + fontWidth, w = _w;
|
||||
FSNode node(path);
|
||||
|
|
|
@ -71,14 +71,7 @@ class NavigationWidget : public Widget
|
|||
const string& getPath(int idx) const;
|
||||
|
||||
private:
|
||||
struct PathType
|
||||
{
|
||||
string path;
|
||||
StaticTextWidget* widget{nullptr};
|
||||
|
||||
explicit PathType(const string& _path, StaticTextWidget* _widget)
|
||||
: path{_path}, widget{_widget} {}
|
||||
};
|
||||
string myLastPath;
|
||||
std::vector<FolderLinkWidget*> myFolderList;
|
||||
CommandReceiver* myTarget{nullptr};
|
||||
|
||||
|
|
Loading…
Reference in New Issue