void ExtensionManager::reduceArea(TQRect &area, const ExtensionContainer *extension) const { if (!extension || extension->hideMode() == ExtensionContainer::AutomaticHide || !extension->reserveStrut()) { return; } TQRect geom = extension->initialGeometry(extension->position(), extension->alignment(), extension->xineramaScreen()); // reduce given area (TQRect) to the space not covered by the given extension // As simplification: the length of the extension is not taken into account // which means that even a small extension e.g. on the left side of the desktop // will remove the available area with its with switch (extension->position()) { case KPanelExtension::Left: { area.setLeft(TQMAX(area.left(), geom.right())); break; } case KPanelExtension::Right: { area.setRight(TQMIN(area.right(), geom.left())); break; } case KPanelExtension::Top: { area.setTop(TQMAX(area.top(), geom.bottom())); break; } case KPanelExtension::Bottom: { area.setBottom(TQMIN(area.bottom(), geom.top())); break; } default: ; // ignore KPanelExtension::Floating ... at least for now } }
void EvaLVToolTip::maybeTip(const TQPoint &p) { EvaListViewItem *item = dynamic_cast<EvaListViewItem *>(m_lv->itemAt(p)); if(!item) return; int section = m_lv->header()->sectionAt(p.x()); TQRect itemRect = m_lv->itemRect(item); TQRect headerRect = m_lv->header()->sectionRect(section); TQRect destRect(headerRect.left(), itemRect.top(), headerRect.width(), itemRect.height()); tip(destRect, item->tip()); }
bool NextClient::drawbound(const TQRect& geom, bool /* clear */) { TQPainter p(workspaceWidget()); p.setPen(TQPen(TQt::white, 3)); p.setRasterOp(TQt::XorROP); p.drawRect(geom); int leftMargin = geom.left() + 2; p.fillRect(leftMargin, geom.top() + titleHeight - 1, geom.width() - 4, 3, TQt::white); if (mustDrawHandle()) { p.fillRect(leftMargin, geom.bottom() - handleSize - 1, geom.width() - 4, 3, TQt::white); } return true; }
void NextClient::paintEvent( TQPaintEvent* ) { TQPainter p(widget()); // Draw black frame TQRect fr = widget()->rect(); p.setPen(TQt::black); p.drawRect(fr); // Draw title bar TQRect t = titlebar->tqgeometry(); t.setTop(1); p.drawTiledPixmap(t.x()+1, t.y()+1, t.width()-2, t.height()-2, isActive() ? *aTitlePix : *iTitlePix); qDrawShadePanel(&p, t.x(), t.y(), t.width(), t.height()-1, options()->tqcolorGroup(KDecoration::ColorTitleBar, isActive())); p.drawLine(t.x(), t.bottom(), t.right(), t.bottom()); #if 0 // Why setting up a clipping region if it is not used? (setClipping(false)) TQRegion r = fr; r = r.subtract( t ); p.setClipRegion( r ); p.setClipping(false); #endif t.setTop( 1 ); t.setHeight(t.height()-2); t.setLeft( t.left() + 4 ); t.setRight( t.right() - 2 ); p.setPen(options()->color(KDecoration::ColorFont, isActive())); p.setFont(options()->font(isActive())); p.drawText( t, AlignCenter | AlignVCenter, caption() ); // Draw resize handle if (mustDrawHandle()) { int corner = 16 + 3*handleSize/2; qDrawShadePanel(&p, fr.x() + 1, fr.bottom() - handleSize, corner-1, handleSize, options()->tqcolorGroup(KDecoration::ColorHandle, isActive()), false); p.drawTiledPixmap(fr.x() + 2, fr.bottom() - handleSize + 1, corner - 3, handleSize - 2, isActive() ? *aHandlePix : *iHandlePix); qDrawShadePanel(&p, fr.x() + corner, fr.bottom() - handleSize, fr.width() - 2*corner, handleSize, options()->tqcolorGroup(KDecoration::ColorFrame, isActive()), false); p.drawTiledPixmap(fr.x() + corner + 1, fr.bottom() - handleSize + 1, fr.width() - 2*corner - 2, handleSize - 2, isActive() ? *aFramePix : *iFramePix); qDrawShadePanel(&p, fr.right() - corner + 1, fr.bottom() - handleSize, corner - 1, handleSize, options()->tqcolorGroup(KDecoration::ColorHandle, isActive()), false); p.drawTiledPixmap(fr.right() - corner + 2, fr.bottom() - handleSize + 1, corner - 3, handleSize - 2, isActive() ? *aHandlePix : *iHandlePix); } }