Ejemplo n.º 1
0
void
ALMGroup::_Build(BALMLayout* layout, BReference<XTab> left,
                 BReference<YTab> top, BReference<XTab> right, BReference<YTab> bottom) const
{
    if (LayoutItem())
        layout->AddItem(LayoutItem(), left, top, right, bottom);
    else if (View()) {
        layout->AddView(View(), left, top, right, bottom);
    } else {
        for (unsigned int i = 0; i < Groups().size(); i++) {
            const ALMGroup& current = Groups()[i];
            if (Orientation() == B_HORIZONTAL) {
                BReference<XTab> currentRight;
                if (i == Groups().size() - 1)
                    currentRight = right;
                else
                    currentRight = layout->AddXTab();
                current._Build(layout, left, top, currentRight, bottom);
                left = currentRight;
            } else {
                BReference<YTab> currentBottom;
                if (i == Groups().size() - 1)
                    currentBottom = bottom;
                else
                    currentBottom = layout->AddYTab();
                current._Build(layout, left, top, right, currentBottom);
                top = currentBottom;
            }
        }
    }
}
Ejemplo n.º 2
0
void
WebTabView::SetIcon(const BBitmap* icon)
{
	delete fIcon;
	if (icon)
		fIcon = new BBitmap(icon);
	else
		fIcon = NULL;
	LayoutItem()->InvalidateLayout();
}
Ejemplo n.º 3
0
void CaretBase::updateCaretRect(const PositionWithAffinity& caretPosition) {
    m_caretLocalRect = LayoutRect();

    if (caretPosition.isNull())
        return;

    DCHECK(caretPosition.anchorNode()->layoutObject());

    // First compute a rect local to the layoutObject at the selection start.
    LayoutObject* layoutObject;
    m_caretLocalRect = localCaretRectOfPosition(caretPosition, layoutObject);

    // Get the layoutObject that will be responsible for painting the caret
    // (which is either the layoutObject we just found, or one of its containers).
    LayoutBlockItem caretPainterItem =
        LayoutBlockItem(caretLayoutObject(caretPosition.anchorNode()));

    mapCaretRectToCaretPainter(LayoutItem(layoutObject), caretPainterItem,
                               m_caretLocalRect);
}