From af87e2e3658a8513599566bdc0b0ca59d8d23e0c Mon Sep 17 00:00:00 2001 From: Kevin Koenig Date: Sun, 12 Dec 2021 03:27:36 -0500 Subject: [PATCH] [NV14] Fix mix channel monitor size (#1231) * fix mix channel monitor size on nv14 * add right margin to mix channel monitor on nv14 * Rebase and revert libopenui change Co-authored-by: Peter Feerick --- radio/src/gui/colorlcd/model_mixes.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/model_mixes.cpp b/radio/src/gui/colorlcd/model_mixes.cpp index 746dedd7a..2aedebb28 100644 --- a/radio/src/gui/colorlcd/model_mixes.cpp +++ b/radio/src/gui/colorlcd/model_mixes.cpp @@ -58,6 +58,17 @@ bool reachMixesLimit() return false; } + +#if (LCD_W > LCD_H) + #define MIX_STATUS_BAR_WIDTH 250 + #define MIX_STATUS_BAR_MARGIN 3 + #define MIX_RIGHT_MARGIN 0 +#else + #define MIX_STATUS_BAR_WIDTH 180 + #define MIX_STATUS_BAR_MARGIN 0 + #define MIX_RIGHT_MARGIN 3 +#endif + class MixerEditStatusBar : public Window { public: @@ -65,7 +76,7 @@ class MixerEditStatusBar : public Window Window(parent, rect), _channel(channel) { - channelBar = new ComboChannelBar(this, {3, 0, rect.w - 6, rect.h}, channel); + channelBar = new ComboChannelBar(this, {MIX_STATUS_BAR_MARGIN, 0, rect.w - (MIX_STATUS_BAR_MARGIN * 2), rect.h}, channel); channelBar->setLeftMargin(0); channelBar->setTextColor(COLOR_THEME_PRIMARY2); channelBar->setOutputChannelBarLimitColor(COLOR_THEME_EDIT); @@ -109,7 +120,7 @@ class MixEditWindow : public Page getSourceString(MIXSRC_CH1 + channel), 0, COLOR_THEME_PRIMARY2); statusBar = new MixerEditStatusBar( - window, {window->getRect().w - 250, 0, 250, MENU_HEADER_HEIGHT + 3}, + window, {window->getRect().w - MIX_STATUS_BAR_WIDTH - MIX_RIGHT_MARGIN, 0, MIX_STATUS_BAR_WIDTH, MENU_HEADER_HEIGHT + 3}, channel); }