Beispiel #1
0
void Manager::updateTitleBuffer()
{
   bool active = isActive();

   Static * s = Static::instance();

   TQRect tr = titleSpacer_->tqgeometry();

   if (tr.width() == 0 || tr.height() == 0)
      titleBuf_.resize(8, 8);
   else
      titleBuf_.resize(tr.size());

   TQPainter p(&titleBuf_);

   p.drawPixmap(0, 0, s->titleTextLeft(active));

   p.drawTiledPixmap(3, 0, tr.width() - 6, Static::instance()->titleHeight(),
                     s->titleTextMid(active));

   p.setPen(options()->color(KDecorationOptions::ColorFont, active));

   p.setFont(options()->font(active));

   p.drawText(4, 2, tr.width() - 8, Static::instance()->titleHeight() - 4,
              AlignCenter, caption());

   p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active));
}
Beispiel #2
0
void
KdmRect::drawContents( TQPainter *p, const TQRect &r )
{
	// choose the correct rect class
	RectStruct::RectClass *rClass = &rect.normal;
	if (state == Sactive && rect.active.present) {
		rClass = &rect.active;
	}
	if (state == Sprelight && rect.prelight.present) {
		rClass = &rect.prelight;
	}

	if (rClass->alpha <= 0 || !rClass->color.isValid()) {
		return;
	}

	if (rClass->alpha == 1) {
		p->fillRect( area, TQBrush( rClass->color ) );
	}
	else {
// 		if (!argb_visual_available) {
			// Software blend only (no compositing support)
			TQRect backRect = r;
			backRect.moveBy( area.x(), area.y() );
			TQPixmap backPixmap( backRect.size() );
			bitBlt( &backPixmap, TQPoint( 0, 0 ), p->device(), backRect );
			TQImage backImage = backPixmap.convertToImage();
			KImageEffect::blend( rClass->color, backImage, rClass->alpha );
			p->drawImage( backRect.x(), backRect.y(), backImage );
			//  area.moveBy(1,1);
// 		}
// 		else {
// 			// We have compositing support!
// 		}
	}
}