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,7 +124,7 @@ void Part::slotReadUp()
return;
if( !m_outputDev->readUp() ) {
slotPreviousPage();
if ( previousPage() )
m_outputDev->scrollBottom();
}
}
......@@ -135,8 +135,7 @@ void Part::slotReadDown()
return;
if( !m_outputDev->readDown() ) {
//todo fix if we can "next page" as in kghostview
slotNextPage();
if ( nextPage() )
m_outputDev->scrollTop();
}
}
......@@ -192,24 +191,36 @@ void Part::slotGotoStart()
}
}
void Part::slotNextPage()
bool Part::nextPage()
{
m_currentPage = pdfpartview->pagesListBox->currentItem() + 1;
if ( m_doc && m_currentPage >= m_doc->getNumPages())
return;
return false;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage);
m_outputDev->nextPage();
return true;
}
void Part::slotNextPage()
{
nextPage();
}
void Part::slotPreviousPage()
{
previousPage();
}
bool Part::previousPage()
{
m_currentPage = pdfpartview->pagesListBox->currentItem() - 1;
if ( m_currentPage < 0)
return;
return false;
pdfpartview->pagesListBox->setCurrentItem(m_currentPage );
m_outputDev->previousPage();
return true;
}
KAboutData*
......
......@@ -79,6 +79,8 @@ namespace KPDF
void update();
void readSettings();
void writeSettings();
bool nextPage();
bool previousPage();
protected slots:
void find() { /* 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