Ejemplo n.º 1
0
void DesktopWidget::paint(Rect& r)
{
	//printf("DesktopWidget::paint x:%d y:%d w:%d h:%d\n",
	//	r.x(), r.y(), r.width(), r.height());
    paintBg(r);
    paintChild(r);
}
Ejemplo n.º 2
0
void PopupMenu::paintEvent(QPaintEvent *e) {
	Painter p(this);

#ifdef OS_MAC_OLD
	p.setCompositionMode(QPainter::CompositionMode_Source);
	p.fillRect(e->rect(), Qt::transparent);
	p.setCompositionMode(QPainter::CompositionMode_SourceOver);
#endif // OS_MAC_OLD

	auto ms = getms();
	if (_a_show.animating(ms)) {
		if (auto opacity = _a_opacity.current(ms, _hiding ? 0. : 1.)) {
			_showAnimation->paintFrame(p, 0, 0, width(), _a_show.current(1.), opacity);
		}
	} else if (_a_opacity.animating(ms)) {
		p.setOpacity(_a_opacity.current(0.));
		p.drawPixmap(0, 0, _cache);
	} else if (_hiding || isHidden()) {
		hideFinished();
	} else if (_showAnimation) {
		_showAnimation->paintFrame(p, 0, 0, width(), 1., 1.);
		_showAnimation.reset();
		showChildren();
	} else {
		paintBg(p);
	}
}
Ejemplo n.º 3
0
void DesktopWidget::paintBg()
{
	Rect r(0, 0, width(), height());
	paintBg(r);
}