fix(color): channel monitor invert/override icons overlap channel bars (#6150)

This commit is contained in:
philmoz
2025-04-26 15:15:44 +10:00
committed by GitHub
parent 7a46921809
commit f66a461187
2 changed files with 7 additions and 7 deletions
@@ -221,19 +221,21 @@ ComboChannelBar::ComboChannelBar(Window* parent, const rect_t& rect,
{
LcdColorIndex txtColIdx = isInHeader ? COLOR_THEME_PRIMARY2_INDEX : COLOR_THEME_SECONDARY1_INDEX;
auto invMask = getBuiltinIcon(ICON_CHAN_MONITOR_INVERTED);
outputChannelBar = new OutputChannelBar(
this, {PAD_TINY, ChannelBar::BAR_HEIGHT + PAD_TINY, width() - PAD_TINY, ChannelBar::BAR_HEIGHT},
this, {PAD_TINY + invMask->width, ChannelBar::BAR_HEIGHT + PAD_TINY, width() - PAD_TINY, ChannelBar::BAR_HEIGHT},
channel, isInHeader);
new MixerChannelBar(
this,
{PAD_TINY, (2 * ChannelBar::BAR_HEIGHT) + PAD_TINY + 1, width() - PAD_TINY, ChannelBar::BAR_HEIGHT},
{PAD_TINY + invMask->width, (2 * ChannelBar::BAR_HEIGHT) + PAD_TINY + 1, width() - PAD_TINY, ChannelBar::BAR_HEIGHT},
channel);
// Channel number
char chanString[] = TR_CH "32 ";
strAppendSigned(&chanString[2], channel + 1, 2);
new StaticText(this, {PAD_TINY, 0, LV_SIZE_CONTENT, ChannelBar::VAL_H}, chanString,
new StaticText(this, {PAD_TINY + invMask->width, 0, LV_SIZE_CONTENT, ChannelBar::VAL_H}, chanString,
txtColIdx, FONT(XS) | LEFT);
// Channel name
@@ -258,14 +260,14 @@ ComboChannelBar::ComboChannelBar(Window* parent, const rect_t& rect,
// Override icon
#if defined(OVERRIDE_CHANNEL_FUNCTION)
overrideIcon = new StaticIcon(
this, 0, 5, ICON_CHAN_MONITOR_LOCKED, txtColIdx);
this, 0, PAD_SMALL, ICON_CHAN_MONITOR_LOCKED, txtColIdx);
overrideIcon->show(safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED);
#endif
// Channel reverted icon
LimitData* ld = limitAddress(channel);
if (ld && ld->revert) {
new StaticIcon(this, 0, ICON_SZ, ICON_CHAN_MONITOR_INVERTED,
new StaticIcon(this, 0, invMask->height + PAD_MEDIUM, ICON_CHAN_MONITOR_INVERTED,
txtColIdx);
}
}
@@ -81,8 +81,6 @@ class ComboChannelBar : public Window
ComboChannelBar(Window* parent, const rect_t& rect, uint8_t channel,
bool isInHeader = false);
static LAYOUT_VAL(ICON_SZ, 25, 25, 16)
protected:
uint8_t channel;
OutputChannelBar* outputChannelBar = nullptr;