| 49 | } |
| 50 | |
| 51 | sf::Vector2f SpinButton::CalculateRequisition() { |
| 52 | const std::string& font_name( Context::Get().GetEngine().GetProperty<std::string>( "FontName", shared_from_this() ) ); |
| 53 | unsigned int font_size( Context::Get().GetEngine().GetProperty<unsigned int>( "FontSize", shared_from_this() ) ); |
| 54 | float border_width( Context::Get().GetEngine().GetProperty<float>( "BorderWidth", shared_from_this() ) ); |
| 55 | float text_padding( Context::Get().GetEngine().GetProperty<float>( "Padding", shared_from_this() ) ); |
| 56 | const sf::Font& font( *Context::Get().GetEngine().GetResourceManager().GetFont( font_name ) ); |
| 57 | auto line_height = Context::Get().GetEngine().GetFontLineHeight( font, font_size ); |
| 58 | |
| 59 | return sf::Vector2f( 2 * (border_width + text_padding), line_height + 2 * ( border_width + text_padding ) ); |
| 60 | } |
| 61 | |
| 62 | const std::string& SpinButton::GetName() const { |
| 63 | static const std::string name( "SpinButton" ); |
nothing calls this directly
no test coverage detected