mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +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;
|
||||
}
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number);
|
||||
|
||||
CChannelEvent *p_event=NULL;
|
||||
if (displayMode == DISPLAY_MODE_NOW)
|
||||
p_event = &chan->currentEvent;
|
||||
@@ -2131,6 +2129,8 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
||||
if (paintbuttons)
|
||||
paintButtonBar(is_available);
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%d", chan->number);
|
||||
|
||||
//channel numbers
|
||||
if (curr == selected && move_state == beMoving)
|
||||
{
|
||||
@@ -2144,9 +2144,26 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
||||
}
|
||||
else if (g_settings.channellist_show_numbers)
|
||||
{
|
||||
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
|
||||
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);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight);
|
||||
}
|
||||
}
|
||||
else if (!edit_state)
|
||||
{
|
||||
@@ -2383,6 +2400,13 @@ void CChannelList::paintBody()
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_LOCK, &icon_w, &icon_h);
|
||||
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;
|
||||
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
|
||||
|
||||
|
Reference in New Issue
Block a user