OTHER: removed PixWidget
PixWidget sole purpose was to paint a given pixmap. Some of PixWidgets child classes had to create that pixmap from some other pixmaps. Thus PixWidget introduced some kind of unnecessary double buffering. Furthermore, those pixmaps where created even if a widget wasn't visible. Painting directly to the widget and calling the 'update ()' method on changes might allow Qt to do some performance optimizations. Most likely they will be to small to be noticable though. I also disabled the shortcuts of the titlebarmenu. They were diplayed in the menu but didn't work. As soon as I figure out how to get them working again I will enable them again
This commit is contained in:
parent
6cf0ad2614
commit
096ac37121
11 changed files with 130 additions and 167 deletions
|
@ -16,8 +16,15 @@
|
|||
#include "clutterbar.h"
|
||||
#include "Skin.h"
|
||||
|
||||
ClutterBar::ClutterBar (QWidget *parent) : PixWidget (parent)
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
ClutterBar::ClutterBar (QWidget *parent) : QWidget (parent)
|
||||
{
|
||||
Skin *skin = Skin::getInstance();
|
||||
|
||||
connect (skin, SIGNAL (skinChanged (Skin *)),
|
||||
this, SLOT (setPixmaps(Skin *)));
|
||||
}
|
||||
|
||||
ClutterBar::~ClutterBar ()
|
||||
|
@ -39,8 +46,7 @@ ClutterBar::setPixmaps(Skin *skin)
|
|||
|
||||
m_pixmap = m_clutter_on;
|
||||
|
||||
setMinimumSize (m_clutter_on.size ());
|
||||
setMaximumSize (m_clutter_on.size ());
|
||||
setFixedSize (m_clutter_on.size ());
|
||||
|
||||
update();
|
||||
}
|
||||
|
@ -74,4 +80,13 @@ ClutterBar::mouseReleaseEvent (QMouseEvent *event)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
ClutterBar::paintEvent (QPaintEvent *event)
|
||||
{
|
||||
if (m_pixmap.isNull ()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QPainter p (this);
|
||||
p.drawPixmap (rect (), m_pixmap, m_pixmap.rect ());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue