Commit 69286b19 authored by Stéphane Albert's avatar Stéphane Albert

ENH: Fixed quicklook zoom level to extent.

parent dde23528
......@@ -1564,7 +1564,7 @@ MainWindow
images << vectorImageModel;
m_ImageView->SetImageList( images );
m_ImageView->SetImageList( images, ImageViewWidget::ZOOM_TYPE_FULL );
//
// Quicklooks.
......@@ -1578,7 +1578,7 @@ MainWindow
ImageViewWidget* quicklookView = GetQuicklookView();
assert( quicklookView!=NULL );
quicklookView->SetImageList( quicklooks );
quicklookView->SetImageList( quicklooks, ImageViewWidget::ZOOM_TYPE_EXTENT );
}
#endif // USE_ICE_IMAGE_VIEW
......
......@@ -166,6 +166,12 @@ signals:
/**
*/
void RefreshView();
/**
*/
void ZoomToExtent();
/**
*/
void ZoomToFullResolution();
/*-[ PROTECTED SECTION ]---------------------------------------------------*/
......
......@@ -392,6 +392,11 @@ ImageViewManipulator
qDebug() << size[ 0 ] << "," << size[ 1 ] << "\t" << event->size();
*/
#if USE_VIEW_SETTINGS_SIDE_EFFECT
#else // USE_VIEW_SETTINGS_SIDE_EFFECT
SetViewportSize( event->size().widget(), event->size().height() );
#endif // USE_VIEW_SETTINGS_SIDE_EFFECT
}
/******************************************************************************/
......
......@@ -117,7 +117,8 @@ ImageViewWidget
/*******************************************************************************/
void
ImageViewWidget
::SetImageList( const AbstractImageViewRenderer::VectorImageModelList& images )
::SetImageList( const VectorImageModelList& images,
ZoomType zoom )
{
//
// Setup image-view settings to reference image-model data.
......@@ -148,7 +149,11 @@ ImageViewWidget
//
// Center view on center of reference image-model.
Center();
Center( zoom );
//
// Update view.
// updateGL();
}
/*******************************************************************************/
......@@ -181,6 +186,18 @@ ImageViewWidget
// to:
this, SLOT( updateGL() )
);
QObject::connect(
m_Manipulator, SIGNAL( ZoomToExtent() ),
// to:
this, SLOT( ZoomToExtent() )
);
QObject::connect(
m_Manipulator, SIGNAL( ZoomToFullResolution() ),
// to:
this, SLOT( ZoomToFullResolution() )
);
}
/*******************************************************************************/
......
......@@ -84,6 +84,17 @@ public:
typedef
AbstractImageViewRenderer::VectorImageModelList
VectorImageModelList;
/**
*/
enum ZoomType
{
ZOOM_TYPE_NONE = -1,
//
ZOOM_TYPE_FULL,
ZOOM_TYPE_EXTENT,
//
ZOOM_TYPE_COUNT
};
//
// Public methods.
......@@ -116,7 +127,8 @@ public:
/**
*/
void SetImageList( const VectorImageModelList& );
void SetImageList( const VectorImageModelList& images,
ZoomType zoom =ZOOM_TYPE_NONE );
/*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/
......@@ -176,17 +188,6 @@ protected:
//
// Private types.
private:
/**
*/
enum ZoomType
{
ZOOM_TYPE_NONE = -1,
//
ZOOM_TYPE_FULL,
ZOOM_TYPE_EXTENT,
//
ZOOM_TYPE_COUNT
};
//
// Private methods.
......
......@@ -90,42 +90,11 @@ QuicklookViewManipulator
/******************************************************************************/
void
QuicklookViewManipulator
::virtual_MousePressEvent(QMouseEvent * event)
::ResizeEvent( QResizeEvent* event )
{
}
/******************************************************************************/
void
QuicklookViewManipulator
::virtual_MouseMoveEvent( QMouseEvent * event)
{
}
ImageViewManipulator::ResizeEvent( event );
/******************************************************************************/
void
QuicklookViewManipulator
::virtual_MouseReleaseEvent( QMouseEvent * event)
{
}
/******************************************************************************/
void QuicklookViewManipulator
::virtual_ResizeEvent( QResizeEvent * event )
{
}
/******************************************************************************/
void
QuicklookViewManipulator
::virtual_WheelEvent( QWheelEvent * event)
{
}
/******************************************************************************/
void
QuicklookViewManipulator
::virtual_KeyPressEvent( QKeyEvent* event )
{
emit ZoomToExtent();
}
/*****************************************************************************/
......
......@@ -96,6 +96,10 @@ public:
/** \brief Destructor. */
virtual ~QuicklookViewManipulator();
/**
*/
virtual void ResizeEvent( QResizeEvent * event );
/*-[ PUBLIC SLOTS SECTION ]-----------------------------------------------**/
//
......@@ -114,25 +118,6 @@ signals:
// Protected methods.
protected:
/**
*/
virtual void virtual_MouseMoveEvent( QMouseEvent * event );
/**
*/
virtual void virtual_MousePressEvent( QMouseEvent * event );
/**
*/
virtual void virtual_MouseReleaseEvent( QMouseEvent * event );
/**
*/
virtual void virtual_WheelEvent( QWheelEvent* event);
/**
*/
virtual void virtual_ResizeEvent( QResizeEvent * event );
/**
*/
virtual void virtual_KeyPressEvent( QKeyEvent * event );
//
// Protected attributes.
protected:
......
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