correctly show/hide the form widgets in each page correctly even when not in Continuous mode

svn path=/trunk/KDE/kdegraphics/okular/; revision=755275
This commit is contained in:
Pino Toscano 2007-12-31 22:22:38 +00:00
parent 975b5e550b
commit 39fb1ef5b6
3 changed files with 11 additions and 2 deletions

View File

@ -710,7 +710,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
{
w->setPageItem( item );
w->setFormWidgetsController( d->formWidgetsController() );
w->setVisibility( d->m_formsVisible );
w->setVisibility( false );
w->setCanBeFilled( d->document->isAllowed( Okular::AllowFillForms ) );
item->formWidgets().insert( ff->name(), w );
hasformwidgets = true;
@ -2671,6 +2671,7 @@ void PageView::slotRelayoutPages()
item->moveTo( 0, 0 );
item->setVisible( false );
}
item->setFormWidgetsVisible( d->m_formsVisible );
// advance col/row index
insertX += cWidth;
if ( ++cIdx == nCols )

View File

@ -39,7 +39,8 @@
/*********************/
PageViewItem::PageViewItem( const Okular::Page * page )
: m_page( page ), m_zoomFactor( 1.0 ), m_visible( true )
: m_page( page ), m_zoomFactor( 1.0 ), m_visible( true ),
m_formsVisible( false )
{
}
@ -121,6 +122,7 @@ void PageViewItem::moveTo( int x, int y )
void PageViewItem::setVisible( bool visible )
{
setFormWidgetsVisible( visible && m_formsVisible );
m_visible = visible;
}
@ -131,6 +133,11 @@ void PageViewItem::invalidate()
bool PageViewItem::setFormWidgetsVisible( bool visible )
{
m_formsVisible = visible;
if ( !m_visible )
return false;
bool somehadfocus = false;
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )

View File

@ -60,6 +60,7 @@ class PageViewItem
double m_zoomFactor;
QRect m_geometry;
bool m_visible;
bool m_formsVisible;
QHash<QString, FormWidgetIface*> m_formWidgets;
};