mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
FileSelector: move navigatin_locked as a member variable
This commit is contained in:
parent
a2a4eaae91
commit
7e593e92e1
@ -91,10 +91,6 @@ private:
|
|||||||
// Variables used only to maintain the history of navigation.
|
// Variables used only to maintain the history of navigation.
|
||||||
static FileItemList* navigation_history = NULL; // Set of FileItems navigated
|
static FileItemList* navigation_history = NULL; // Set of FileItems navigated
|
||||||
static NullableIterator<FileItemList> navigation_position; // Current position in the navigation history
|
static NullableIterator<FileItemList> navigation_position; // Current position in the navigation history
|
||||||
static bool navigation_locked = false; // If true the navigation_history isn't
|
|
||||||
// modified if the current folder changes
|
|
||||||
// (used when the back/forward buttons
|
|
||||||
// are pushed)
|
|
||||||
|
|
||||||
// Slot for App::Exit signal
|
// Slot for App::Exit signal
|
||||||
static void on_exit_delete_navigation_history()
|
static void on_exit_delete_navigation_history()
|
||||||
@ -585,9 +581,9 @@ void FileSelector::onGoBack()
|
|||||||
if (navigation_position.getIterator() != navigation_history->begin()) {
|
if (navigation_position.getIterator() != navigation_history->begin()) {
|
||||||
navigation_position.setIterator(navigation_position.getIterator()-1);
|
navigation_position.setIterator(navigation_position.getIterator()-1);
|
||||||
|
|
||||||
navigation_locked = true;
|
m_navigationLocked = true;
|
||||||
m_fileList->setCurrentFolder(*navigation_position.getIterator());
|
m_fileList->setCurrentFolder(*navigation_position.getIterator());
|
||||||
navigation_locked = false;
|
m_navigationLocked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -601,9 +597,9 @@ void FileSelector::onGoForward()
|
|||||||
if (navigation_position.getIterator() != navigation_history->end()-1) {
|
if (navigation_position.getIterator() != navigation_history->end()-1) {
|
||||||
navigation_position.setIterator(navigation_position.getIterator()+1);
|
navigation_position.setIterator(navigation_position.getIterator()+1);
|
||||||
|
|
||||||
navigation_locked = true;
|
m_navigationLocked = true;
|
||||||
m_fileList->setCurrentFolder(*navigation_position.getIterator());
|
m_fileList->setCurrentFolder(*navigation_position.getIterator());
|
||||||
navigation_locked = false;
|
m_navigationLocked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -676,7 +672,7 @@ void FileSelector::onFileListFileAccepted()
|
|||||||
|
|
||||||
void FileSelector::onFileListCurrentFolderChanged()
|
void FileSelector::onFileListCurrentFolderChanged()
|
||||||
{
|
{
|
||||||
if (!navigation_locked)
|
if (!m_navigationLocked)
|
||||||
addInNavigationHistory(m_fileList->getCurrentFolder());
|
addInNavigationHistory(m_fileList->getCurrentFolder());
|
||||||
|
|
||||||
updateLocation();
|
updateLocation();
|
||||||
|
@ -64,6 +64,12 @@ namespace app {
|
|||||||
ui::ComboBox* m_fileType;
|
ui::ComboBox* m_fileType;
|
||||||
CustomFileNameEntry* m_fileName;
|
CustomFileNameEntry* m_fileName;
|
||||||
FileList* m_fileList;
|
FileList* m_fileList;
|
||||||
|
|
||||||
|
// If true the navigation_history isn't
|
||||||
|
// modified if the current folder changes
|
||||||
|
// (used when the back/forward buttons
|
||||||
|
// are pushed)
|
||||||
|
bool m_navigationLocked;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
Loading…
Reference in New Issue
Block a user