Commit 89cdac0a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix use wheelmouse and last page

svn path=/trunk/kdegraphics/kpdf/; revision=251104
parent 0ff129b6
...@@ -124,8 +124,8 @@ void Part::slotReadUp() ...@@ -124,8 +124,8 @@ void Part::slotReadUp()
return; return;
if( !m_outputDev->readUp() ) { if( !m_outputDev->readUp() ) {
slotPreviousPage(); if ( previousPage() )
m_outputDev->scrollBottom(); m_outputDev->scrollBottom();
} }
} }
...@@ -135,9 +135,8 @@ void Part::slotReadDown() ...@@ -135,9 +135,8 @@ void Part::slotReadDown()
return; return;
if( !m_outputDev->readDown() ) { if( !m_outputDev->readDown() ) {
//todo fix if we can "next page" as in kghostview if ( nextPage() )
slotNextPage(); m_outputDev->scrollTop();
m_outputDev->scrollTop();
} }
} }
...@@ -192,24 +191,36 @@ void Part::slotGotoStart() ...@@ -192,24 +191,36 @@ void Part::slotGotoStart()
} }
} }
void Part::slotNextPage() bool Part::nextPage()
{ {
m_currentPage = pdfpartview->pagesListBox->currentItem() + 1; m_currentPage = pdfpartview->pagesListBox->currentItem() + 1;
if ( m_doc && m_currentPage >= m_doc->getNumPages()) if ( m_doc && m_currentPage >= m_doc->getNumPages())
return; return false;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage); pdfpartview->pagesListBox->setCurrentItem(m_currentPage);
m_outputDev->nextPage(); m_outputDev->nextPage();
return true;
}
void Part::slotNextPage()
{
nextPage();
} }
void Part::slotPreviousPage() void Part::slotPreviousPage()
{
previousPage();
}
bool Part::previousPage()
{ {
m_currentPage = pdfpartview->pagesListBox->currentItem() - 1; m_currentPage = pdfpartview->pagesListBox->currentItem() - 1;
if ( m_currentPage < 0) if ( m_currentPage < 0)
return; return false;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage ); pdfpartview->pagesListBox->setCurrentItem(m_currentPage );
m_outputDev->previousPage(); m_outputDev->previousPage();
return true;
} }
KAboutData* KAboutData*
......
...@@ -79,6 +79,8 @@ namespace KPDF ...@@ -79,6 +79,8 @@ namespace KPDF
void update(); void update();
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
bool nextPage();
bool previousPage();
protected slots: protected slots:
void find() { /* stub */ }; void find() { /* stub */ };
void findNext() { /* stub */ }; void findNext() { /* stub */ };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment