Skip to content

Commit

Permalink
Bugfix: 4 bars appear when no indicators are being shown (#257)
Browse files Browse the repository at this point in the history
fixes #247

- **New Features**
- Enhanced workflow for publishing releases, improving versioning and
release tagging.
- **Bug Fixes**
- Adjusted character rendering logic for better visibility of up and
down indicators.
- **Documentation**
- Updated documentation for `CharacterDisplayRenderer` to clarify
reserved slots for arrow icons and available custom character slots.
  • Loading branch information
forntoh authored Oct 27, 2024
2 parents 5155935 + 7a5e2a1 commit 28f57e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -62,13 +64,13 @@ jobs:
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/forntoh/LcdMenu.git
git add .
git commit -m "Update version to $UPDATED_VERSION"
git push origin master --force
git push origin ${{ github.ref }}
- name: Create Tag
if: steps.check_tag.outputs.tag_exists == 'false'
run: |
git tag -a "${{ env.UPDATED_VERSION }}" -m "Tagging version ${{ env.UPDATED_VERSION }}"
git push origin "${{ env.UPDATED_VERSION }}"
git push origin "${{ env.UPDATED_VERSION }}" --force
- name: Install dependencies
if: steps.check_tag.outputs.tag_exists == 'false'
Expand Down Expand Up @@ -127,6 +129,7 @@ jobs:
prerelease: false
generate_release_notes: false
make_latest: true
target_commitish: ${{ github.sha }}
token: ${{ secrets.GH_PAT }}
body: ${{ steps.generate_release_notes.outputs.release_notes }}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/CharacterDisplayRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ CharacterDisplayRenderer::CharacterDisplayRenderer(

void CharacterDisplayRenderer::begin() {
MenuRenderer::begin();
static_cast<CharacterDisplayInterface*>(display)->createChar(1, upArrow);
static_cast<CharacterDisplayInterface*>(display)->createChar(2, downArrow);
static_cast<CharacterDisplayInterface*>(display)->createChar(0, upArrow);
static_cast<CharacterDisplayInterface*>(display)->createChar(1, downArrow);
}

void CharacterDisplayRenderer::drawItem(const char* text, const char* value, bool paddWithBlanks) {
Expand Down Expand Up @@ -58,7 +58,7 @@ void CharacterDisplayRenderer::drawItem(const char* text, const char* value, boo

// Draw up and down arrows if present
if (upArrow && downArrow) {
uint8_t indicator = hasHiddenItemsAbove ? 1 : (hasHiddenItemsBelow ? 2 : 0);
uint8_t indicator = hasHiddenItemsAbove ? 0 : (hasHiddenItemsBelow ? 1 : ' ');
display->setCursor(maxCols - 1, cursorRow);
display->draw(indicator);
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/CharacterDisplayRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class CharacterDisplayRenderer : public MenuRenderer {
* Initializes the renderer with the display, maximum columns, and maximum rows.
* Also sets the up and down arrow icons, cursor icons, and edit cursor icons.
*
* @note slots 1 and 2 are reserved for up and down arrow icons.
* The available custom characters slots are 0 and 3 to 7.
* @note slots 0 and 1 are reserved for up and down arrow icons.
* The available custom characters slots are 2 to 7.
*
* @param display A pointer to the CharacterDisplayInterface object.
* @param maxCols The maximum number of columns on the display.
Expand Down

0 comments on commit 28f57e5

Please sign in to comment.