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

Removed glow under main menu options #5245

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

MollyMaclachlan
Copy link
Contributor

Agreement

By creating a pull request in stk-code, you hereby agree to dual-license your contribution as
GNU General Public License version 3 or any later version and
Mozilla Public License version 2 or any later version.

This includes your previous contribution(s) under the same name of contributor.

Keep the above statement in the pull request comment for agreement.

This follows the proposal in #5109 to remove the glow under the five main menu options, and derives its approach from the recommendation given when #5222 was closed.

To see if an icon button has a focus image specified, I check if the size of m_properties[PROP_FOCUS_ICON] exceeds 0, as is done when assinging m_highlight_texture in icon_button_widget.cpp.

@Alayan-stk-2
Copy link
Collaborator

From a glance at your code, you seem to set use_square to true by default, and then rely on the if/else if structure to ensure that the code meant for use_square=true is not used by things that should use the glow and not the square highlight.

This may work as is, but the name of the variable and the content of the variable not matching when the variable is used is susceptible to cause trouble down the line if surrounding code is changed.

It's cleaner to ensure the variables get values that match their meaning when setting them up at the beginning, so that they can be used later without the danger of running into gotchas.

@MollyMaclachlan
Copy link
Contributor Author

Thanks for the feedback. I've updated the approach to use the widget->m_properties[PROP_FOCUS_ICON].size() check to avoid having mark_focused set to true at all for widgets with a specified focus image; specifically, in my new code mark_focused is only set to true where a focus image is not specified. This seems more straightforward to me.

@CodingJellyfish
Copy link
Member

The code looks good to me.

@CodingJellyfish
Copy link
Member

Thank you so much for your contribution.

@CodingJellyfish CodingJellyfish merged commit 13ba4b3 into supertuxkart:master Jan 17, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants