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)
|
void NavigationWidget::PathWidget::setPath(const string& path)
|
||||||
{
|
{
|
||||||
|
if(path == myLastPath)
|
||||||
|
return;
|
||||||
|
|
||||||
|
myLastPath = path;
|
||||||
|
|
||||||
const int fontWidth = _font.getMaxCharWidth();
|
const int fontWidth = _font.getMaxCharWidth();
|
||||||
int x = _x + fontWidth, w = _w;
|
int x = _x + fontWidth, w = _w;
|
||||||
FSNode node(path);
|
FSNode node(path);
|
||||||
|
|
|
@ -71,14 +71,7 @@ class NavigationWidget : public Widget
|
||||||
const string& getPath(int idx) const;
|
const string& getPath(int idx) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct PathType
|
string myLastPath;
|
||||||
{
|
|
||||||
string path;
|
|
||||||
StaticTextWidget* widget{nullptr};
|
|
||||||
|
|
||||||
explicit PathType(const string& _path, StaticTextWidget* _widget)
|
|
||||||
: path{_path}, widget{_widget} {}
|
|
||||||
};
|
|
||||||
std::vector<FolderLinkWidget*> myFolderList;
|
std::vector<FolderLinkWidget*> myFolderList;
|
||||||
CommandReceiver* myTarget{nullptr};
|
CommandReceiver* myTarget{nullptr};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue