1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Added hover_pressed style to CheckBox and CheckButton

Added hover_pressed style to CheckBox and CheckButton.
If no style is defined for this property it will default to the pressed property.
This commit is contained in:
DualMatrix
2018-09-24 01:56:30 +02:00
parent 2c7908739a
commit 99e3309296
4 changed files with 24 additions and 1 deletions

View File

@@ -360,7 +360,9 @@ BaseButton::DrawMode BaseButton::get_draw_mode() const {
return DRAW_DISABLED;
};
if (status.press_attempt == false && status.hovering && !status.pressed) {
if (status.press_attempt == false && status.hovering) {
if (status.pressed)
return DRAW_HOVER_PRESSED;
return DRAW_HOVER;
} else {
@@ -536,6 +538,7 @@ void BaseButton::_bind_methods() {
BIND_ENUM_CONSTANT(DRAW_PRESSED);
BIND_ENUM_CONSTANT(DRAW_HOVER);
BIND_ENUM_CONSTANT(DRAW_DISABLED);
BIND_ENUM_CONSTANT(DRAW_HOVER_PRESSED);
BIND_ENUM_CONSTANT(ACTION_MODE_BUTTON_PRESS);
BIND_ENUM_CONSTANT(ACTION_MODE_BUTTON_RELEASE);