diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-09-28 10:54:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 10:54:02 +0200 |
commit | c45ef380041f7bc652f9b1975710976039f01faa (patch) | |
tree | 32f31c5bc1e9fefdc9e19813e1e54a47baf7e418 /scene/gui/base_button.cpp | |
parent | 28c683721948bcbb58c4caa0d8aefa82f2b18a88 (diff) | |
parent | 99e33092960e131427af6de24a386c7ab3f6593d (diff) |
Merge pull request #22384 from DualMatrix/hover_pressed
Added hover_pressed style to CheckBox and CheckButton
Diffstat (limited to 'scene/gui/base_button.cpp')
-rw-r--r-- | scene/gui/base_button.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 59590ea67b..895e76d516 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -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); |