Commit 39fb1ef5 authored by Pino Toscano's avatar Pino Toscano

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

svn path=/trunk/KDE/kdegraphics/okular/; revision=755275
parent 975b5e55
...@@ -710,7 +710,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup ...@@ -710,7 +710,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
{ {
w->setPageItem( item ); w->setPageItem( item );
w->setFormWidgetsController( d->formWidgetsController() ); w->setFormWidgetsController( d->formWidgetsController() );
w->setVisibility( d->m_formsVisible ); w->setVisibility( false );
w->setCanBeFilled( d->document->isAllowed( Okular::AllowFillForms ) ); w->setCanBeFilled( d->document->isAllowed( Okular::AllowFillForms ) );
item->formWidgets().insert( ff->name(), w ); item->formWidgets().insert( ff->name(), w );
hasformwidgets = true; hasformwidgets = true;
...@@ -2671,6 +2671,7 @@ void PageView::slotRelayoutPages() ...@@ -2671,6 +2671,7 @@ void PageView::slotRelayoutPages()
item->moveTo( 0, 0 ); item->moveTo( 0, 0 );
item->setVisible( false ); item->setVisible( false );
} }
item->setFormWidgetsVisible( d->m_formsVisible );
// advance col/row index // advance col/row index
insertX += cWidth; insertX += cWidth;
if ( ++cIdx == nCols ) if ( ++cIdx == nCols )
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
/*********************/ /*********************/
PageViewItem::PageViewItem( const Okular::Page * page ) 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 ) ...@@ -121,6 +122,7 @@ void PageViewItem::moveTo( int x, int y )
void PageViewItem::setVisible( bool visible ) void PageViewItem::setVisible( bool visible )
{ {
setFormWidgetsVisible( visible && m_formsVisible );
m_visible = visible; m_visible = visible;
} }
...@@ -131,6 +133,11 @@ void PageViewItem::invalidate() ...@@ -131,6 +133,11 @@ void PageViewItem::invalidate()
bool PageViewItem::setFormWidgetsVisible( bool visible ) bool PageViewItem::setFormWidgetsVisible( bool visible )
{ {
m_formsVisible = visible;
if ( !m_visible )
return false;
bool somehadfocus = false; bool somehadfocus = false;
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end(); QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it ) for ( ; it != itEnd; ++it )
......
...@@ -60,6 +60,7 @@ class PageViewItem ...@@ -60,6 +60,7 @@ class PageViewItem
double m_zoomFactor; double m_zoomFactor;
QRect m_geometry; QRect m_geometry;
bool m_visible; bool m_visible;
bool m_formsVisible;
QHash<QString, FormWidgetIface*> m_formWidgets; QHash<QString, FormWidgetIface*> m_formWidgets;
}; };
......
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