draw only when needed
This commit is contained in:
parent
5fdd493d0d
commit
d222c56543
2 changed files with 66 additions and 59 deletions
|
@ -81,9 +81,11 @@ void OBButtonWidget::update()
|
|||
{
|
||||
otk::PixmapMask *pm;
|
||||
int width;
|
||||
bool draw = _dirty;
|
||||
|
||||
otk::OtkWidget::update();
|
||||
|
||||
if (draw) {
|
||||
switch (type()) {
|
||||
case Type_StickyButton:
|
||||
pm = _style->getStickyButtonMask();
|
||||
|
@ -124,6 +126,7 @@ void OBButtonWidget::update()
|
|||
// unset the clip region
|
||||
XSetClipMask(otk::OBDisplay::display, pen.gc(), None);
|
||||
XSetClipOrigin(otk::OBDisplay::display, pen.gc(), 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,8 +72,11 @@ void OBLabelWidget::unfocus()
|
|||
|
||||
void OBLabelWidget::update()
|
||||
{
|
||||
bool draw = _dirty;
|
||||
|
||||
OtkWidget::update();
|
||||
|
||||
if (draw) {
|
||||
std::string t = _text;
|
||||
int x = _sidemargin; // x coord for the text
|
||||
|
||||
|
@ -104,6 +107,7 @@ void OBLabelWidget::update()
|
|||
}
|
||||
|
||||
_font->drawString(_xftdraw, x, 0, *_text_color, t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue