| 56 | } |
| 57 | |
| 58 | void Button::HandleMouseButtonEvent( sf::Mouse::Button button, bool press, int /*x*/, int /*y*/ ) { |
| 59 | if( !IsMouseInWidget() ) { |
| 60 | if( GetState() == State::ACTIVE ) { |
| 61 | SetState( State::NORMAL ); |
| 62 | } |
| 63 | |
| 64 | return; |
| 65 | } |
| 66 | |
| 67 | if( button == sf::Mouse::Button::Left ) { |
| 68 | if( press ) { |
| 69 | SetState( State::ACTIVE ); |
| 70 | } |
| 71 | else if( GetState() == State::ACTIVE ) { |
| 72 | SetState( State::PRELIGHT ); |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | sf::Vector2f Button::CalculateRequisition() { |
| 78 | float padding( Context::Get().GetEngine().GetProperty<float>( "Padding", shared_from_this() ) ); |
nothing calls this directly
no outgoing calls
no test coverage detected