fix(color): channel monitor invert/override icons overlap channel bars (#6150)
This commit is contained in:
@@ -221,19 +221,21 @@ ComboChannelBar::ComboChannelBar(Window* parent, const rect_t& rect,
|
|||||||
{
|
{
|
||||||
LcdColorIndex txtColIdx = isInHeader ? COLOR_THEME_PRIMARY2_INDEX : COLOR_THEME_SECONDARY1_INDEX;
|
LcdColorIndex txtColIdx = isInHeader ? COLOR_THEME_PRIMARY2_INDEX : COLOR_THEME_SECONDARY1_INDEX;
|
||||||
|
|
||||||
|
auto invMask = getBuiltinIcon(ICON_CHAN_MONITOR_INVERTED);
|
||||||
|
|
||||||
outputChannelBar = new OutputChannelBar(
|
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);
|
channel, isInHeader);
|
||||||
|
|
||||||
new MixerChannelBar(
|
new MixerChannelBar(
|
||||||
this,
|
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);
|
||||||
|
|
||||||
// Channel number
|
// Channel number
|
||||||
char chanString[] = TR_CH "32 ";
|
char chanString[] = TR_CH "32 ";
|
||||||
strAppendSigned(&chanString[2], channel + 1, 2);
|
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);
|
txtColIdx, FONT(XS) | LEFT);
|
||||||
|
|
||||||
// Channel name
|
// Channel name
|
||||||
@@ -258,14 +260,14 @@ ComboChannelBar::ComboChannelBar(Window* parent, const rect_t& rect,
|
|||||||
// Override icon
|
// Override icon
|
||||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||||
overrideIcon = new StaticIcon(
|
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);
|
overrideIcon->show(safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Channel reverted icon
|
// Channel reverted icon
|
||||||
LimitData* ld = limitAddress(channel);
|
LimitData* ld = limitAddress(channel);
|
||||||
if (ld && ld->revert) {
|
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);
|
txtColIdx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,8 +81,6 @@ class ComboChannelBar : public Window
|
|||||||
ComboChannelBar(Window* parent, const rect_t& rect, uint8_t channel,
|
ComboChannelBar(Window* parent, const rect_t& rect, uint8_t channel,
|
||||||
bool isInHeader = false);
|
bool isInHeader = false);
|
||||||
|
|
||||||
static LAYOUT_VAL(ICON_SZ, 25, 25, 16)
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint8_t channel;
|
uint8_t channel;
|
||||||
OutputChannelBar* outputChannelBar = nullptr;
|
OutputChannelBar* outputChannelBar = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user