ui: QR sharing overlay + Share My QR header on Contacts tab

Adds an lxma://<hash>:<pubkey> QR overlay reachable from Settings and
from a new header row at the top of the Contacts tab. Including the
public key lets Columba/Sideband skip the PENDING_IDENTITY round-trip.

Contacts list stays visible even with no saved contacts so the header
row is always reachable; the empty-state floats above it.
This commit is contained in:
drkhsh
2026-05-05 21:54:05 +02:00
parent 00782336f3
commit d9c92abf6c
8 changed files with 187 additions and 8 deletions
+20
View File
@@ -33,6 +33,7 @@
#include "ui/screens/LvContactsScreen.h"
#include "ui/screens/LvSettingsScreen.h"
#include "ui/screens/LvHelpOverlay.h"
#include "ui/screens/LvQrOverlay.h"
// Map screen removed
#include "ui/screens/LvNameInputScreen.h"
#include "ui/screens/LvTimezoneScreen.h"
@@ -117,6 +118,7 @@ LvContactsScreen lvContactsScreen;
LvMessageView lvMessageView;
LvSettingsScreen lvSettingsScreen;
LvHelpOverlay lvHelpOverlay;
LvQrOverlay lvQrOverlay;
// LvMapScreen removed
LvNameInputScreen lvNameInputScreen;
LvTimezoneScreen lvTimezoneScreen;
@@ -1071,8 +1073,22 @@ void setup() {
});
#endif
auto showQr = []() {
// Encode `lxma://<destHash>:<publicKey>` so Columba/Sideband
// scanners get a full identity (no PENDING_IDENTITY round-trip).
String destHex = rns.destinationHashHex();
String pubHex;
if (auto identity = rns.destination().identity()) {
pubHex = String(identity.get_public_key().toHex().c_str());
}
lvQrOverlay.show(destHex, pubHex);
};
lvSettingsScreen.setShowQrCallback(showQr);
lvContactsScreen.setShowQrCallback(showQr);
// LVGL help overlay
lvHelpOverlay.create();
lvQrOverlay.create();
// Tab bar callbacks — LVGL
lvTabScreens[LvTabBar::TAB_HOME] = &lvHomeScreen;
@@ -1250,6 +1266,10 @@ void loop() {
if (lvHelpOverlay.isVisible()) {
lvHelpOverlay.handleKey(evt);
}
// QR overlay also dismisses on any keypress while visible
else if (lvQrOverlay.isVisible()) {
lvQrOverlay.handleKey(evt);
}
else {
// Screen-local input owns the keyboard. This keeps message and
// settings text entry from being preempted by global shortcuts.