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

Implement OLED::drawUnavailableIcon() to simplify duplicated calls #1947

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

ia
Copy link
Collaborator

@ia ia commented Jul 11, 2024

  • Please check if the PR fulfills these requirements
  • The changes have been tested locally
  • There are no breaking changes
  • What kind of change does this PR introduce?
    Implement OLED::drawUnavailableIcon() to simplify duplicated calls.

  • What is the current behavior?
    Multiple calls of OLED::drawArea(OLED_WIDTH - 16 - 2, 0, 16, 16, UnavailableIcon) in settingsGUI.cpp with magic constants.

  • What is the new behavior (if this is a feature change)?
    Simply call OLED::drawUnavailableIcon() to draw UnavailableIcon which helps:

    • hide magic constants under the hood;
    • remove duplicated calls;
    • simplify future updates/extends for related call in the case of need by changing logic in one single place.
  • Other information:
    Check this another one small trivial refactoring out. ;)
    I'm not sure about the necessity of inline but I just wanted to give compilers explicit directive to make calls in place to make sure.

Copy link
Collaborator

@discip discip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
Looks good to me. 😊

@discip discip requested a review from Ralim July 11, 2024 13:30
@Ralim Ralim merged commit 18e936a into Ralim:dev Jul 11, 2024
17 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