diff --git a/conf/dlgpresentationbase.ui b/conf/dlgpresentationbase.ui --- a/conf/dlgpresentationbase.ui +++ b/conf/dlgpresentationbase.ui @@ -87,6 +87,39 @@ + + + + + + Touch navigation: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Tap left/right side to go back/forward + + + + + Tap anywhere to go forward + + + + + Disabled + + + + + + diff --git a/conf/okular_core.kcfg b/conf/okular_core.kcfg --- a/conf/okular_core.kcfg +++ b/conf/okular_core.kcfg @@ -92,5 +92,13 @@ false + + Forward + + + + + + diff --git a/ui/presentationwidget.h b/ui/presentationwidget.h --- a/ui/presentationwidget.h +++ b/ui/presentationwidget.h @@ -146,6 +146,7 @@ bool m_inBlackScreenMode; bool m_showSummaryView; bool m_advanceSlides; + bool m_goToPreviousPageOnRelease; bool m_goToNextPageOnRelease; private Q_SLOTS: diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -153,6 +153,7 @@ m_ac( collection ), m_screenSelect( nullptr ), m_isSetup( false ), m_blockNotifications( false ), m_inBlackScreenMode( false ), m_showSummaryView( Okular::Settings::slidesShowSummary() ), m_advanceSlides( Okular::SettingsCore::slidesAdvance() ), + m_goToPreviousPageOnRelease( false ), m_goToNextPageOnRelease( false ) { Q_UNUSED( parent ) @@ -707,7 +708,39 @@ return; } - m_goToNextPageOnRelease = true; + // Actual mouse press events always lead to the next page page + if ( e->source() == Qt::MouseEventNotSynthesized ) + { + m_goToNextPageOnRelease = true; + } + // Touch events may lead to the previous or next page + else if ( Okular::Settings::slidesTapNavigation() != Okular::Settings::EnumSlidesTapNavigation::Disabled ) + { + switch ( Okular::Settings::slidesTapNavigation() ) + { + case Okular::Settings::EnumSlidesTapNavigation::ForwardBackward: + { + if ( e->x() < ( geometry().width()/2 ) ) + { + m_goToPreviousPageOnRelease = true; + } + else + { + m_goToNextPageOnRelease = true; + } + break; + } + case Okular::Settings::EnumSlidesTapNavigation::Forward: + { + m_goToNextPageOnRelease = true; + break; + } + case Okular::Settings::EnumSlidesTapNavigation::Disabled: + { + // Do Nothing + } + } + } } // pressing the "move forward" mouse button: unlike the left button this // always means "show next page", so we unconditionally delegate to that @@ -737,6 +770,11 @@ m_pressedLink = nullptr; } + if ( m_goToPreviousPageOnRelease ) { + slotPrevPage(); + m_goToPreviousPageOnRelease = false; + } + if ( m_goToNextPageOnRelease ) { slotNextPage(); m_goToNextPageOnRelease = false;