Tweak textboxes skin
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13033 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
e88c84d713
commit
fc9515222f
@ -209,7 +209,9 @@ when the border that intersect at this corner are enabled.
|
||||
<color type="dialog_background" state="neutral" a="120" r="0" g="0" b="0" />
|
||||
|
||||
<!-- Text field color -->
|
||||
<color type="text_field" state="neutral" a="255" r="215" g="215" b="215" />
|
||||
<color type="text_field" state="background" a="255" r="200" g="200" b="200" />
|
||||
<color type="text_field" state="background_focused" a="255" r="195" g="222" b="194" />
|
||||
<color type="text_field" state="neutral" a="255" r="138" g="138" b="138" />
|
||||
<color type="text_field" state="focused" a="255" r="0" g="150" b="0" />
|
||||
|
||||
<!-- Rating star image -->
|
||||
|
@ -209,8 +209,10 @@ when the border that intersect at this corner are enabled.
|
||||
<color type="dialog_background" state="neutral" a="120" r="0" g="0" b="0" />
|
||||
|
||||
<!-- Text field color -->
|
||||
<color type="text_field" state="neutral" a="255" r="215" g="215" b="215" />
|
||||
<color type="text_field" state="focused" a="255" r="138" g="138" b="138" />
|
||||
<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="neutral" a="255" r="138" g="138" b="138" />
|
||||
<color type="text_field" state="focused" a="255" r="42" g="169" b="211" />
|
||||
|
||||
<!-- Rating star image -->
|
||||
<element type="rating" state="neutral" image="ocean/rating_star.png" />
|
||||
|
@ -208,8 +208,10 @@ when the border that intersect at this corner are enabled.
|
||||
<color type="dialog_background" state="neutral" a="120" r="0" g="0" b="0" />
|
||||
|
||||
<!-- Text field color -->
|
||||
<color type="text_field" state="neutral" a="255" r="215" g="215" b="215" />
|
||||
<color type="text_field" state="focused" a="255" r="138" g="138" b="138" />
|
||||
<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="neutral" a="255" r="138" g="138" b="138" />
|
||||
<color type="text_field" state="focused" a="255" r="243" g="164" b="80" />
|
||||
|
||||
<!-- Rating star image -->
|
||||
<element type="rating" state="neutral" image="peach/rating_star.png" />
|
||||
|
@ -2012,70 +2012,41 @@ void Skin::draw3DSunkenPane (IGUIElement *element, video::SColor bgcolor,
|
||||
|
||||
if (element->getType()==gui::EGUIET_EDIT_BOX)
|
||||
{
|
||||
SColor& color = SkinConfig::m_colors["text_field::neutral"];
|
||||
SColor& colorFocus = SkinConfig::m_colors["text_field::focused"];
|
||||
SColor& bg_color = SkinConfig::m_colors["text_field::background"];
|
||||
SColor& bg_color_focused = SkinConfig::m_colors["text_field::background_focused"];
|
||||
SColor& border_color = SkinConfig::m_colors["text_field::neutral"];
|
||||
SColor& border_color_focus = SkinConfig::m_colors["text_field::focused"];
|
||||
|
||||
if (focused)
|
||||
core::recti borderArea = rect;
|
||||
borderArea.UpperLeftCorner -= position2d< s32 >( 2, 2 );
|
||||
borderArea.LowerRightCorner += position2d< s32 >( 2, 2 );
|
||||
|
||||
// if within an appearing dialog, grow
|
||||
if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL &&
|
||||
widget->m_parent->getType() == gui::EGUIET_WINDOW)
|
||||
{
|
||||
core::recti borderArea = rect;
|
||||
borderArea.UpperLeftCorner -= position2d< s32 >( 2, 2 );
|
||||
borderArea.LowerRightCorner += position2d< s32 >( 2, 2 );
|
||||
core::position2d<u32> center(irr_driver->getFrameSize()/2);
|
||||
const float texture_size = sin(m_dialog_size*M_PI*0.5f);
|
||||
|
||||
// if within an appearing dialog, grow
|
||||
if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL &&
|
||||
widget->m_parent->getType() == gui::EGUIET_WINDOW)
|
||||
{
|
||||
core::position2d<u32> center(irr_driver->getFrameSize()/2);
|
||||
const float texture_size = sin(m_dialog_size*M_PI*0.5f);
|
||||
|
||||
borderArea.UpperLeftCorner.X =
|
||||
center.X + (int)(((int)rect.UpperLeftCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
borderArea.UpperLeftCorner.Y =
|
||||
center.Y + (int)(((int)rect.UpperLeftCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
borderArea.LowerRightCorner.X =
|
||||
center.X + (int)(((int)rect.LowerRightCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
borderArea.LowerRightCorner.Y =
|
||||
center.Y + (int)(((int)rect.LowerRightCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
}
|
||||
GUIEngine::getDriver()->draw2DRectangle( colorFocus, borderArea );
|
||||
|
||||
core::recti innerArea = borderArea;
|
||||
innerArea.UpperLeftCorner += position2d< s32 >( 2, 2 );
|
||||
innerArea.LowerRightCorner -= position2d< s32 >( 2, 2 );
|
||||
GUIEngine::getDriver()->draw2DRectangle( color, innerArea );
|
||||
}
|
||||
else
|
||||
{
|
||||
// if within an appearing dialog, grow
|
||||
if (m_dialog && m_dialog_size < 1.0f && widget->m_parent != NULL &&
|
||||
widget->m_parent->getType() == gui::EGUIET_WINDOW)
|
||||
{
|
||||
core::position2d<u32> center(irr_driver->getFrameSize()/2);
|
||||
const float texture_size = sin(m_dialog_size*M_PI*0.5f);
|
||||
core::recti sizedRect;
|
||||
sizedRect.UpperLeftCorner.X =
|
||||
center.X + (int)(((int)rect.UpperLeftCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
sizedRect.UpperLeftCorner.Y =
|
||||
center.Y + (int)(((int)rect.UpperLeftCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
sizedRect.LowerRightCorner.X =
|
||||
center.X + (int)(((int)rect.LowerRightCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
sizedRect.LowerRightCorner.Y =
|
||||
center.Y + (int)(((int)rect.LowerRightCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
GUIEngine::getDriver()->draw2DRectangle( color, sizedRect );
|
||||
}
|
||||
else
|
||||
{
|
||||
GUIEngine::getDriver()->draw2DRectangle( color, rect );
|
||||
}
|
||||
borderArea.UpperLeftCorner.X =
|
||||
center.X + (int)(((int)rect.UpperLeftCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
borderArea.UpperLeftCorner.Y =
|
||||
center.Y + (int)(((int)rect.UpperLeftCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
borderArea.LowerRightCorner.X =
|
||||
center.X + (int)(((int)rect.LowerRightCorner.X
|
||||
- (int)center.X)*texture_size);
|
||||
borderArea.LowerRightCorner.Y =
|
||||
center.Y + (int)(((int)rect.LowerRightCorner.Y
|
||||
- (int)center.Y)*texture_size);
|
||||
}
|
||||
GUIEngine::getDriver()->draw2DRectangle(focused ? border_color_focus : border_color, borderArea);
|
||||
|
||||
core::recti innerArea = borderArea;
|
||||
innerArea.UpperLeftCorner += position2d< s32 >( 2, 2 );
|
||||
innerArea.LowerRightCorner -= position2d< s32 >( 2, 2 );
|
||||
GUIEngine::getDriver()->draw2DRectangle(focused ? bg_color_focused : bg_color, innerArea);
|
||||
return;
|
||||
}
|
||||
else if (type == WTYPE_LIST)
|
||||
|
Loading…
Reference in New Issue
Block a user