|
|
@ -314,7 +314,7 @@ void UIWidget::parseBaseStyle(const OTMLNodePtr& styleNode)
|
|
|
|
|
|
|
|
|
|
|
|
void UIWidget::drawBackground(const Rect& screenCoords)
|
|
|
|
void UIWidget::drawBackground(const Rect& screenCoords)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(m_backgroundColor.aF() != 0.0f) {
|
|
|
|
if(m_backgroundColor.aF() > 0.0f) {
|
|
|
|
Rect drawRect = screenCoords;
|
|
|
|
Rect drawRect = screenCoords;
|
|
|
|
drawRect.translate(m_backgroundRect.topLeft());
|
|
|
|
drawRect.translate(m_backgroundRect.topLeft());
|
|
|
|
if(m_backgroundRect.isValid())
|
|
|
|
if(m_backgroundRect.isValid())
|
|
|
@ -327,28 +327,28 @@ void UIWidget::drawBackground(const Rect& screenCoords)
|
|
|
|
void UIWidget::drawBorder(const Rect& screenCoords)
|
|
|
|
void UIWidget::drawBorder(const Rect& screenCoords)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// top
|
|
|
|
// top
|
|
|
|
if(m_borderWidth.top > 0 && m_borderColor.top.aF() != 0.0f) {
|
|
|
|
if(m_borderWidth.top > 0) {
|
|
|
|
g_painter.setColor(m_borderColor.top);
|
|
|
|
g_painter.setColor(m_borderColor.top);
|
|
|
|
|
|
|
|
|
|
|
|
Rect borderRect(screenCoords.topLeft(), screenCoords.width(), m_borderWidth.top);
|
|
|
|
Rect borderRect(screenCoords.topLeft(), screenCoords.width(), m_borderWidth.top);
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// right
|
|
|
|
// right
|
|
|
|
if(m_borderWidth.right > 0 && m_borderColor.right.aF() != 0.0f) {
|
|
|
|
if(m_borderWidth.right > 0) {
|
|
|
|
g_painter.setColor(m_borderColor.right);
|
|
|
|
g_painter.setColor(m_borderColor.right);
|
|
|
|
|
|
|
|
|
|
|
|
Rect borderRect(screenCoords.topRight() - Point(m_borderWidth.right - 1, 0), m_borderWidth.right, screenCoords.height());
|
|
|
|
Rect borderRect(screenCoords.topRight() - Point(m_borderWidth.right - 1, 0), m_borderWidth.right, screenCoords.height());
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// bottom
|
|
|
|
// bottom
|
|
|
|
if(m_borderWidth.bottom > 0 && m_borderColor.bottom.aF() != 0.0f) {
|
|
|
|
if(m_borderWidth.bottom > 0) {
|
|
|
|
g_painter.setColor(m_borderColor.bottom);
|
|
|
|
g_painter.setColor(m_borderColor.bottom);
|
|
|
|
|
|
|
|
|
|
|
|
Rect borderRect(screenCoords.bottomLeft() - Point(0, m_borderWidth.bottom - 1), screenCoords.width(), m_borderWidth.bottom);
|
|
|
|
Rect borderRect(screenCoords.bottomLeft() - Point(0, m_borderWidth.bottom - 1), screenCoords.width(), m_borderWidth.bottom);
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
g_painter.drawFilledRect(borderRect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// left
|
|
|
|
// left
|
|
|
|
if(m_borderWidth.left > 0 && m_borderColor.left.aF() != 0.0f) {
|
|
|
|
if(m_borderWidth.left > 0) {
|
|
|
|
g_painter.setColor(m_borderColor.left);
|
|
|
|
g_painter.setColor(m_borderColor.left);
|
|
|
|
|
|
|
|
|
|
|
|
Rect borderRect(screenCoords.topLeft(), m_borderWidth.left, screenCoords.height());
|
|
|
|
Rect borderRect(screenCoords.topLeft(), m_borderWidth.left, screenCoords.height());
|
|
|
@ -358,7 +358,7 @@ void UIWidget::drawBorder(const Rect& screenCoords)
|
|
|
|
|
|
|
|
|
|
|
|
void UIWidget::drawIcon(const Rect& screenCoords)
|
|
|
|
void UIWidget::drawIcon(const Rect& screenCoords)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(m_icon && m_iconColor.aF() != 0.0f) {
|
|
|
|
if(m_icon) {
|
|
|
|
Rect drawRect;
|
|
|
|
Rect drawRect;
|
|
|
|
if(m_iconRect.isValid()) {
|
|
|
|
if(m_iconRect.isValid()) {
|
|
|
|
drawRect = screenCoords;
|
|
|
|
drawRect = screenCoords;
|
|
|
|