mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8654 from OPM/filter_wheelevents
Summary Multiplot: page scroll and zoom fixes
This commit is contained in:
@@ -99,6 +99,7 @@ RiuMultiPlotBook::RiuMultiPlotBook( RimMultiPlot* plotDefinition, QWidget* paren
|
||||
, m_titleVisible( true )
|
||||
, m_subTitlesVisible( true )
|
||||
, m_previewMode( true )
|
||||
, m_currentPageIndex( 0 )
|
||||
{
|
||||
const int spacing = 8;
|
||||
|
||||
@@ -585,3 +586,30 @@ void RiuMultiPlotBook::applyLook()
|
||||
m_book->setPalette( newPalette );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::changeCurrentPage( int pageDiff )
|
||||
{
|
||||
m_currentPageIndex += pageDiff;
|
||||
if ( m_currentPageIndex >= (int)m_pages.size() ) m_currentPageIndex = (int)m_pages.size() - 1;
|
||||
if ( m_currentPageIndex < 0 ) m_currentPageIndex = 0;
|
||||
if ( !m_pages.isEmpty() ) m_scrollArea->ensureWidgetVisible( m_pages[m_currentPageIndex] );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::goToNextPage()
|
||||
{
|
||||
changeCurrentPage( 1 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::goToPrevPage()
|
||||
{
|
||||
changeCurrentPage( -1 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user