Fix use wheelmouse and last page

svn path=/trunk/kdegraphics/kpdf/; revision=251104
This commit is contained in:
Laurent Montel 2003-09-14 21:53:40 +00:00
parent 0ff129b678
commit 89cdac0a04
2 changed files with 21 additions and 8 deletions

View file

@ -124,8 +124,8 @@ void Part::slotReadUp()
return;
if( !m_outputDev->readUp() ) {
slotPreviousPage();
m_outputDev->scrollBottom();
if ( previousPage() )
m_outputDev->scrollBottom();
}
}
@ -135,9 +135,8 @@ void Part::slotReadDown()
return;
if( !m_outputDev->readDown() ) {
//todo fix if we can "next page" as in kghostview
slotNextPage();
m_outputDev->scrollTop();
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*

View file

@ -79,6 +79,8 @@ namespace KPDF
void update();
void readSettings();
void writeSettings();
bool nextPage();
bool previousPage();
protected slots:
void find() { /* stub */ };
void findNext() { /* stub */ };