fix: shouldn't loop when navigate gallery via shortcuts
Related: https://github.com/BLumia/pineapple-pictures/issues/153
This commit is contained in:
@ -255,6 +255,9 @@ void MainWindow::clearGallery()
|
|||||||
|
|
||||||
void MainWindow::galleryPrev()
|
void MainWindow::galleryPrev()
|
||||||
{
|
{
|
||||||
|
const bool loopGallery = Settings::instance()->loopGallery();
|
||||||
|
if (!loopGallery && m_pm->isFirstIndex()) return;
|
||||||
|
|
||||||
QModelIndex index = m_pm->previousIndex();
|
QModelIndex index = m_pm->previousIndex();
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
m_pm->setCurrentIndex(index);
|
m_pm->setCurrentIndex(index);
|
||||||
@ -264,6 +267,9 @@ void MainWindow::galleryPrev()
|
|||||||
|
|
||||||
void MainWindow::galleryNext()
|
void MainWindow::galleryNext()
|
||||||
{
|
{
|
||||||
|
const bool loopGallery = Settings::instance()->loopGallery();
|
||||||
|
if (!loopGallery && m_pm->isLastIndex()) return;
|
||||||
|
|
||||||
QModelIndex index = m_pm->nextIndex();
|
QModelIndex index = m_pm->nextIndex();
|
||||||
if (index.isValid()) {
|
if (index.isValid()) {
|
||||||
m_pm->setCurrentIndex(index);
|
m_pm->setCurrentIndex(index);
|
||||||
|
Reference in New Issue
Block a user