mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
- infoviewer: some more little numbox-alignments
This commit is contained in:
@@ -110,6 +110,7 @@ CInfoViewer::CInfoViewer ()
|
|||||||
ChanNameY = 0;
|
ChanNameY = 0;
|
||||||
ChanWidth = 0;
|
ChanWidth = 0;
|
||||||
ChanHeight = 0;
|
ChanHeight = 0;
|
||||||
|
numbox_offset = 0;
|
||||||
time_width = 0;
|
time_width = 0;
|
||||||
time_height = header_height = 0;
|
time_height = header_height = 0;
|
||||||
lastsnr = 0;
|
lastsnr = 0;
|
||||||
@@ -200,6 +201,7 @@ void CInfoViewer::start ()
|
|||||||
ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/* * 9/8*/;
|
ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/* * 9/8*/;
|
||||||
ChanHeight += g_SignalFont->getHeight()/2;
|
ChanHeight += g_SignalFont->getHeight()/2;
|
||||||
ChanHeight = max(75, ChanHeight);
|
ChanHeight = max(75, ChanHeight);
|
||||||
|
numbox_offset = 3;
|
||||||
|
|
||||||
BoxStartX = g_settings.screen_StartX + 10;
|
BoxStartX = g_settings.screen_StartX + 10;
|
||||||
BoxEndX = g_settings.screen_EndX - 10;
|
BoxEndX = g_settings.screen_EndX - 10;
|
||||||
@@ -744,13 +746,12 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
|
|||||||
logo_ok = ( g_settings.infobar_show_channellogo != 0 && ChannelLogoMode != 0);
|
logo_ok = ( g_settings.infobar_show_channellogo != 0 && ChannelLogoMode != 0);
|
||||||
fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_settings.infobar_show_channellogo, ChannelLogoMode, logo_ok);
|
fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_settings.infobar_show_channellogo, ChannelLogoMode, logo_ok);
|
||||||
|
|
||||||
int ChanNumYPos = BoxStartY + ChanHeight;
|
|
||||||
if (g_settings.infobar_sat_display) {
|
if (g_settings.infobar_sat_display) {
|
||||||
std::string name = (IS_WEBTV(current_channel_id))? "WebTV" : CServiceManager::getInstance()->GetSatelliteName(satellitePosition);
|
std::string name = (IS_WEBTV(current_channel_id))? "WebTV" : CServiceManager::getInstance()->GetSatelliteName(satellitePosition);
|
||||||
int satNameWidth = g_SignalFont->getRenderWidth (name);
|
int satNameWidth = g_SignalFont->getRenderWidth (name);
|
||||||
std::string satname_tmp = name;
|
std::string satname_tmp = name;
|
||||||
if (satNameWidth > (ChanWidth - 4)) {
|
if (satNameWidth > (ChanWidth - numbox_offset*2)) {
|
||||||
satNameWidth = ChanWidth - 4;
|
satNameWidth = ChanWidth - numbox_offset*2;
|
||||||
size_t pos1 = name.find("(") ;
|
size_t pos1 = name.find("(") ;
|
||||||
size_t pos2 = name.find_last_of(")");
|
size_t pos2 = name.find_last_of(")");
|
||||||
size_t pos0 = name.find(" ") ;
|
size_t pos0 = name.find(" ") ;
|
||||||
@@ -764,13 +765,12 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
|
|||||||
satname_tmp +=" ";
|
satname_tmp +=" ";
|
||||||
satname_tmp += name.substr( pos1,pos2-pos1 );
|
satname_tmp += name.substr( pos1,pos2-pos1 );
|
||||||
satNameWidth = g_SignalFont->getRenderWidth (satname_tmp);
|
satNameWidth = g_SignalFont->getRenderWidth (satname_tmp);
|
||||||
if (satNameWidth > (ChanWidth - 4))
|
if (satNameWidth > (ChanWidth - numbox_offset*2))
|
||||||
satNameWidth = ChanWidth - 4;
|
satNameWidth = ChanWidth - numbox_offset*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int chanH = g_SignalFont->getHeight ();
|
int h_sfont = g_SignalFont->getHeight();
|
||||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + chanH, satNameWidth, satname_tmp, COL_INFOBAR_TEXT);
|
g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT);
|
||||||
ChanNumYPos += 10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: the logic will get much easier once we decouple channellogo and signal bars */
|
/* TODO: the logic will get much easier once we decouple channellogo and signal bars */
|
||||||
@@ -785,9 +785,9 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap
|
|||||||
y_tmp += h_sfont;
|
y_tmp += h_sfont;
|
||||||
}
|
}
|
||||||
y_tmp += h_tmp/2 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2;
|
y_tmp += h_tmp/2 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2;
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2,
|
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + numbox_offset + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2,
|
||||||
y_tmp,
|
y_tmp,
|
||||||
ChanWidth,
|
ChanWidth - 2*numbox_offset,
|
||||||
strChanNum,
|
strChanNum,
|
||||||
col_NumBoxText);
|
col_NumBoxText);
|
||||||
}
|
}
|
||||||
@@ -1496,7 +1496,9 @@ void CInfoViewer::showSNR ()
|
|||||||
/* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc.
|
/* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc.
|
||||||
TODO: decouple this */
|
TODO: decouple this */
|
||||||
if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) {
|
if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) {
|
||||||
int chanH = g_SignalFont->getHeight();
|
int y_freq = 2*g_SignalFont->getHeight();
|
||||||
|
if (!g_settings.infobar_sat_display)
|
||||||
|
y_freq -= g_SignalFont->getHeight()/2; //half line up to center freq vertically
|
||||||
int y_numbox = numbox->getYPos();
|
int y_numbox = numbox->getYPos();
|
||||||
if ((newfreq && chanready) || SDT_freq_update) {
|
if ((newfreq && chanready) || SDT_freq_update) {
|
||||||
char freq[20];
|
char freq[20];
|
||||||
@@ -1510,13 +1512,15 @@ void CInfoViewer::showSNR ()
|
|||||||
int frequency = CFEManager::getInstance()->getLiveFE()->getFrequency();
|
int frequency = CFEManager::getInstance()->getLiveFE()->getFrequency();
|
||||||
snprintf (freq, sizeof(freq), "%d.%d MHz %s", frequency / 1000, frequency % 1000, polarisation.c_str());
|
snprintf (freq, sizeof(freq), "%d.%d MHz %s", frequency / 1000, frequency % 1000, polarisation.c_str());
|
||||||
|
|
||||||
int satNameWidth = g_SignalFont->getRenderWidth (freq);
|
int freqWidth = g_SignalFont->getRenderWidth(freq);
|
||||||
g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), y_numbox + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT);
|
if (freqWidth > (ChanWidth - numbox_offset*2))
|
||||||
|
freqWidth = ChanWidth - numbox_offset*2;
|
||||||
|
g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT);
|
||||||
SDT_freq_update = false;
|
SDT_freq_update = false;
|
||||||
}
|
}
|
||||||
if (sigbox == NULL){
|
if (sigbox == NULL){
|
||||||
int sb_x = ChanWidth *10/100;
|
int sigbox_offset = ChanWidth *10/100;
|
||||||
sigbox = new CSignalBox(BoxStartX+sb_x, y_numbox+ChanHeight/2, ChanWidth-2*sb_x, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
||||||
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
||||||
sigbox->doPaintBg(false);
|
sigbox->doPaintBg(false);
|
||||||
}
|
}
|
||||||
|
@@ -80,6 +80,7 @@ class CInfoViewer
|
|||||||
int ChanNameY;
|
int ChanNameY;
|
||||||
int ChanWidth;
|
int ChanWidth;
|
||||||
int ChanHeight;
|
int ChanHeight;
|
||||||
|
int numbox_offset;
|
||||||
|
|
||||||
CSectionsdClient::CurrentNextInfo info_CurrentNext;
|
CSectionsdClient::CurrentNextInfo info_CurrentNext;
|
||||||
CSectionsdClient::CurrentNextInfo oldinfo;
|
CSectionsdClient::CurrentNextInfo oldinfo;
|
||||||
|
Reference in New Issue
Block a user