From 216af8718de046d75a1a558781c1fbf27b493019 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 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c87209500946c68484b900f73875071ee8360f0 Author: vanhofen Date: 2023-07-03 (Mon, 03 Jul 2023) Origin message was: ------------------ - channellist: ust lock icon as a status icon on the right side ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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 b6ceda485..0aca8c50a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2069,6 +2069,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) @@ -2090,6 +2095,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); @@ -2141,11 +2156,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