Skip to content

Conversation

@Ninja-jr
Copy link
Contributor

@Ninja-jr Ninja-jr commented Jan 1, 2026

Fixes LoRa menu custom theme images not loading. The drawIconImg() function was only calling the default icon drawer instead of loading theme images like other menus.

Proposed ChangesUpdated LoRaMenu::drawIconImg() to check if LoRa theme is enabledAdded proper theme image loading using bruceConfig.getThemeItemImg()Maintains fallback to default drawn icon when no theme image configuredTypes of Changes

Changes in the way custom images are handled and loaded and fall back to default icon if no theme is selected or no image is assigned to LoRa menu on the theme .json

Verification

-set a custom theme in settings
-go to main menu and navigate to LoRa menu
-the custom image should show

TestingTested with "lora": "LoRa.png" - custom image loads correctlyTested with "lora": true - default drawn icon showsConsistent with other menu implementations (EthernetMenu, NRF24Menu)Linked IssuesUser-Facing Change

LoRa custom theme image should now show when a theme is selected and it includes an image for the LoRa menu

Further CommentsJSON key must be lowercase "lora" to match theme struct fieldFixes issue where LoRa menu was the only menu not loading custom theme images

Added conditional logic to load a custom theme image for the LoRa menu icon, with a fallback to the default icon if not available.
@Ninja-jr
Copy link
Contributor Author

Ninja-jr commented Jan 1, 2026

Even after PR #1970 it still kept on not showing the custom LoRa .png for me and some other users, it just showed the default icon. Works fine with this fix.

@emericklaw
Copy link
Member

It works fine on the devices I have tested on.

All the menus use the same code:

void BleMenu::drawIconImg() {
drawImg(
*bruceConfig.themeFS(), bruceConfig.getThemeItemImg(bruceConfig.theme.paths.ble), 0, imgCenterY, true
);
}

void GpsMenu::drawIconImg() {
drawImg(
*bruceConfig.themeFS(), bruceConfig.getThemeItemImg(bruceConfig.theme.paths.gps), 0, imgCenterY, true
);
}

void IRMenu::drawIconImg() {
drawImg(
*bruceConfig.themeFS(), bruceConfig.getThemeItemImg(bruceConfig.theme.paths.ir), 0, imgCenterY, true
);
}

Then the LoRa menu code:

void LoRaMenu::drawIconImg() {
drawImg(
*bruceConfig.themeFS(), bruceConfig.getThemeItemImg(bruceConfig.theme.paths.lora), 0, imgCenterY, true
);
}

What devices are you having issues on? I send the firmware with my change to two users on Discord and both worked.

It might be worth trying to debug why the existing code is not working on your devices.

There will be issues with versions running the LITE version since they do not have the code to load PNG files. This might not be your issues though since you said with your changes the PNGs load.

@Ninja-jr
Copy link
Contributor Author

Ninja-jr commented Jan 1, 2026

Well i tested on tembed cc1101 and another user at least with the same device had the same issue. It was actually him that brought it to my attention as ive got the Lora menu disabled by default usually so hadn't noticed it. Upon re-enabling it and restarting the device is myself stumbled upon that same issue. I verified his .json and image, all was in the right formats. I even created a sample one for myself to test and got the same result. Then aplied this fix and it worked. You imagine i'd not go thru all this work if i didnt truelly faced that issue and then go thru with submitting the PR. But yeah a debug would be good tho the best debug is still...it didn't worked and it works now. I actually inspired myself from the way the ethernet menu got fixed as it had the same issue in the beginning.

@Ninja-jr
Copy link
Contributor Author

Ninja-jr commented Jan 1, 2026

Thing is and don't think i' trying to bash on your fixes, its a good one but it has a few issues:

  • No null/empty check on the path - assumes the path is always valid
  • No fallback mechanism if the image loading fails
  • Doesn't check if themeFS() is valid

Whilst this one adresses that

  • Checks both bruceConfig.theme.lora AND the path string
  • If no custom image is available, it gracefully falls back to the default drawn icon
  • Handles edge cases where:
    · Theme doesn't specify a LoRa image
    · Path is empty
    · Theme loading fails
    · Image file is missing/corrupt (though drawImg should handle this)

@pr3y pr3y merged commit 434c65a into BruceDevices:dev Jan 2, 2026
@Ninja-jr Ninja-jr deleted the Lora_menu_fix branch January 7, 2026 01:03
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