mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
CChannelList: using CComponentsHeader to paint header
- using CComponentsFrmClock to paint clock in header
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0128a61708
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-06-01 (Sat, 01 Jun 2013)
Origin message was:
------------------
* CChannelList: using CComponentsHeader to paint header
- using CComponentsFrmClock to paint clock in header
------------------
This commit was generated by Migit
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
#include <gui/widget/messagebox.h>
|
#include <gui/widget/messagebox.h>
|
||||||
#include <gui/components/cc_item_progressbar.h>
|
#include <gui/components/cc_item_progressbar.h>
|
||||||
#include <gui/components/cc.h>
|
#include <gui/components/cc.h>
|
||||||
|
#include <gui/components/cc_frm.h>
|
||||||
|
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
@@ -117,6 +118,8 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
|
|||||||
previous_channellist_additional = -1;
|
previous_channellist_additional = -1;
|
||||||
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
|
||||||
dline = NULL;
|
dline = NULL;
|
||||||
|
clock = NULL;
|
||||||
|
logo_off = 0;
|
||||||
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
//printf("************ NEW LIST %s : %x\n", name.c_str(), (int) this);fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,6 +128,14 @@ CChannelList::~CChannelList()
|
|||||||
//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout);
|
//printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout);
|
||||||
chanlist.clear();
|
chanlist.clear();
|
||||||
delete dline;
|
delete dline;
|
||||||
|
if (clock) {
|
||||||
|
if (clock->isClockRun())
|
||||||
|
clock->Stop();
|
||||||
|
if (clock->isPainted())
|
||||||
|
clock->hide();
|
||||||
|
delete clock;
|
||||||
|
clock = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::ClearList(void)
|
void CChannelList::ClearList(void)
|
||||||
@@ -938,6 +949,9 @@ int CChannelList::show()
|
|||||||
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
printf("CChannelList:: bouquetList->exec res %d\n", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (clock && clock->isClockRun())
|
||||||
|
clock->Stop();
|
||||||
|
|
||||||
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())
|
if(NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -956,6 +970,12 @@ void CChannelList::hide()
|
|||||||
{
|
{
|
||||||
videoDecoder->Pig(-1, -1, -1, -1);
|
videoDecoder->Pig(-1, -1, -1, -1);
|
||||||
}
|
}
|
||||||
|
if (clock) {
|
||||||
|
if (clock->isClockRun())
|
||||||
|
clock->Stop();
|
||||||
|
if (clock->isPainted())
|
||||||
|
clock->hide();
|
||||||
|
}
|
||||||
frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height);
|
frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height);
|
||||||
clearItem2DetailsLine();
|
clearItem2DetailsLine();
|
||||||
}
|
}
|
||||||
@@ -2050,53 +2070,32 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
|||||||
|
|
||||||
void CChannelList::paintHead()
|
void CChannelList::paintHead()
|
||||||
{
|
{
|
||||||
int timestr_len = 0;
|
CComponentsHeader header(x, y, full_width, theight, name, NULL /*no header icon*/);
|
||||||
char timestr[10] = {0};
|
header.paint(CC_SAVE_SCREEN_NO);
|
||||||
time_t now = time(NULL);
|
|
||||||
struct tm *tm = localtime(&now);
|
|
||||||
|
|
||||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
static int clockWidth = 0;
|
||||||
|
if (g_Sectionsd->getIsTimeSet()) {
|
||||||
if(gotTime) {
|
if (clock == NULL) {
|
||||||
strftime(timestr, 10, "%H:%M", tm);
|
clock = new CComponentsFrmClock(0, y, 0, theight, "%H:%M");
|
||||||
timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8
|
clock->setClockFontType(SNeutrinoSettings::FONT_TYPE_MENU_TITLE);
|
||||||
|
clock->setTextColor(COL_MENUHEAD);
|
||||||
|
clock->setColorBody(COL_MENUHEAD_PLUS_0);
|
||||||
|
clock->setCornerRadius(RADIUS_LARGE);
|
||||||
|
clock->setCornerType(CORNER_TOP_RIGHT);
|
||||||
|
clock->setClockIntervall(10);
|
||||||
|
clock->refresh();
|
||||||
|
clockWidth = clock->getWidth();
|
||||||
|
clock->setXPos(x + full_width - clockWidth - 10);
|
||||||
|
clockWidth += 6;
|
||||||
|
}
|
||||||
|
if (!clock->isClockRun())
|
||||||
|
clock->Start();
|
||||||
|
else
|
||||||
|
clock->paint(CC_SAVE_SCREEN_NO);
|
||||||
}
|
}
|
||||||
#if 0
|
else
|
||||||
int iw1, iw2, iw3, ih = 0;
|
clockWidth = 0;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw1, &ih);
|
logo_off = clockWidth + 10;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MENU, &iw2, &ih);
|
|
||||||
if (new_zap_mode)
|
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih);
|
|
||||||
|
|
||||||
// head
|
|
||||||
frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
|
||||||
|
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + full_width - iw1 - 10, y, theight); //y+ 5 );
|
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + full_width - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button
|
|
||||||
if (new_zap_mode)
|
|
||||||
frameBuffer->paintIcon((new_zap_mode == 2 /* active */) ?
|
|
||||||
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
|
||||||
x + full_width - iw1 - iw2 - iw3 - 18, y, theight);
|
|
||||||
|
|
||||||
if (gotTime) {
|
|
||||||
int iw3x = (new_zap_mode) ? iw3 : -10;
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - iw1 - iw2 - iw3x - 28 -timestr_len,
|
|
||||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
timestr_len += 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
timestr_len += iw1 + iw2 + 12;
|
|
||||||
if (new_zap_mode)
|
|
||||||
timestr_len += iw3 + 10;
|
|
||||||
#endif
|
|
||||||
frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
|
||||||
if (gotTime) {
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + full_width - timestr_len - 10,
|
|
||||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
timestr_len += 4;
|
|
||||||
}
|
|
||||||
logo_off = timestr_len + 10;
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, full_width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paint()
|
void CChannelList::paint()
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include <driver/framebuffer.h>
|
#include <driver/framebuffer.h>
|
||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
#include <gui/components/cc.h>
|
#include <gui/components/cc.h>
|
||||||
|
#include <gui/components/cc_frm_clock.h>
|
||||||
#include <system/lastchannel.h>
|
#include <system/lastchannel.h>
|
||||||
|
|
||||||
#include <sectionsdclient/sectionsdclient.h>
|
#include <sectionsdclient/sectionsdclient.h>
|
||||||
@@ -76,8 +77,9 @@ private:
|
|||||||
std::string name;
|
std::string name;
|
||||||
ZapitChannelList chanlist;
|
ZapitChannelList chanlist;
|
||||||
CZapProtection* zapProtection;
|
CZapProtection* zapProtection;
|
||||||
CComponentsDetailLine *dline;
|
CComponentsDetailLine *dline;
|
||||||
|
CComponentsFrmClock *clock;
|
||||||
|
|
||||||
int full_width;
|
int full_width;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
Reference in New Issue
Block a user