Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hover_pressed style to CheckBox and CheckButton #22384

Merged
merged 1 commit into from
Sep 28, 2018
Merged

Added hover_pressed style to CheckBox and CheckButton #22384

merged 1 commit into from
Sep 28, 2018

Conversation

Piet-G
Copy link
Contributor

@Piet-G Piet-G commented Sep 23, 2018

Added hover_pressed style to CheckBox and CheckButton.
If no style is defined for this styleit will default to the pressed style.

This fixes #19429

Added hover_pressed style to CheckBox and CheckButton.
If no style is defined for this property it will default to the pressed property.
@akien-mga akien-mga added this to the 3.1 milestone Sep 24, 2018
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga merged commit c45ef38 into godotengine:master Sep 28, 2018
@akien-mga
Copy link
Member

akien-mga commented Sep 28, 2018

This added two warnings (GCC 5):

scene/gui/link_button.cpp: In member function 'void LinkButton::_notification(int)':
scene/gui/link_button.cpp:71:11: warning: enumeration value 'DRAW_HOVER_PRESSED' not handled in switch [-Wswitch]
    switch (get_draw_mode()) {
           ^
scene/gui/texture_button.cpp: In member function 'void TextureButton::_notification(int)':
scene/gui/texture_button.cpp:125:11: warning: enumeration value 'DRAW_HOVER_PRESSED' not handled in switch [-Wswitch]
    switch (draw_mode) {
           ^

@Piet-G
Copy link
Contributor Author

Piet-G commented Sep 28, 2018

Is that a problem? Since those buttons don't really have to deal with the HOVER_PRESSED mode.

@akien-mga
Copy link
Member

It's not a problem per se, but the aim of this warning is to make sure we don't forget to handle enum values in switches where it would actually be relevant. If it isn't for those two, a case DRAW_HOVER_PRESSED: break; // Not relevant here makes it clear for all code readers (and silences the warning). See #22447.

@akien-mga
Copy link
Member

I can fix it myself as I'm working on warnings right now, I just wanted to check if it was an omission or indeed not relevant for those two nodes.

@Piet-G
Copy link
Contributor Author

Piet-G commented Sep 28, 2018

Yeah it is only relevant for buttons where being pressed does not imply hovering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CheckBox and CheckButton ignores hover style when checked ON (pressed)
2 participants