Make sure all cached renderer properties are initialized and fixed some int to float warnings in VS2015 related to them

0.8
Bruno Van de Velde 2017-01-18 13:35:37 +01:00
parent 8c37b40d32
commit 9f10fb2464
15 changed files with 35 additions and 35 deletions

View File

@ -451,9 +451,9 @@ namespace tgui
Color m_titleColorCached;
Color m_titleBarColorCached;
Color m_backgroundColorCached;
float m_titleBarHeightCached;
float m_distanceToSideCached;
float m_paddingBetweenButtonsCached;
float m_titleBarHeightCached = 20;
float m_distanceToSideCached = 0;
float m_paddingBetweenButtonsCached = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};

View File

@ -334,7 +334,7 @@ namespace tgui
Color m_borderColorCached;
Color m_backgroundColorCached;
Color m_thumbColorCached;
float m_imageRotationCached;
float m_imageRotationCached = 0;
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -359,11 +359,11 @@ namespace tgui
Sprite m_spriteSelectedItemBackground;
// Cached renderer properties
Color m_backgroundColorCached;
Color m_selectedBackgroundColorCached;
Color m_textColorCached;
Color m_selectedTextColorCached;
float m_distanceToSideCached;
Color m_backgroundColorCached;
Color m_selectedBackgroundColorCached;
Color m_textColorCached;
Color m_selectedTextColorCached;
float m_distanceToSideCached = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};

View File

@ -336,7 +336,6 @@ namespace tgui
// Cached renderer properties
Borders m_bordersCached;
float m_textDistanceRatioCached;
TextStyle m_textStyleCached;
TextStyle m_textStyleCheckedCached;
Color m_checkColorCached;
@ -354,6 +353,7 @@ namespace tgui
Color m_backgroundColorCheckedCached;
Color m_backgroundColorCheckedHoverCached;
Color m_backgroundColorCheckedDisabledCached;
float m_textDistanceRatioCached = 0;
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -275,7 +275,7 @@ namespace tgui
Color m_backgroundColorHoverCached;
Color m_arrowColorCached;
Color m_arrowColorHoverCached;
float m_spaceBetweenArrowsCached;
float m_spaceBetweenArrowsCached = 0;
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -402,7 +402,7 @@ namespace tgui
Color m_selectedBackgroundColorCached;
Color m_textColorCached;
Color m_selectedTextColorCached;
float m_distanceToSideCached;
float m_distanceToSideCached = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};

View File

@ -471,7 +471,7 @@ namespace tgui
Color m_backgroundColorCached;
Color m_caretColorCached;
Color m_selectedTextBackgroundColorCached;
float m_caretWidthCached;
float m_caretWidthCached = 0;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};

View File

@ -57,8 +57,8 @@ namespace tgui
{"titlecolor", sf::Color::Black},
{"titlebarcolor", sf::Color::White},
{"backgroundcolor", Color{230, 230, 230}},
{"distancetoside", 3},
{"paddingbetweenbuttons", 1}
{"distancetoside", 3.f},
{"paddingbetweenbuttons", 1.f}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -671,6 +671,18 @@ namespace tgui
updateTitleBarHeight();
}
else if (property == "backgroundcolor")
{
m_backgroundColorCached = getRenderer()->getBackgroundColor();
}
else if (property == "titlebarcolor")
{
m_titleBarColorCached = getRenderer()->getTitleBarColor();
}
else if (property == "bordercolor")
{
m_borderColorCached = getRenderer()->getTitleBarColor();
}
else if (property == "opacity")
{
Container::rendererChanged(property);
@ -699,18 +711,6 @@ namespace tgui
updatePosition();
}
else if (property == "backgroundcolor")
{
m_backgroundColorCached = getRenderer()->getBackgroundColor();
}
else if (property == "titlebarcolor")
{
m_titleBarColorCached = getRenderer()->getTitleBarColor();
}
else if (property == "bordercolor")
{
m_borderColorCached = getRenderer()->getTitleBarColor();
}
else
Container::rendererChanged(property);
}

View File

@ -47,7 +47,7 @@ namespace tgui
{
{"borders", Borders{2}},
{"padding", Padding{4, 2, 4, 2}},
{"caretwidth", 1},
{"caretwidth", 1.f},
{"caretcolor", sf::Color::Black},
{"bordercolor", Color{60, 60, 60}},
{"bordercolorhover", sf::Color::Black},

View File

@ -41,7 +41,7 @@ namespace tgui
static std::map<std::string, ObjectConverter> defaultRendererValues =
{
{"borders", Borders{5}},
{"imagerotation", 0},
{"imagerotation", 0.f},
{"bordercolor", sf::Color::Black},
{"thumbcolor", sf::Color::Black},
{"backgroundcolor", sf::Color::White}

View File

@ -37,7 +37,7 @@ namespace tgui
{"selectedtextcolor", sf::Color::White},
{"backgroundcolor", sf::Color::White},
{"selectedbackgroundcolor", Color{0, 110, 255}},
{"distancetoside", 4}
{"distancetoside", 4.f}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -37,8 +37,8 @@ namespace tgui
{"titlecolor", sf::Color::Black},
{"titlebarcolor", sf::Color::White},
{"backgroundcolor", Color{230, 230, 230}},
{"distancetoside", 3},
{"paddingbetweenbuttons", 1},
{"distancetoside", 3.f},
{"paddingbetweenbuttons", 1.f},
{"textcolor", sf::Color::Black}
};

View File

@ -38,7 +38,7 @@ namespace tgui
{"backgroundcolorhover", sf::Color::White},
{"arrowcolor", Color{60, 60, 60}},
{"arrowcolorhover", sf::Color::Black},
{"spacebetweenarrows", 2}
{"spacebetweenarrows", 2.f}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -38,7 +38,7 @@ namespace tgui
{"selectedtextcolor", sf::Color::White},
{"backgroundcolor", sf::Color::White},
{"selectedbackgroundcolor", Color{0, 110, 255}},
{"distancetoside", 1}
{"distancetoside", 1.f}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -38,7 +38,7 @@ namespace tgui
{
{"borders", Borders{2}},
{"padding", Padding{2, 0, 0, 0}},
{"caretwidth", 1},
{"caretwidth", 1.f},
{"caretcolor", sf::Color::Black},
{"bordercolor", sf::Color::Black},
{"textcolor", sf::Color::Black},