コード例 #1
0
ファイル: FalagardAnimate.cpp プロジェクト: brock7/TianLong
	void	FalagardAnimate::drawSelf(float z)
	{
		if( d_needsRedraw )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;
			// normal 状态是作为永远显示模式出现的
			drawNormal( z );
			if (isDisabled(true) )
			{
				drawDisabled(z);
			}
			else
			{
				//If pushed or checked draw "Pushed" Layer
				if (isPushed() ) 
				{
					drawPushed(z);
				}
				//Draw "Hover" Layer
				if (isHovering() )
				{
					drawHover(z);
				}
			}
		}
		Window::drawSelf(z);
	}
コード例 #2
0
ファイル: talkable-painter.cpp プロジェクト: vogel/kadu
QColor TalkablePainter::textColor() const
{
    const QPalette::ColorGroup colorGroup = drawDisabled() ? QPalette::Disabled : QPalette::Normal;

    const QPalette::ColorRole colorRole = drawSelected() ? QPalette::HighlightedText : QPalette::Text;

    return Option.palette.color(colorGroup, colorRole);
}
コード例 #3
0
ファイル: talkable-painter.cpp プロジェクト: vogel/kadu
QTextDocument *TalkablePainter::getDescriptionDocument(int width)
{
    if (DescriptionDocument)
        return DescriptionDocument;

    fixColors();

    const QColor &color = drawSelected() || drawDisabled() || !Configuration->useConfigurationColors()
                              ? textColor()
                              : Configuration->descriptionColor();
    DescriptionDocument = createDescriptionDocument(Index.data(DescriptionRole).toString(), width, color);
    return DescriptionDocument;
}
コード例 #4
0
ファイル: CEGUITabButton.cpp プロジェクト: brock7/TianLong
/*************************************************************************
Draw method
*************************************************************************/
void TabButton::drawSelf(float z)
{
	if (isDisabled())
	{
		drawDisabled(z);
	}
	else if (isHovering())
	{
		drawHover(z);
	}
    else if (d_selected)
    {
        drawPushed(z);
    }
    else
    {
        drawNormal(z);
    }
}
コード例 #5
0
/*************************************************************************
	Perform the rendering for this widget.	
*************************************************************************/
void ButtonBase::drawSelf(float z)
{
	if (isHovering())
	{
		drawHover(z);
	}
	else if (isPushed())
	{
		drawPushed(z);
	}
	else if (isDisabled())
	{
		drawDisabled(z);
	}
	else
	{
		drawNormal(z);
	}

}
コード例 #6
0
ファイル: talkable-painter.cpp プロジェクト: vogel/kadu
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));
    */
}
コード例 #7
0
void FalagardActionButton::drawSelf( float z )
{
    if (d_needsRedraw  )
    {
        d_renderCache.clearCachedImagery();
        d_needsRedraw = false;
        const StateImagery* imagery;
        // get WidgetLookFeel for the assigned look.
        const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName);
        if( wlf.isStateImageryPresent( "BackgroundImage" ) )
        {
            imagery = &wlf.getStateImagery( "BackgroundImage" );
            // peform the rendering operation.
            imagery->render(*this);
        }
        // 画背景

        d_BackImage.draw(d_renderCache);
        //Empty
        if(isEmpty())
        {
            if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
            {
                drawHover(z);
            }
        }
        else
        {
            //Draw normal image
            drawNormal(z);

            //Draw percentage Img
            if(isPercentagePresent())
            {
                drawPercentageImg(z);
            }

            //Notin Dragging
            if(d_dragging && !isGloom())
            {
                drawPushed(z);
            }
            else
            {
                //Draw disable mask only when disabled
                if (isDisabled(true) || isGloom() )
                {
                    drawDisabled(z);
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }
                    drawAnimate(z);
                }
                else
                {
                    //If pushed or checked draw "Pushed" Layer
                    if (isPushed() || isChecked())
                    {
                        drawPushed(z);
                    }

                    //Draw "Hover" Layer
                    if (isHovering() && !isChecked())
                    {
                        drawHover(z);
                    }

                    drawAnimate(z);
                    // If default
                    if(isDefault())
                    {
                        drawDefault(z);
                    }

                }

                //Draw corner character
                drawCorner(z);
                drawFlash( z );
            }
        }
    }

    Window::drawSelf(z);
}
コード例 #8
0
	void FalagardActionButton::drawSelf( float z )
	{
		if (d_needsRedraw  )
		{
			d_renderCache.clearCachedImagery();
			d_needsRedraw = false;
			
			//Empty
			if(isEmpty())
			{
				if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom())
				{
					drawHover(z);
				}
			}
			else
			{
				//Draw normal image
				drawNormal(z);

				//Notin Dragging
				if(d_dragging && !isGloom())
				{
					drawPushed(z);
				}
				else
				{
					//Draw disable mask only when disabled
					if (isDisabled(true) || isGloom() )
					{
						drawDisabled(z);
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}
					}
					else
					{
						//If pushed or checked draw "Pushed" Layer
						if (isPushed() || isChecked()) 
						{
							drawPushed(z);
						}

						//Draw "Hover" Layer
						if (isHovering() && !isChecked())
						{
							drawHover(z);
						}

						drawAnimate(z);
						// If default
						if(isDefault())
						{
							drawDefault(z);
						}
						
					}

					//Draw corner character
					drawCorner(z);
				}
			}
		}

		Window::drawSelf(z);
	}