Beispiel #1
0
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
    }
}
Beispiel #2
0
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());
	
}
Beispiel #3
0
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;
}