mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CEpgData/CEventList: use class CNaviBar for bottom box
This commit is contained in:
@@ -873,66 +873,18 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
|||||||
showText(showPos, sy + toph);
|
showText(showPos, sy + toph);
|
||||||
|
|
||||||
// small bottom box with left/right navigation
|
// small bottom box with left/right navigation
|
||||||
if (!Bottombox){
|
if (!Bottombox)
|
||||||
Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight);
|
Bottombox = new CNaviBar(sx, sy+oy-botboxheight, ox, botboxheight);
|
||||||
Bottombox->setColorBody(COL_MENUFOOT_PLUS_0);
|
|
||||||
Bottombox->setCornerType(CORNER_NONE);
|
|
||||||
Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction);
|
|
||||||
Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mp_info){
|
if (!mp_info){
|
||||||
std::string fromto = epg_start + " - " + epg_end;
|
std::string fromto = epg_start + " - " + epg_end;
|
||||||
int x_off = OFFSET_INNER_MID;
|
|
||||||
int mid_width = ox * 40 / 100; // 40%
|
|
||||||
int side_width = ((ox - mid_width) / 2) - (2 * x_off);
|
|
||||||
|
|
||||||
GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit);
|
GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit);
|
||||||
|
|
||||||
// init left arrow
|
Bottombox->enableArrows(prev_id && !call_fromfollowlist, next_id && !call_fromfollowlist);
|
||||||
if (!lpic){
|
Bottombox->setText(fromto, epg_date);
|
||||||
lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT);
|
|
||||||
lpic->doPaintBg(false);
|
|
||||||
Bottombox->addCCItem(lpic);
|
|
||||||
lpic->enableSaveBg();
|
|
||||||
}
|
|
||||||
lpic->allowPaint(prev_id && !call_fromfollowlist);
|
|
||||||
|
|
||||||
// init right arrow
|
|
||||||
if (!rpic){
|
|
||||||
rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT);
|
|
||||||
|
|
||||||
rpic->doPaintBg(false);
|
|
||||||
Bottombox->addCCItem(rpic);
|
|
||||||
rpic->enableSaveBg();
|
|
||||||
int x_pos = ox - rpic->getWidth() - x_off;
|
|
||||||
rpic->setXPos(x_pos);
|
|
||||||
}
|
|
||||||
rpic->allowPaint(next_id && !call_fromfollowlist);
|
|
||||||
|
|
||||||
// init text left "from to"
|
|
||||||
if (!lText){
|
|
||||||
lText = new CComponentsText(x_off + lpic->getWidth() + x_off, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, NULL, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
|
|
||||||
lText->doPaintBg(false);
|
|
||||||
Bottombox->addCCItem(lText);
|
|
||||||
lText->enableSaveBg();
|
|
||||||
}
|
|
||||||
lText->setText(fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR);
|
|
||||||
|
|
||||||
// init text right "follow"
|
|
||||||
if (!rText){
|
|
||||||
rText = new CComponentsText(0, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
|
|
||||||
rText->doPaintBg(false);
|
|
||||||
rText->enableSaveBg();
|
|
||||||
}
|
|
||||||
rText->setText(epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]);
|
|
||||||
rText->setXPos(rpic->getXPos() - x_off - rText->getWidth());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ensure clean background
|
|
||||||
if(Bottombox->isPainted())
|
|
||||||
Bottombox->hideCCItems();
|
|
||||||
|
|
||||||
//paint bottombox contents
|
//paint bottombox contents
|
||||||
Bottombox->paint(false);
|
Bottombox->paint(false);
|
||||||
showProgressBar();
|
showProgressBar();
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#include <driver/movieinfo.h>
|
#include <driver/movieinfo.h>
|
||||||
#include "widget/menue.h"
|
#include "widget/menue.h"
|
||||||
|
#include "widget/navibar.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class CEpgData
|
|||||||
CChannelEventList followlist;
|
CChannelEventList followlist;
|
||||||
CEPGData epgData;
|
CEPGData epgData;
|
||||||
CComponentsHeader *header;
|
CComponentsHeader *header;
|
||||||
CComponentsFrmChain *Bottombox;
|
CNaviBar *Bottombox;
|
||||||
CComponentsPictureScalable *lpic, *rpic;
|
CComponentsPictureScalable *lpic, *rpic;
|
||||||
CComponentsText *lText, *rText;
|
CComponentsText *lText, *rText;
|
||||||
CProgressBar *pb;
|
CProgressBar *pb;
|
||||||
|
@@ -889,44 +889,14 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s
|
|||||||
void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next)
|
void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next)
|
||||||
{
|
{
|
||||||
int by = y + height - iheight - botboxheight;
|
int by = y + height - iheight - botboxheight;
|
||||||
int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE;
|
|
||||||
int x_off = OFFSET_INNER_MID;
|
|
||||||
int mid_width = full_width * 40 / 100; // 40%
|
|
||||||
int side_width = ((full_width - mid_width) / 2) - (2 * x_off);
|
|
||||||
|
|
||||||
if (!Bottombox){
|
if (!Bottombox){
|
||||||
Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight);
|
Bottombox = new CNaviBar(x, by, full_width, botboxheight);
|
||||||
Bottombox->setColorBody(COL_MENUFOOT_PLUS_0);
|
Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]);
|
||||||
Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction);
|
|
||||||
Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0);
|
|
||||||
}else{
|
|
||||||
if (Bottombox->isPainted())
|
|
||||||
Bottombox->hideCCItems();
|
|
||||||
Bottombox->clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_channelname_prev.empty()) {
|
Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty());
|
||||||
CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox);
|
Bottombox->setText(_channelname_prev, _channelname_next);
|
||||||
lpic->doPaintBg(false);
|
|
||||||
lpic->enableSaveBg();
|
|
||||||
|
|
||||||
CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
|
|
||||||
lText->doPaintBg(false);
|
|
||||||
lText->enableSaveBg();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_channelname_next.empty()) {
|
|
||||||
CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox);
|
|
||||||
int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID;
|
|
||||||
rpic->doPaintBg(false);
|
|
||||||
rpic->setXPos(x_pos);
|
|
||||||
rpic->enableSaveBg();
|
|
||||||
|
|
||||||
CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT);
|
|
||||||
rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth());
|
|
||||||
rText->doPaintBg(false);
|
|
||||||
rText->enableSaveBg();
|
|
||||||
}
|
|
||||||
|
|
||||||
Bottombox->paint(false);
|
Bottombox->paint(false);
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include <driver/rcinput.h>
|
#include <driver/rcinput.h>
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
#include <gui/components/cc.h>
|
#include <gui/components/cc.h>
|
||||||
|
#include <gui/widget/navibar.h>
|
||||||
#include "infoviewer.h"
|
#include "infoviewer.h"
|
||||||
|
|
||||||
#include "widget/menue.h"
|
#include "widget/menue.h"
|
||||||
@@ -104,8 +104,8 @@ class CEventList : public CListHelpers
|
|||||||
event_id_t item_event_ID;
|
event_id_t item_event_ID;
|
||||||
CComponentsText *cc_infozone;
|
CComponentsText *cc_infozone;
|
||||||
CComponentsHeader *header;
|
CComponentsHeader *header;
|
||||||
CProgressBar *pb;
|
CProgressBar *pb;
|
||||||
CComponentsFrmChain *Bottombox;
|
CNaviBar *Bottombox;
|
||||||
const char * unit_short_minute;
|
const char * unit_short_minute;
|
||||||
|
|
||||||
void paintItem(unsigned pos, t_channel_id channel_id = 0);
|
void paintItem(unsigned pos, t_channel_id channel_id = 0);
|
||||||
|
Reference in New Issue
Block a user