Skip to content

fix: UI bug fixes and improvements#2283

Open
CloudWaddie wants to merge 1 commit intoBruceDevices:mainfrom
CloudWaddie:fix/ui-bug-fixes-and-improvements
Open

fix: UI bug fixes and improvements#2283
CloudWaddie wants to merge 1 commit intoBruceDevices:mainfrom
CloudWaddie:fix/ui-bug-fixes-and-improvements

Conversation

@CloudWaddie
Copy link
Copy Markdown

Summary

Bug Fixes

  1. globals.h - Variable shadowing fix

    • Fixed keyStroke::Clear() where alt, ctrl, gui boolean members were being shadowed by local declarations, preventing them from being properly reset
  2. display.cpp - Duplicate cursor removal

    • Removed duplicate tft.setCursor() call in displayScrollingText()
  3. display.cpp - Text wrapping for toast messages

    • Added wrapText() helper function for word-boundary aware text wrapping
    • Updated displayRedStripe() to support multi-line text with dynamic box height
    • Cleaned up displayInfo(), displaySuccess(), and displayTextLine() functions
  4. theme.cpp - validateImgFile() implementation

    • Implemented proper validation logic (was a stub returning true)
    • Checks file existence, minimum size (64 bytes), and maximum size (500KB)

UI Improvements

  1. display.cpp - Menu selection visual polish
    • Added selection highlight bar behind currently selected menu item
    • Selected item shows with inverted colors (primary theme color as background) for better visual feedback

Files Changed

  • include/globals.h
  • src/core/display.cpp
  • src/core/theme.cpp

- Fix variable shadowing bug in keyStroke::Clear() (globals.h)
  The alt/ctrl/gui boolean members were being shadowed by local declarations
  in the Clear() function, preventing them from being properly reset.

- Remove duplicate tft.setCursor() call in displayScrollingText() (display.cpp)

- Implement text wrapping for toast messages (display.cpp)
  Added wrapText() helper function and updated displayRedStripe() to support
  multi-line text with dynamic box height. Also cleaned up displayInfo(),
  displaySuccess(), and displayTextLine() functions.

- Implement validateImgFile() stub (theme.cpp)
  Added proper validation logic to check file existence and reasonable size
  (64 bytes min, 500KB max) for theme images.

- Add visual polish to menu selection (display.cpp)
  Added selection highlight bar behind currently selected menu item with
  inverted colors for better visual feedback.
@CloudWaddie
Copy link
Copy Markdown
Author

/gemini review

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.

1 participant