Merge branch 'master' into jfmcarreira-dev

This commit is contained in:
jfmcarreira committed 2014-04-03 17:00:06 +01:00
commit 1a645df8db
2 files changed
+29 -3

No files matched your search

+2 -1
View File
@@ -4,7 +4,8 @@ plaYUVer
plaYUVer is an open-source video player with the following features:
- support for libavformat and libavcodec;
- support for wide range of raw video formats;
- zoom and pixel information
- advanced frame zoom with easy to use pan function
- usefull information in status bar, *e.g.*, pixel information
- API for frame processing algorithms
+27 -2
View File
@@ -138,6 +138,11 @@ void ViewArea::setZoomFactor( double f )
updateSize();
update();
if( !(m_xOffset && m_yOffset) )
setCursor( Qt::OpenHandCursor );
else
unsetCursor();
}
void ViewArea::setMode( ViewMode mode )
@@ -243,7 +248,17 @@ void ViewArea::updateSize()
int h = m_pixmap.height() * m_zoomFactor;
setMinimumSize( w, h );
updateOffset();
QWidget *p = parentWidget();
if( p )
{
// If the parent size is bigger than the minimum area to view the
// image, resize() will call resizeEvent(); otherwise, we need to
// perform the necessary updates (updateOffset).
resize( p->width(), p->height() );
}
if( w <= width() && h <= height() )
updateOffset();
}
void ViewArea::updateOffset()
@@ -531,6 +546,9 @@ void ViewArea::mousePressEvent( QMouseEvent *event )
{
if( tool() == NavigationTool )
{
if( !(m_xOffset && m_yOffset) )
setCursor( Qt::ClosedHandCursor );
m_lastWindowPos = event->pos();
}
// Is the mouse over the image? If yes, save the mouse position;
@@ -721,6 +739,14 @@ void ViewArea::mouseReleaseEvent( QMouseEvent *event )
if( event->button() == Qt::LeftButton && m_lastPos != QPoint( -1, -1 ) )
{
if( tool() == NavigationTool )
{
if( !(m_xOffset && m_yOffset) )
setCursor( Qt::OpenHandCursor );
else
unsetCursor();
}
// Normal Mode ------------------------------------------------------
if( mode() == NormalMode )
{
@@ -748,7 +774,6 @@ void ViewArea::mouseReleaseEvent( QMouseEvent *event )
}
m_newShape = false;
update();
unsetCursor();
m_lastPos = QPoint( -1, -1 );
}
}