Multi screen support, with dyn alignment (#2801)

This commit is contained in:
Totoo
2025-10-03 19:10:10 +02:00
committed by GitHub
parent 23cabb8b8a
commit 371b6b5079
161 changed files with 4042 additions and 4157 deletions
+15 -15
View File
@@ -93,8 +93,8 @@ class OOKEditorAppView : public View {
{{"ook_editor_tx_freq"sv, &ook_editor_tx_freq}}};
// UI components for frequency and transmitter view.
FrequencyField field_frequency{{0 * 8, 0 * 16}};
TransmitterView2 tx_view{{20 * 7, 0 * 16}, true};
FrequencyField field_frequency{{UI_POS_X(0), UI_POS_Y(0)}};
TransmitterView2 tx_view{{UI_POS_X_RIGHT(9), UI_POS_Y(0)}, true};
// Labels for various fields such as sample rate and repeat count.
Labels label_step{{{170, 20}, "Step:", Theme::getInstance()->fg_light->foreground}};
@@ -120,17 +120,17 @@ class OOKEditorAppView : public View {
NumberField field_repeat{{210, 40}, 3, {1, 999}, 1, '0', false};
// Text field to display the payload data.
Text text_payload{{0 * 8, 100, screen_width, 16}, ""};
Text text_payload{{UI_POS_X(0), 100, screen_width, 16}, ""};
// Buttons for setting configurations, opening files, and starting transmission.
Button button_set{{0, 125, 60, 28}, LanguageHelper::currentMessages[LANG_SET]};
Button button_open{{68, 125, 80, 28}, LanguageHelper::currentMessages[LANG_OPEN_FILE]};
Button button_save{{154, 125, 80, 28}, LanguageHelper::currentMessages[LANG_SAVE_FILE]};
Button button_bug_key{{0, 125 + 28 + 3, screen_width, 28}, "Bug Key"};
Button button_send_stop{{80, 273, 80, 32}, LanguageHelper::currentMessages[LANG_SEND]};
Button button_send_stop{{UI_POS_X_CENTER(10), 273, UI_POS_WIDTH(10), 32}, LanguageHelper::currentMessages[LANG_SEND]};
// Progress bar to display transmission progress.
ProgressBar progressbar{{2 * 8, 250, 208, 16}};
ProgressBar progressbar{{2 * 8, 250, UI_POS_WIDTH_REMAINING(4), 16}};
// Waveform display using waveform buffer and yellow theme color.
Waveform waveform{{0, 208, screen_width, 32}, waveform_buffer, 0, 0, true, Theme::getInstance()->fg_yellow->foreground};
@@ -167,11 +167,11 @@ class OOKEditorBugKeyView : public View {
std::string build_payload();
Labels labels{
{{0 * 8, 0 * 16}, "Primary Step", Theme::getInstance()->fg_light->foreground},
{{(screen_width / 2), 0 * 16}, "Secondary Step", Theme::getInstance()->fg_light->foreground}};
{{UI_POS_X(0), UI_POS_Y(0)}, "Primary Step", Theme::getInstance()->fg_light->foreground},
{{(screen_width / 2), UI_POS_Y(0)}, "Secondary Step", Theme::getInstance()->fg_light->foreground}};
NumberField field_primary_step{
{0 * 8, 1 * 16},
{UI_POS_X(0), 1 * 16},
3,
{0, 550},
1,
@@ -185,30 +185,30 @@ class OOKEditorBugKeyView : public View {
' '};
Console console{
{0, 3 * 16, screen_width, screen_height - 10 * 16}};
{0, UI_POS_Y(3), screen_width, UI_POS_HEIGHT_REMAINING(10)}};
Button button_insert_low_level_long{
{0 * 8, 13 * 16, screen_width / 2, 2 * 16},
{UI_POS_X(0), UI_POS_Y_BOTTOM(7), screen_width / 2, UI_POS_HEIGHT(2)},
"00"};
Button button_insert_low_level_short{
{0 * 8, 15 * 16, screen_width / 2, 2 * 16},
{UI_POS_X(0), UI_POS_Y_BOTTOM(5), screen_width / 2, UI_POS_HEIGHT(2)},
"0"};
Button button_insert_high_level_long{
{(screen_width / 2), 13 * 16, screen_width / 2, 2 * 16},
{(screen_width / 2), UI_POS_Y_BOTTOM(7), screen_width / 2, UI_POS_HEIGHT(2)},
"11"};
Button button_insert_high_level_short{
{(screen_width / 2), 15 * 16, screen_width / 2, 2 * 16},
{(screen_width / 2), UI_POS_Y_BOTTOM(5), screen_width / 2, UI_POS_HEIGHT(2)},
"1"};
Button button_delete{
{1, 17 * 16, screen_width / 2 - 4, 2 * 16},
{1, UI_POS_Y_BOTTOM(3), screen_width / 2 - 4, UI_POS_HEIGHT(2)},
"<Backspace"};
Button button_save{
{1 + screen_width / 2 + 1, 17 * 16, screen_width / 2 - 4, 2 * 16},
{1 + screen_width / 2 + 1, UI_POS_Y_BOTTOM(3), screen_width / 2 - 4, UI_POS_HEIGHT(2)},
"Save"};
};