Add visual effect for disabled textfields

This commit is contained in:
Flakebi 2014-06-04 12:49:41 +02:00
parent 9c1e371803
commit 39e5b57233
3 changed files with 18 additions and 3 deletions

View File

@ -237,8 +237,10 @@ when the border that intersect at this corner are enabled.
<!-- Text field color -->
<color type="text_field" state="background" a="255" r="200" g="200" b="200" />
<color type="text_field" state="background_focused" a="255" r="223" g="238" b="248" />
<color type="text_field" state="background_deactivated" a="255" r="200" g="200" b="200" />
<color type="text_field" state="neutral" a="255" r="138" g="138" b="138" />
<color type="text_field" state="focused" a="255" r="42" g="169" b="211" />
<color type="text_field" state="deactivated" a="255" r="138" g="138" b="138" />
<!-- Rating star image -->
<element type="rating" state="neutral" image="ocean/rating_star.png" />

View File

@ -235,8 +235,10 @@ when the border that intersect at this corner are enabled.
<!-- Text field color -->
<color type="text_field" state="background" a="255" r="200" g="200" b="200" />
<color type="text_field" state="background_focused" a="255" r="236" g="226" b="201" />
<color type="text_field" state="background_deactivated" a="255" r="200" g="200" b="200" />
<color type="text_field" state="neutral" a="255" r="138" g="138" b="138" />
<color type="text_field" state="focused" a="255" r="243" g="164" b="80" />
<color type="text_field" state="deactivated" a="255" r="138" g="138" b="138" />
<!-- Rating star image -->
<element type="rating" state="neutral" image="peach/rating_star.png" />

View File

@ -691,7 +691,6 @@ X##_yflip.LowerRightCorner.Y = w->m_skin_dest_y + \
void Skin::drawButton(Widget* w, const core::recti &rect,
const bool pressed, const bool focused)
{
// if within an appearing dialog, grow
if (m_dialog && m_dialog_size < 1.0f && w->m_parent != NULL &&
w->m_parent->getType() == gui::EGUIET_WINDOW)
@ -2101,8 +2100,10 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor,
{
SColor& bg_color = SkinConfig::m_colors["text_field::background"];
SColor& bg_color_focused = SkinConfig::m_colors["text_field::background_focused"];
SColor& bg_color_deactivated = SkinConfig::m_colors["text_field::background_deactivated"];
SColor& border_color = SkinConfig::m_colors["text_field::neutral"];
SColor& border_color_focus = SkinConfig::m_colors["text_field::focused"];
SColor& border_color_deactivated = SkinConfig::m_colors["text_field::deactivated"];
core::recti borderArea = rect;
//borderArea.UpperLeftCorner -= position2d< s32 >( 2, 2 );
@ -2128,12 +2129,22 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor,
center.Y + (int)(((int)rect.LowerRightCorner.Y
- (int)center.Y)*texture_size);
}
GL32_draw2DRectangle(focused ? border_color_focus : border_color, borderArea);
if(widget->m_deactivated)
GL32_draw2DRectangle(border_color_deactivated, borderArea);
else if(focused)
GL32_draw2DRectangle(border_color_focus, borderArea);
else
GL32_draw2DRectangle(border_color, borderArea);
core::recti innerArea = borderArea;
innerArea.UpperLeftCorner += position2d< s32 >( 3, 3 );
innerArea.LowerRightCorner -= position2d< s32 >( 3, 3 );
GL32_draw2DRectangle(focused ? bg_color_focused : bg_color, innerArea);
if(widget->m_deactivated)
GL32_draw2DRectangle(bg_color_deactivated, innerArea);
else if(focused)
GL32_draw2DRectangle(bg_color_focused, innerArea);
else
GL32_draw2DRectangle(bg_color, innerArea);
return;
}
else if (type == WTYPE_LIST)