From 77c3d82d27ae9fef18ddebf26b593ef4664d244f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 3 Jul 2023 22:43:19 +0200 Subject: [PATCH] channellist: ust lock icon as a status icon on the right side --- src/gui/channellist.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 48f6157fe..21ad24eed 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2068,6 +2068,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if (!chan->getUrl().empty()) webtv_icon = NEUTRINO_ICON_MARKER_STREAMING; + //set lock icon + const char *lock_icon = NULL; + if (chan->bLocked) + lock_icon = NEUTRINO_ICON_MARKER_LOCK; + //set scramble icon const char *scramble_icon = NULL; if (chan->scrambled) @@ -2089,6 +2094,16 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } } + if (lock_icon) + { + frameBuffer->getIconSize(lock_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(lock_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } + if (scramble_icon) { frameBuffer->getIconSize(scramble_icon, &icon_w, &icon_h); @@ -2140,11 +2155,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint) //frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icon_w, &icon_h); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID /*+ numwidth - icon_w*/, ypos, fheight); } - else if (edit_state && chan->bLocked) - { - //frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_LOCK, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_LOCK, x + OFFSET_INNER_MID /*+ numwidth - icon_w*/, ypos, fheight); - } else if (this->historyMode) { // history mode only uses digits 0..9 as hotkeys