feat(color): Add 'popup' option for GVARs already present on B&W (#4554)

This commit is contained in:
philmoz
2024-01-26 20:13:42 +10:00
committed by GitHub
parent 5fd1154da6
commit 8381a68a91
7 changed files with 28 additions and 14 deletions
+5
View File
@@ -492,6 +492,11 @@ class GVarEditWindow : public Page
});
max->setAccelFactor(16);
line = window->newLine(&grid);
new StaticText(line, rect_t{}, STR_POPUP, 0, COLOR_THEME_PRIMARY1);
grid.nextCell();
new ToggleSwitch(line, rect_t{}, GET_SET_DEFAULT(gvar->popup));
line = window->newLine(&grid);
char flightModeName[16];
FlightModeData* fmData;
+4 -4
View File
@@ -115,8 +115,8 @@ void POPUP_WARNING_ON_UI_TASK(const char * message, const char * info, bool wait
class BubbleDialog : public Window
{
public:
BubbleDialog(const char* message, int timeout) :
Window(MainWindow::instance(), rect_t{50, LCD_H - 100, LCD_W - 100, 50}, OPAQUE, 0, etx_bubble_popup_create)
BubbleDialog(const char* message, int timeout, coord_t width) :
Window(MainWindow::instance(), rect_t{(LCD_W - width) / 2, LCD_H - 100, width, 50}, OPAQUE, 0, etx_bubble_popup_create)
{
lv_obj_set_parent(lvobj, lv_layer_top());
@@ -143,7 +143,7 @@ class BubbleDialog : public Window
uint32_t endTime;
};
void POPUP_BUBBLE(const char* message, uint32_t timeout)
void POPUP_BUBBLE(const char* message, uint32_t timeout, coord_t width)
{
new BubbleDialog(message, timeout);
new BubbleDialog(message, timeout, width);
}
+1 -1
View File
@@ -28,6 +28,6 @@ typedef std::function<void(const char *, const char *, int, int)> ProgressHandle
void POPUP_INFORMATION(const char * message);
void POPUP_WARNING(const char * message, const char * info = nullptr);
void POPUP_WARNING_ON_UI_TASK(const char * message, const char * info = nullptr, bool waitForClose = true);
void POPUP_BUBBLE(const char * message, uint32_t timeout);
void POPUP_BUBBLE(const char * message, uint32_t timeout, coord_t width = LCD_W - 100);
void show_ui_popup();