[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/amarok/src/widgets
From: Nikolaj Hald Nielsen <nhnFreespirit () gmail ! com>
Date: 2009-06-30 7:35:47
Message-ID: 1246347347.403199.9431.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 989377 by nhnielsen:
Style fixes only this time....
M +17 -17 PixmapViewer.cpp
M +3 -3 PixmapViewer.h
--- trunk/extragear/multimedia/amarok/src/widgets/PixmapViewer.cpp #989376:989377
@@ -39,24 +39,25 @@
if ( KApplication::desktop()->width() < m_pixmap->width() )
{
- m_zoomFactor = (( float ) KApplication::desktop()->width() /
+ m_zoomFactor = ( ( float ) KApplication::desktop()->width() /
( float ) m_pixmap->width() ) - 0.5;
}
- setMinimumSize( m_pixmap->width()*m_zoomFactor, m_pixmap->height()*m_zoomFactor );
+ setMinimumSize( m_pixmap->width() * m_zoomFactor, m_pixmap->height() * m_zoomFactor );
// move window to the center of the screen
// (multiple screens: same screen as parent widget)
QWidget *p = dynamic_cast<QWidget*>( parent() );
- p->move(( KApplication::desktop()->availableGeometry( p ).width()
- - ( m_pixmap->width()*m_zoomFactor ) ) / 2,
+ p->move( ( KApplication::desktop()->availableGeometry( p ).width()
+ - ( m_pixmap->width() * m_zoomFactor ) ) / 2,
( KApplication::desktop()->availableGeometry( p ).height()
- - ( m_pixmap->height()*m_zoomFactor ) ) / 2 );
+ - ( m_pixmap->height() * m_zoomFactor ) ) / 2 );
}
-void PixmapViewer::setZoomFactor( float f )
+void
+PixmapViewer::setZoomFactor( float f )
{
int w, h;
@@ -77,21 +78,20 @@
repaint();
}
-void PixmapViewer::paintEvent( QPaintEvent *event )
+void
+PixmapViewer::paintEvent( QPaintEvent *event )
{
int xoffset, yoffset;
bool drawBorder = false;
- if ( width() > m_pixmap->width()*m_zoomFactor )
+ if ( width() > m_pixmap->width() * m_zoomFactor )
{
xoffset = ( width() - m_pixmap->width() * m_zoomFactor ) / 2;
drawBorder = true;
}
else
{
-
xoffset = 0;
-
}
if ( height() > m_pixmap->height()*m_zoomFactor )
@@ -101,15 +101,14 @@
}
else
{
-
yoffset = 0;
}
QWidget *parentWidget = dynamic_cast<QWidget*>( parent() );
- parentWidget->move(( KApplication::desktop()->availableGeometry( parentWidget ).width()
- - ( m_pixmap->width()*m_zoomFactor ) ) / 2,
+ parentWidget->move( ( KApplication::desktop()->availableGeometry( parentWidget ).width()
+ - ( m_pixmap->width() * m_zoomFactor ) ) / 2,
( KApplication::desktop()->availableGeometry( parentWidget ).height()
- - ( m_pixmap->height()*m_zoomFactor ) ) / 2 );
+ - ( m_pixmap->height() * m_zoomFactor ) ) / 2 );
QPainter p( this );
p.save();
@@ -120,12 +119,13 @@
if ( drawBorder )
{
p.setPen( Qt::black );
- p.drawRect( xoffset - 1, yoffset - 1, m_pixmap->width()*m_zoomFactor + 1,
- m_pixmap->height()*m_zoomFactor + 1 );
+ p.drawRect( xoffset - 1, yoffset - 1, m_pixmap->width() * m_zoomFactor + 1,
+ m_pixmap->height() * m_zoomFactor + 1 );
}
}
-void PixmapViewer::wheelEvent( QWheelEvent *event )
+void
+PixmapViewer::wheelEvent( QWheelEvent *event )
{
float f;
--- trunk/extragear/multimedia/amarok/src/widgets/PixmapViewer.h #989376:989377
@@ -35,14 +35,14 @@
PixmapViewer( QWidget *widget, const QPixmap pixmap );
public slots:
- void setZoomFactor( float );
+ void setZoomFactor( float f );
signals:
void zoomFactorChanged( float );
protected:
- void paintEvent( QPaintEvent* );
- void wheelEvent( QWheelEvent* );
+ void paintEvent( QPaintEvent *event );
+ void wheelEvent( QWheelEvent *event );
private:
QPixmap *m_pixmap;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic