Ejemplo n.º 1
0
void FilterChart::paint (Graphics& g)
{
  const Rectangle<int> bounds = getLocalBounds ();
	const Rectangle<int> r = bounds;

  g.setColour (m_cBack);
	g.fillRect (r.reduced (1, 1));

  paintContents (g);
  paintName (g);

  g.setColour (m_cFrame);
	g.drawRect (r, 1);
}
Ejemplo n.º 2
0
void TalkablePainter::paint(QPainter *painter)
{
    ItemRect = Option.rect;
    ItemRect.adjust(HFrameMargin, VFrameMargin, -HFrameMargin, -VFrameMargin);

    computeLayout();

    fixColors();

    // some bit of broken logic
    if (drawSelected() || drawDisabled() || !Configuration->useConfigurationColors())
        painter->setPen(textColor());
    else
    {
        Buddy buddy = Index.data(BuddyRole).value<Buddy>();
        Contact contact = Index.data(ContactRole).value<Contact>();
        if (buddy.isBlocked() || contact.isBlocking())
            painter->setPen(QColor(255, 0, 0));
        else
            painter->setPen(Configuration->fontColor());
    }

    paintCheckbox(painter);
    paintIcon(painter);
    paintAvatar(painter);
    paintIdentityName(painter);
    paintName(painter);
    paintDescription(painter);

    /*
    paintDebugRect(painter, ItemRect, QColor(255, 0, 0));
    paintDebugRect(painter, CheckboxRect, QColor(255, 255, 0));
    paintDebugRect(painter, IconRect, QColor(0, 255, 0));
    paintDebugRect(painter, AvatarRect, QColor(0, 0, 255));
    paintDebugRect(painter, IdentityNameRect, QColor(255, 0, 255));
    paintDebugRect(painter, NameRect, QColor(0, 255, 255));
    paintDebugRect(painter, DescriptionRect, QColor(0, 0, 0));
    */
}