Remove some QRect madness.
This commit is contained in:
parent
b9f8aeadec
commit
7f8901a9e0
1 changed files with 11 additions and 23 deletions
12
Playlist.cpp
12
Playlist.cpp
|
@ -462,7 +462,6 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
{
|
||||
QPainter paint;
|
||||
QRect r;
|
||||
QRect er = event->rect ();
|
||||
|
||||
paint.begin (this);
|
||||
|
||||
|
@ -470,18 +469,15 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
r.setRect (0, 0,
|
||||
m_corner1.width(),
|
||||
m_corner1.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_corner1, m_corner1.rect ());
|
||||
|
||||
/* drawing the upper right corner */
|
||||
r.setRect (width()-m_corner2.width(), 0, m_corner2.width(), m_corner2.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_corner2, m_corner2.rect());
|
||||
|
||||
/* Drawing the lower left corner */
|
||||
r.setRect (0, size().height()-m_corner3.height(),
|
||||
m_corner3.width(), m_corner3.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_corner3, m_corner3.rect());
|
||||
|
||||
/* drawing the lower right corner */
|
||||
|
@ -489,7 +485,6 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
size().height()-m_corner4.height(),
|
||||
m_corner4.width(),
|
||||
m_corner4.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_corner4, m_corner4.rect());
|
||||
|
||||
/* calculate middle of the bar */
|
||||
|
@ -497,12 +492,10 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
|
||||
/* Add the titlebar */
|
||||
r.setRect (midx, 0, m_titlebar.width(), m_titlebar.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_titlebar, m_titlebar.rect());
|
||||
|
||||
/* left fill */
|
||||
r.setRect (m_corner1.width(), 0, midx - m_corner1.width(), m_tfill.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_tfill, m_tfill.rect());
|
||||
|
||||
/* Calculate middle pixel to the right side of the titlebar */
|
||||
|
@ -510,7 +503,6 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
|
||||
/* right fill */
|
||||
r.setRect (midx2, 0, width()-midx2-m_corner2.width(), m_tfill.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_tfill, m_tfill.rect());
|
||||
|
||||
/* calculate the size of the bottom side */
|
||||
|
@ -525,7 +517,6 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
/* Draw the bottom filling */
|
||||
r.setRect (m_corner3.width(), size().height()-m_bfill.height(),
|
||||
pad_to, m_bfill.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_bfill, m_bfill.rect());
|
||||
}
|
||||
|
||||
|
@ -534,12 +525,10 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
*/
|
||||
r.setRect (0, m_corner1.height(), m_lfill.width(),
|
||||
size().height()-m_corner3.height()-m_corner1.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r,m_lfill, m_lfill.rect());
|
||||
|
||||
r.setRect (size().width()-m_rfill3.width(), m_corner2.height(), m_rfill3.width(),
|
||||
size().height()-m_corner2.height()-m_corner3.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_rfill3, m_rfill3.rect());
|
||||
|
||||
/* figure out where to place the last padding */
|
||||
|
@ -550,7 +539,6 @@ PlaylistWidget::paintEvent (QPaintEvent *event)
|
|||
|
||||
r.setRect (x, m_corner2.height(), m_rfill.width(),
|
||||
size().height()-m_corner2.height()-m_corner3.height());
|
||||
if (er.contains (r))
|
||||
paint.drawPixmap (r, m_rfill, m_rfill.rect());
|
||||
|
||||
paint.end ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue