mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-17 07:17:32 +00:00
I thought git would be smart enough to understand all the whitespace changes but even with all the flags I know to make it ignore theses it still blows up if there are identical changes on both sides.
I have a solution but it require creating a new commit at the merge base for each conflicting PR and merging it into develop.
I don't think blowing up all PRs is worth for now, maybe if we can coordinate this for V3 let's say.
This reverts commit 0d11331d18.
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "configuration.h"
|
|
#if HAS_SCREEN
|
|
|
|
#include "graphics/Screen.h" // InputEvent
|
|
#include "graphics/VirtualKeyboard.h"
|
|
#include <OLEDDisplay.h>
|
|
#include <functional>
|
|
#include <string>
|
|
|
|
namespace graphics
|
|
{
|
|
class OnScreenKeyboardModule
|
|
{
|
|
public:
|
|
static OnScreenKeyboardModule &instance();
|
|
|
|
void start(const char *header, const char *initialText, uint32_t durationMs,
|
|
std::function<void(const std::string &)> callback);
|
|
|
|
void stop(bool callEmptyCallback);
|
|
|
|
void handleInput(const InputEvent &event);
|
|
static bool processVirtualKeyboardInput(const InputEvent &event, VirtualKeyboard *keyboard);
|
|
bool draw(OLEDDisplay *display);
|
|
|
|
void showPopup(const char *title, const char *content, uint32_t durationMs);
|
|
void clearPopup();
|
|
// Draw only the popup overlay (used when legacy virtualKeyboard draws the keyboard)
|
|
void drawPopupOverlay(OLEDDisplay *display);
|
|
|
|
private:
|
|
OnScreenKeyboardModule() = default;
|
|
~OnScreenKeyboardModule();
|
|
OnScreenKeyboardModule(const OnScreenKeyboardModule &) = delete;
|
|
OnScreenKeyboardModule &operator=(const OnScreenKeyboardModule &) = delete;
|
|
|
|
void onSubmit(const std::string &text);
|
|
void onCancel();
|
|
|
|
void drawPopup(OLEDDisplay *display);
|
|
|
|
VirtualKeyboard *keyboard = nullptr;
|
|
std::function<void(const std::string &)> callback;
|
|
|
|
char popupTitle[64] = {0};
|
|
char popupMessage[256] = {0};
|
|
uint32_t popupUntil = 0;
|
|
bool popupVisible = false;
|
|
};
|
|
|
|
} // namespace graphics
|
|
|
|
#endif // HAS_SCREEN
|