Fix a few problems with buttons.
The old behavior of checkboxes (dragging a click over them) is still available.
This commit is contained in:
parent
bbf5436664
commit
866504b122
1 changed files with 5 additions and 3 deletions
|
@ -228,7 +228,7 @@ void button::mouse_motion(SDL_MouseMotionEvent const &event)
|
|||
// the cursor is not over the widget
|
||||
if (state_ == PRESSED_ACTIVE)
|
||||
state_ = PRESSED;
|
||||
else
|
||||
else if (type_ != TYPE_CHECK || state_ != PRESSED)
|
||||
state_ = NORMAL;
|
||||
}
|
||||
}
|
||||
|
@ -250,8 +250,10 @@ void button::mouse_up(SDL_MouseButtonEvent const &event)
|
|||
pressed_ = true;
|
||||
break;
|
||||
case TYPE_PRESS:
|
||||
state_ = ACTIVE;
|
||||
pressed_ = true;
|
||||
if (state_ == PRESSED) {
|
||||
state_ = ACTIVE;
|
||||
pressed_ = true;
|
||||
}
|
||||
break;
|
||||
case TYPE_TURBO:
|
||||
state_ = ACTIVE;
|
||||
|
|
Loading…
Add table
Reference in a new issue