mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
channellist: use hotkey icons in history mode
Origin commit data
------------------
Branch: ni/coolstream
Commit: ad62d2ba2a
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-06-30 (Fri, 30 Jun 2023)
Origin message was:
------------------
- channellist: use hotkey icons in history mode
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -2025,8 +2025,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
title_offset = OFFSET_INNER_MID;
|
title_offset = OFFSET_INNER_MID;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number);
|
|
||||||
|
|
||||||
CChannelEvent *p_event=NULL;
|
CChannelEvent *p_event=NULL;
|
||||||
if (displayMode == DISPLAY_MODE_NOW)
|
if (displayMode == DISPLAY_MODE_NOW)
|
||||||
p_event = &chan->currentEvent;
|
p_event = &chan->currentEvent;
|
||||||
@@ -2131,6 +2129,8 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
if (paintbuttons)
|
if (paintbuttons)
|
||||||
paintButtonBar(is_available);
|
paintButtonBar(is_available);
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "%d", chan->number);
|
||||||
|
|
||||||
//channel numbers
|
//channel numbers
|
||||||
if (curr == selected && move_state == beMoving)
|
if (curr == selected && move_state == beMoving)
|
||||||
{
|
{
|
||||||
@@ -2143,11 +2143,28 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_LOCK, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight);
|
frameBuffer->paintIcon(NEUTRINO_ICON_MARKER_LOCK, x + OFFSET_INNER_MID + numwidth - icon_w, ypos, fheight);
|
||||||
}
|
}
|
||||||
else if (g_settings.channellist_show_numbers)
|
else if (g_settings.channellist_show_numbers)
|
||||||
|
{
|
||||||
|
if (this->historyMode)
|
||||||
|
{
|
||||||
|
// history mode only uses digits 0..9 as hotkeys
|
||||||
|
if (pos >= 0 && pos <= 9)
|
||||||
|
{
|
||||||
|
std::string h = to_string(pos);
|
||||||
|
//frameBuffer->getIconSize(h.c_str(), &icon_w, &icon_h);
|
||||||
|
frameBuffer->paintIcon(h.c_str(), x + OFFSET_INNER_MID /*+ numwidth - icon_w*/, ypos, fheight);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DUMMY_SMALL, &icon_w, &icon_h);
|
||||||
|
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DUMMY_SMALL, x + OFFSET_INNER_MID /*+ numwidth - icon_w*/, ypos, fheight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp);
|
int numpos = x + OFFSET_INNER_MID + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp);
|
||||||
if (!this->historyMode || (this->historyMode && pos <= 9)) // history mode only uses digits 0..9 as hotkeys
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight);
|
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (!edit_state)
|
else if (!edit_state)
|
||||||
{
|
{
|
||||||
numwidth = -5;
|
numwidth = -5;
|
||||||
@@ -2383,6 +2400,13 @@ void CChannelList::paintBody()
|
|||||||
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_LOCK, &icon_w, &icon_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_LOCK, &icon_w, &icon_h);
|
||||||
numwidth = std::max(icon_w, (int) numwidth);
|
numwidth = std::max(icon_w, (int) numwidth);
|
||||||
|
|
||||||
|
if (this->historyMode)
|
||||||
|
{
|
||||||
|
// we assume NEUTRINO_ICON_BUTTON_DUMMY_SMALL has the same size as NEUTRINO_ICON_BUTTON_0..9
|
||||||
|
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DUMMY_SMALL, &icon_w, &icon_h);
|
||||||
|
numwidth = icon_w;
|
||||||
|
}
|
||||||
|
|
||||||
liststart = (selected/listmaxshow)*listmaxshow;
|
liststart = (selected/listmaxshow)*listmaxshow;
|
||||||
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
|
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user