diff --git a/data/locale/english.locale b/data/locale/english.locale index 3a87184e2..d4ff35319 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1354,6 +1354,7 @@ motorcontrol.no_mode don't care motorcontrol.msec milliseconds motorcontrol.status Status motorcontrol.sat_pos Satellite Position (Step Mode): +motorcontrol.override Override position used for mainsettings.timezone Timezone scrambled_channel Scrambled channel neutrino_starting Neutrino starting... diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index b36cf8ef2..dff5288b1 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -29,7 +29,7 @@ static int sub_pid, sub_page; static bool use_gui; static int cfg_national_subset; -#define USE_FBPAN // FBIOPAN_DISPLAY seems to be working in current driver +//#define USE_FBPAN // FBIOPAN_DISPLAY seems to be working in current driver void FillRect(int x, int y, int w, int h, int color) { @@ -2007,7 +2007,6 @@ int Init() aydrcs[i1] = (fontheight * i1 + 5) / 10; } - //FIXME center /* center screen */ StartX = sx; //+ (((ex-sx) - 40*fontwidth) / 2); StartY = sy + (((ey-sy) - 25*fontheight) / 2); @@ -2202,7 +2201,8 @@ void CleanUp() cleanup_fb_pan(); #endif //memset(lfb,0, var_screeninfo.yres*fix_screeninfo.line_length); - CFrameBuffer::getInstance()->paintBackground(); + //CFrameBuffer::getInstance()->paintBackground(); + ClearFB(transp); #if 0 /* close freetype */ @@ -5526,6 +5526,7 @@ void CopyBB2FB() else var_screeninfo.yoffset = var_screeninfo.yres; + //FIXME check zoom mode code if (ioctl(fb, FBIOPAN_DISPLAY, &var_screeninfo) == -1) perror("TuxTxt "); #else diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index d99e4204a..385f8f84b 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -826,13 +826,17 @@ void CFrameBuffer::getIconSize(const char * const filename, int* width, int *hei /* if code ask for size, lets cache it. assume we have enough ram for cache */ /* FIXME offset seems never used in code, always default = 1 ? */ - if(paintIcon(filename, 0, 0, 0, 1, false)) { - it = icon_cache.find(filename); - if(it != icon_cache.end()) { - *width = it->second.width; - *height = it->second.height; + + it = icon_cache.find(filename); + if(it == icon_cache.end()) { + if(paintIcon(filename, 0, 0, 0, 1, false)) { + it = icon_cache.find(filename); } } + if(it != icon_cache.end()) { + *width = it->second.width; + *height = it->second.height; + } } bool CFrameBuffer::paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset) @@ -946,8 +950,6 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in icon_cache.insert(std::pair (filename, tmpIcon)); //printf("Cached %s, cache size %d\n", newname.c_str(), cache_size); } - if(!paint) - return true; goto _display; } @@ -1003,10 +1005,10 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in height = it->second.height; //printf("paintIcon: already cached %s %d x %d\n", newname.c_str(), width, height); } +_display: if(!paint) return true; -_display: if (h != 0) yy += (h - height) / 2; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4d4ee9570..4335ac8ee 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -54,6 +54,8 @@ #include #include #include + +#define ENABLE_GUI_MOUNT #ifdef ENABLE_GUI_MOUNT #include #endif @@ -268,9 +270,14 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &) m_height = (g_settings.screen_EndY - g_settings.screen_StartY - 5); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - m_buttonHeight = std::min(25, m_sheight); + m_buttonHeight = std::max(25, m_sheight); m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + + int iw, ih; + m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih); + m_theight = std::max(m_theight, ih+4); + m_title_height = m_fheight*2 + 20 + m_sheight + 4; m_info_height = m_fheight*2; m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); @@ -1599,25 +1606,40 @@ void CAudioPlayerGui::paintHead() strCaption = g_Locale->getText(LOCALE_INETRADIO_NAME); else strCaption = g_Locale->getText(LOCALE_AUDIOPLAYER_HEAD); + m_frameBuffer->paintBoxRel(m_x, m_y + m_title_height, m_width, m_theight, COL_MENUHEAD_PLUS_0, c_rad_mid, CORNER_TOP); - m_frameBuffer->paintIcon(NEUTRINO_ICON_MP3,m_x + 7, m_y + m_title_height + 10); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 35, m_y + m_theight + m_title_height + 0, - m_width - 45, strCaption, COL_MENUHEAD, 0, true); // UTF-8 + + //m_frameBuffer->paintIcon(NEUTRINO_ICON_MP3,m_x + 7, m_y + m_title_height + 10); + int iw, ih; + m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih); + m_frameBuffer->paintIcon(NEUTRINO_ICON_MP3, m_x + 10, m_y + m_title_height, m_theight); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 20 + iw, m_y + m_theight + m_title_height + 0, + m_width - 20 - iw, strCaption, COL_MENUHEAD, 0, true); // UTF-8 int ypos = m_y + m_title_height; - if (m_theight > 26) - ypos = (m_theight - 26) / 2 + m_y + m_title_height; + //if (m_theight > 26) + // ypos = (m_theight - 26) / 2 + m_y + m_title_height; + int xpos = m_x + m_width - 10; + #ifdef ENABLE_GUI_MOUNT - if (!m_inetmode) - m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_x + m_width - 30, ypos); + if (!m_inetmode) { + m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iw, &ih); + m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, xpos - iw, ypos, m_theight); + xpos -= (iw + 10); + } + //m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_x + m_width - 30, ypos); #endif #if 1 if ( CNeutrinoApp::getInstance()->isMuted() ) { +#if 0 int xpos = m_x + m_width - 75; ypos = m_y + m_title_height; if (m_theight > 32) ypos = (m_theight - 32) / 2 + m_y + m_title_height; m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos, ypos); +#endif + m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih); + m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos - iw, ypos, m_theight); } #endif } diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 8a103368a..c87e2171f 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -51,16 +51,29 @@ #include extern CBouquetManager *g_bouquetManager; - CBEBouquetWidget::CBEBouquetWidget() { + int icol_w, icol_h; frameBuffer = CFrameBuffer::getInstance(); + iconoffset = 0; ButtonHeight = 25; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h+2); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icol_w, &icol_h); + iheight = std::max(iheight, icol_h+2); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_HIDDEN, &icol_w, &icol_h); + iheight = std::max(iheight, icol_h+2); + iconoffset = std::max(iconoffset, icol_w); + selected = 0; liststart = 0; state = beDefault; @@ -72,35 +85,35 @@ void CBEBouquetWidget::paintItem(int pos) { uint8_t color; fb_pixel_t bgcolor; - int ypos = y+ theight+0 + pos*fheight; + int ypos = y+ theight+0 + pos*iheight; unsigned int current = liststart + pos; if (current == selected) { color = COL_MENUCONTENTSELECTED; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); } else { bool has_channels = true; if(current < Bouquets->size()) has_channels = ((*Bouquets)[current]->tvChannels.size() > 0) || ((*Bouquets)[current]->radioChannels.size() > 0); color = has_channels ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); } if(current < Bouquets->size()) { if ((current == selected) && (state == beMoving)) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 8, ypos+4); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 10, ypos, iheight); if ((*Bouquets)[current]->bLocked) - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 7, ypos); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 10, ypos, iheight); if ((*Bouquets)[current]->bHidden) - frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + 37, ypos); + frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + 10, ypos, iheight); //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+68, ypos+ fheight, width-68, (*Bouquets)[current]->Name, color, 0, true); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+68, ypos+ fheight, width-68, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+iconoffset+20, ypos + iheight - (iheight-fheight)/2, width-iconoffset-20, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color, 0, true); } } @@ -114,7 +127,7 @@ void CBEBouquetWidget::paint() } int ypos = y+ theight; - int sb = fheight* listmaxshow; + int sb = iheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1; @@ -139,12 +152,21 @@ const struct button_label CBEBouquetWidgetButtons[3] = void CBEBouquetWidget::paintFoot() { + int icol_w, icol_h, h2, fh; struct button_label Button[4]; + Button[0] = CBEBouquetWidgetButtons[0]; Button[1] = CBEBouquetWidgetButtons[1]; Button[2] = CBEBouquetWidgetButtons[2]; Button[3].button = NEUTRINO_ICON_BUTTON_BLUE; + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + ButtonHeight = std::max(fh, icol_h+4); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &icol_w, &h2); + ButtonHeight = std::max(ButtonHeight, h2+4); + frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); @@ -160,8 +182,9 @@ void CBEBouquetWidget::paintFoot() Button[3].locale = LOCALE_BOUQUETEDITOR_LOCK; break; } - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, y + height + 4, (width - 28 - 10) / 4, 4, Button); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+width - 28, y+height); + //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, y + height + 4, (width - 28 - 10) / 4, 4, Button); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, (width - icol_w - 20) / 4, ButtonHeight, 4, Button); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x + width - 10 - icol_w, y + height, ButtonHeight); } void CBEBouquetWidget::hide() @@ -181,8 +204,8 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* width = w_max (500, 0); height = h_max (440, 50); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height-theight-0)/iheight; + height = theight+0+listmaxshow*iheight; // recalc height x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; @@ -253,10 +276,19 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* step = (msg == (neutrino_msg_t)g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 selected -= step; + + if((prev_selected-step) < 0) { + if(prev_selected != 0 && step != 1) + selected = 0; + else + selected = Bouquets->size() - 1; + } +#if 0 if((prev_selected-step) < 0) // because of uint { selected = Bouquets->size()-1; } +#endif if (state == beDefault) { @@ -281,11 +313,20 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* else if (msg==CRCInput::RC_down || msg==(neutrino_msg_t)g_settings.key_channelList_pagedown) { unsigned int step = 0; - int prev_selected = selected; + unsigned int prev_selected = selected; step = (msg == (neutrino_msg_t)g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 selected += step; + if(selected >= Bouquets->size()) { + if((Bouquets->size() - listmaxshow -1 < prev_selected) && (prev_selected != (Bouquets->size() - 1)) && (step != 1)) + selected = Bouquets->size() - 1; + else if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries + selected = 0; + else + selected = ((step == listmaxshow) && (selected < (((Bouquets->size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets->size() - 1) : 0; + } +#if 0 if(selected >= Bouquets->size()) { if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries @@ -293,7 +334,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* else selected = ((step == listmaxshow) && (selected < (((Bouquets->size() / listmaxshow) + 1) * listmaxshow))) ? (Bouquets->size() - 1) : 0; } - +#endif if (state == beDefault) { paintItem(prev_selected - liststart); diff --git a/src/gui/bedit/bouqueteditor_bouquets.h b/src/gui/bedit/bouqueteditor_bouquets.h index 4a0cd2ac4..163acd610 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.h +++ b/src/gui/bedit/bouqueteditor_bouquets.h @@ -77,10 +77,12 @@ class CBEBouquetWidget : public CMenuWidget unsigned int liststart; unsigned int listmaxshow; - int fheight; // Fonthoehe Bouquetlist-Inhalt - int theight; // Fonthoehe Bouquetlist-Titel + int fheight; // Fonthoehe Bouquetlist-Inhalt + int theight; // Fonthoehe Bouquetlist-Titel - int ButtonHeight; + int ButtonHeight; + int iconoffset; + int iheight; // item height //std::string name; bool bouquetsChanged; int width; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 98a557f4a..cb4976ba8 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -54,13 +54,20 @@ extern CBouquetManager *g_bouquetManager; CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bouquet) { + int icol_w, icol_h; frameBuffer = CFrameBuffer::getInstance(); selected = 0; ButtonHeight = 25; + iconoffset = 0; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h+2); + + iconoffset = std::max(iconoffset, icol_w); + liststart = 0; state = beDefault; caption = Caption; @@ -72,27 +79,29 @@ void CBEChannelWidget::paintItem(int pos) { uint8_t color; fb_pixel_t bgcolor; - int ypos = y+ theight+0 + pos*fheight; + int ypos = y+ theight+0 + pos*iheight; unsigned int current = liststart + pos; if(current == selected) { color = COL_MENUCONTENTSELECTED; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); } else { color = COL_MENUCONTENT; bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); } if ((current == selected) && (state == beMoving)) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 8, ypos+4); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 10, ypos, iheight); } if(current < Channels->size()) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color, 0, true); + //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color, 0, true); + //FIXME numwidth ? we not show chan numbers + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width- iconoffset- 20, (*Channels)[current]->getName(), color, 0, true); } } @@ -118,7 +127,7 @@ void CBEChannelWidget::paint() } int ypos = y+ theight; - int sb = fheight* listmaxshow; + int sb = iheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1; @@ -144,10 +153,17 @@ const struct button_label CBEChannelWidgetButtons[4] = void CBEChannelWidget::paintFoot() { + int icol_w, icol_h, fh; + + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + ButtonHeight = std::max(fh, icol_h+4); + frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height + 4, (width - 20) / 4, 4, CBEChannelWidgetButtons); + //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height + 4, (width - 20) / 4, 4, CBEChannelWidgetButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, (width - 20) / 4, ButtonHeight, 4, CBEChannelWidgetButtons); } void CBEChannelWidget::hide() @@ -168,8 +184,8 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* width = w_max (500, 0); height = h_max (440, 50); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height-theight-0)/iheight; + height = theight+0+listmaxshow*iheight; // recalc height x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index 8dbc27f53..93e577cc4 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -62,12 +62,14 @@ class CBEChannelWidget : public CMenuWidget unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; - int fheight; - int theight; + int fheight; + int theight; + int iconoffset; + int iheight; // item height - int ButtonHeight; - std::string caption; - bool channelsChanged; + int ButtonHeight; + std::string caption; + bool channelsChanged; CZapitClient::channelsMode mode; diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index e0f900307..db42c5033 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -53,13 +54,26 @@ void addChannelToBouquet(const unsigned int bouquet, const t_channel_id channel_ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsigned int Bouquet, CZapitClient::channelsMode Mode) :CListBox(Caption.c_str()) { + int icol_w, icol_h, fh; + bouquet = Bouquet; mode = Mode; ButtonHeight = 25; + iconoffset = 0; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_GREEN, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h+2); + iconoffset = std::max(iconoffset, icol_w); + + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &icol_w, &icol_h); + ButtonHeight = std::max(fh, icol_h+4); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HOME, &icol_w, &icol_h); + ButtonHeight = std::max(ButtonHeight, icol_h+4); + liststart = 0; } @@ -85,7 +99,7 @@ bool CBEChannelSelectWidget::hasChanged() void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselected) { - int ypos = y+ theight + paintNr*fheight; + int ypos = y+ theight + paintNr*iheight; uint8_t color; fb_pixel_t bgcolor; @@ -93,29 +107,29 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec { color = COL_MENUCONTENTSELECTED; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); } else { color = COL_MENUCONTENT; bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); } - if(itemNr < getItemCount()) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8, ypos+ fheight, width - (8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8 + 8), Channels[itemNr]->getName(), color, 0, true); - if( isChannelInBouquet(itemNr)) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+8, ypos+4); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+10, ypos, iheight); } else { - frameBuffer->paintBoxRel(x+8, ypos+4, NEUTRINO_ICON_BUTTON_GREEN_WIDTH, fheight-4, bgcolor); + //frameBuffer->paintBoxRel(x+8, ypos+4, NEUTRINO_ICON_BUTTON_GREEN_WIDTH, fheight-4, bgcolor); + frameBuffer->paintBoxRel(x+10, ypos, iconoffset, iheight, bgcolor); } + //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8, ypos+ fheight, width - (8 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 8 + 8), Channels[itemNr]->getName(), color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width - 20 - iconoffset, Channels[itemNr]->getName(), color, 0, true); } } @@ -137,8 +151,8 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action { width = w_max (500, 0); height = h_max (440, 50); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height-theight-0)/iheight; + height = theight+0+listmaxshow*iheight; // recalc height x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; @@ -151,7 +165,7 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action Channels.push_back(&(it->second)); } else { for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) - if (it->second.getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE) + if (it->second.getServiceType() == ST_DIGITAL_TELEVISION_SERVICE) Channels.push_back(&(it->second)); } sort(Channels.begin(), Channels.end(), CmpChannelByChName()); @@ -159,16 +173,25 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action return CListBox::exec(parent, actionKey); } +const struct button_label CBEChannelSelectButtons[] = +{ + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_BOUQUETEDITOR_SWITCH }, + { NEUTRINO_ICON_BUTTON_HOME, LOCALE_BOUQUETEDITOR_RETURN } +}; void CBEChannelSelectWidget::paintFoot() { - int ButtonWidth = width / 3; - frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + int ButtonWidth = (width - 20) / 2; + frameBuffer->paintBoxRel(x, y+height, width, ButtonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, ButtonWidth, ButtonHeight, 2, CBEChannelSelectButtons); + +#if 0 frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 3* ButtonWidth+ 8, y+height+1); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR, 0, true); // UTF-8 frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_RETURN), COL_INFOBAR, 0, true); // UTF-8 +#endif } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index edc610d04..c30a297e5 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -297,7 +297,12 @@ int CBouquetList::show(bool bShowChannelList) width = w_max (500, 0); height = h_max (440, 40); - buttonHeight = 7 + std::min(16, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + /* assuming all color icons must have same size */ + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + + //buttonHeight = 7 + std::max(icol_h+2, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + buttonHeight = std::max(icol_h+4, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); listmaxshow = (height - theight - buttonHeight)/fheight; @@ -569,7 +574,10 @@ void CBouquetList::paint() int ButtonWidth = (width - 20) / 4; frameBuffer->paintBoxRel(x, y + (height - buttonHeight), width, buttonHeight - 1, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - buttonHeight) + 3, ButtonWidth, sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]), CBouquetListButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, + /*y + (height - buttonHeight) + 3, ButtonWidth, */ + y + (height - buttonHeight), ButtonWidth, buttonHeight, + sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]), CBouquetListButtons); if(Bouquets.size()) { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 9b35563df..875df3829 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -459,32 +459,43 @@ int CChannelList::show() bool actzap = 0; int res = -1; - new_mode_active = 0; - pipzap = 0; - - //width = w_max (560, 0); - //height = h_max (420 + (1+3+16+3), 60); - //width = w_max (((g_settings.channellist_extended)?720:660), 0); - //height = h_max (450, 60); - width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * 15):(frameBuffer->getScreenWidth() / 20 * 14)), 0); - height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); - if (chanlist.empty()) { return res; } + + new_mode_active = 0; + pipzap = 0; + + width = w_max (((g_settings.channellist_extended)?(frameBuffer->getScreenWidth() / 20 * 15):(frameBuffer->getScreenWidth() / 20 * 14)), 0); + height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2)); + CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, name.c_str()); - buttonHeight = 7 + std::min(16, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + /* assuming all color icons must have same size */ + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + //buttonHeight = 7 + std::max(icol_h+2, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + buttonHeight = std::max(icol_h+4, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - if(theight < PIC_H) theight = PIC_H; + theight = std::max(theight, PIC_H); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &icol_w, &icol_h); + theight = std::max(theight, icol_h); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); if (fheight == 0) fheight = 1; /* avoid crash on invalid font */ + listmaxshow = (height - theight - buttonHeight -0)/fheight; height = theight + buttonHeight + listmaxshow * fheight; - //info_height = fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; @@ -526,6 +537,7 @@ int CChannelList::show() } paintHead(); paint(); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } else if (msg == CRCInput::RC_blue && ( bouquetList != NULL ) ) { //FIXME bShowBouquetList = true; @@ -547,6 +559,7 @@ int CChannelList::show() paintHead(); paint(); } + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } else if (msg == (neutrino_msg_t) g_settings.key_list_start) { @@ -568,10 +581,6 @@ int CChannelList::show() step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 selected -= step; -#if 0 - if((prev_selected-step) < 0) // because of uint - selected = chanlist.size() - 1; -#endif if((prev_selected-step) < 0) { if(prev_selected != 0 && step != 1) selected = 0; @@ -599,14 +608,6 @@ int CChannelList::show() step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 selected += step; -#if 0 - if(selected >= chanlist.size()) { - if (((chanlist.size() / listmaxshow) + 1) * listmaxshow == chanlist.size() + listmaxshow) // last page has full entries - selected = 0; - else - selected = ((step == listmaxshow) && (selected < (((chanlist.size() / listmaxshow)+1) * listmaxshow))) ? (chanlist.size() - 1) : 0; - } -#endif if(selected >= chanlist.size()) { if((chanlist.size() - listmaxshow -1 < prev_selected) && (prev_selected != (chanlist.size() - 1)) && (step != 1)) selected = chanlist.size() - 1; @@ -1535,11 +1536,11 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/) void CChannelList::showChannelLogo() { - frameBuffer->paintBoxRel(x + width - timestr_len - PIC_W - icons_width, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x + width - logo_off - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0); std::string lname; if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname)) - g_PicViewer->DisplayImage(lname, x + width - timestr_len - PIC_W - icons_width, y+(theight-PIC_H)/2, PIC_W, PIC_H); + g_PicViewer->DisplayImage(lname, x + width - logo_off - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H); } void CChannelList::paintItem(int pos) @@ -1559,39 +1560,12 @@ void CChannelList::paintItem(int pos) bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; paintItem2DetailsLine (pos, curr); paintDetails(curr); - -#if 0 - frameBuffer->paintBoxRel(x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H, COL_MENUHEAD_PLUS_0); - - std::string lname; - if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->name, lname)) - g_PicViewer->DisplayImage(lname, x + width - 100 - PIC_W, y+(theight-PIC_H)/2, PIC_W, PIC_H); -#endif frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); } else { color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE; bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, 0); } -#if 0 - if(curr < chanlist.size()) { - CZapitChannel* chan = chanlist[liststart+pos]; - char tmp[10]; - sprintf((char*) tmp, "%d", this->historyMode ? pos : chan->number); - int numpos = x+5+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); - char nameAndDescription[255]; - if (!(chan->currentEvent.description.empty())) { - snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s", - chan->name.c_str(), chan->currentEvent.description.c_str()); - } else { - snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->name.c_str()); - } - if (curr == selected) - CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, nameAndDescription, color, 0, true); - } -#else if(curr < chanlist.size()) { char nameAndDescription[255]; char tmp[10]; @@ -1603,7 +1577,7 @@ void CChannelList::paintItem(int pos) if(g_settings.channellist_extended) { - prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); + prg_offset=42; title_offset=6; } @@ -1617,7 +1591,7 @@ void CChannelList::paintItem(int pos) } if(chan->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos + (fheight - 16)/2); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight);//ypos + (fheight - 16)/2); int numpos = x+5+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); @@ -1632,7 +1606,8 @@ void CChannelList::paintItem(int pos) int pb_space = prg_offset - title_offset; int pb_max = pb_space - 4; if (!(p_event->description.empty())) { - snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); + if(!g_settings.channellist_epgtext_align_right) + snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l," - "); unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription, true); unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description, true); @@ -1715,7 +1690,6 @@ void CChannelList::paintItem(int pos) CVFD::getInstance()->showMenuText(0, chan->name.c_str(), -1, true); // UTF-8 } } -#endif } #define NUM_LIST_BUTTONS 3 @@ -1728,35 +1702,44 @@ struct button_label CChannelListButtons[NUM_LIST_BUTTONS] = void CChannelList::paintHead() { + int timestr_len = 0; char timestr[10] = {0}; time_t now = time(NULL); struct tm *tm = localtime(&now); bool gotTime = g_Sectionsd->getIsTimeSet(); - int dx = 0, dy = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP,&dx,&dy); - icons_width = dx; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX,&dx,&dy); - icons_width += dx; - icons_width += dx/2; - timestr_len = 0; if(gotTime){ strftime(timestr, 10, "%H:%M", tm); timestr_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(timestr, true); // UTF-8 } + int iw1, iw2, iw3, ih = 0; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iw1, &ih); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iw2, &ih); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, &iw3, &ih); + // head frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width-10-timestr_len-10, name, COL_MENUHEAD, 0, true); // UTF-8 + + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - iw1 - 4, y, theight); //y+ 5 ); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button + frameBuffer->paintIcon(new_mode_active ? + NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, + x + width - iw1 - iw2 - iw3 - 12, y, theight); - int ButtonWidth = (width - 20) / 4; - - if (gotTime){ - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+width-icons_width-timestr_len, y+theight+0, timestr_len+1, timestr, COL_MENUHEAD, 0, true); // UTF-8 + if (gotTime) { + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3 - 16 -timestr_len, + y+theight, timestr_len+1, timestr, COL_MENUHEAD, 0, true); // UTF-8 + timestr_len += 4; } + timestr_len += iw1 + iw2 + iw3 + 16; + logo_off = timestr_len + 4; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 // foot + int ButtonWidth = (width - 20) / NUM_LIST_BUTTONS; + if (displayNext) { CChannelListButtons[1].locale = LOCALE_INFOVIEWER_NOW; } else { @@ -1764,14 +1747,9 @@ void CChannelList::paintHead() } frameBuffer->paintBoxRel(x, y + (height - buttonHeight), width, buttonHeight - 1, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - buttonHeight) + 3, ButtonWidth, + //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - buttonHeight) + 3, ButtonWidth, + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - buttonHeight), ButtonWidth, buttonHeight, NUM_LIST_BUTTONS, CChannelListButtons); - - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- icons_width/2, y+ 5 ); - if (bouquetList != NULL){ - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x + width - icons_width, y + 5); // icon for bouquet list button - } -// frameBuffer->paintIcon(new_mode_active ? NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE, x + width - 90, y + 5); } void CChannelList::paint() diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 9a9a98e64..619908528 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -73,9 +73,8 @@ class CChannelList int height; int x; int y; + int logo_off; - int timestr_len; - int icons_width; bool historyMode; bool vlist; // "virtual" list, not bouquet bool displayNext; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 9ec23dab8..19a04bbdb 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -410,12 +410,13 @@ Font *EpgPlus::Footer::fontEventShortDescription = NULL; Font *EpgPlus::Footer::fontButtons = NULL; int EpgPlus::Footer::color = 0; -EpgPlus::Footer::Footer (CFrameBuffer * pframeBuffer, int px, int py, int pwidth) +EpgPlus::Footer::Footer (CFrameBuffer * pframeBuffer, int px, int py, int pwidth, int height) { this->frameBuffer = pframeBuffer; this->x = px; this->y = py; this->width = pwidth; + this->buttonHeight = height; } EpgPlus::Footer::~Footer () @@ -438,8 +439,9 @@ void EpgPlus::Footer::setBouquetChannelName (const std::string & newBouquetName, int EpgPlus::Footer::getUsedHeight () { + return fontBouquetChannelName->getHeight () + fontEventDescription->getHeight () - + fontEventShortDescription->getHeight () + fontButtons->getHeight (); + + fontEventShortDescription->getHeight () /* + fontButtons->getHeight ()*/; } void EpgPlus::Footer::paintEventDetails (const std::string & description, const std::string & shortDescription) @@ -486,17 +488,17 @@ struct button_label buttonLabels[] = { void EpgPlus::Footer::paintButtons (button_label * pbuttonLabels, int numberOfButtons) { - int yPos = this->y + this->getUsedHeight () - this->fontButtons->getHeight (); - int buttonWidth = (this->width - 20) / 4; + int yPos = this->y + this->getUsedHeight (); - int buttonHeight = 7 + std::min (16, this->fontButtons->getHeight ()); + this->frameBuffer->paintBoxRel (this->x, yPos, this->width, buttonHeight, COL_MENUHEAD_PLUS_0); - this->frameBuffer->paintBoxRel (this->x, yPos, this->width, this->fontButtons->getHeight (), COL_MENUHEAD_PLUS_0); + ::paintButtons (this->frameBuffer, this->fontButtons, g_Locale, this->x + 10, + yPos, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels); - ::paintButtons (this->frameBuffer, this->fontButtons, g_Locale, this->x + 10, yPos + this->fontButtons->getHeight () - buttonHeight + 3, buttonWidth, numberOfButtons, pbuttonLabels); - - this->frameBuffer->paintIcon (NEUTRINO_ICON_BUTTON_HELP, this->x + this->width - 30, yPos - this->fontButtons->getHeight ()); + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); + this->frameBuffer->paintIcon (NEUTRINO_ICON_BUTTON_HELP, this->x + this->width - icol_w - 10, yPos, buttonHeight); } EpgPlus::EpgPlus () @@ -678,7 +680,17 @@ void EpgPlus::init () int headerHeight = Header::getUsedHeight (); int timeLineHeight = TimeLine::getUsedHeight (); this->entryHeight = ChannelEntry::getUsedHeight (); - int footerHeight = Footer::getUsedHeight (); + + int icol_w, icol_h, h2; + + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &h2); + if(icol_h < h2) + icol_h = h2; + + //int buttonHeight = 6 + std::max (icol_h+2, fonts[EPGPlus_footer_fontbuttons]->getHeight ()); + int buttonHeight = std::max (icol_h+4, fonts[EPGPlus_footer_fontbuttons]->getHeight ()); + int footerHeight = Footer::getUsedHeight () + buttonHeight; this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - horGap1Height - horGap2Height - footerHeight) / this->entryHeight; @@ -739,7 +751,7 @@ void EpgPlus::init () this->timeLine = new TimeLine (this->frameBuffer, this->timeLineX, this->timeLineY, this->timeLineWidth, this->eventsTableX, this->eventsTableWidth); - this->footer = new Footer (this->frameBuffer, this->footerX, this->footerY, this->footerWidth); + this->footer = new Footer (this->frameBuffer, this->footerX, this->footerY, this->footerWidth, buttonHeight); } void EpgPlus::free () diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index b005f7073..f97b2dd91 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -284,6 +284,7 @@ public: , int x , int y , int width + , int height ); ~Footer(); @@ -316,6 +317,7 @@ public: int x; int y; int width; + int buttonHeight; static Font* fontBouquetChannelName; static Font* fontEventDescription; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c5843cbce..b68eda75e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -663,6 +664,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start while (loop) { g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); scrollCount = medlinecount; @@ -753,6 +756,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); recDirs.exec(NULL,""); show(channel_id,epgData.eventID,&epgData.epg_times.startzeit,false); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else { printf("no network devices available\n"); @@ -783,9 +787,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), TIMERD_APIDS_CONF, true, recDir,true); ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } else { ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } } @@ -805,6 +811,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit - ANNOUNCETIME, 0, epgData.eventID, epgData.epg_times.startzeit, 0); ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else printf("timerd not available\n"); @@ -1028,27 +1035,44 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st // -- 2002-05-13 rasc // +const struct button_label EpgButtons[] = +{ + { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH } +}; + void CEpgData::showTimerEventBar (bool pshow) { - int x,y,w,h; + int x,y,w,h,fh; int cellwidth; // 4 cells - int h_offset, pos; + int icol_w, icol_h; - w = ox; - h = 30; - x = sx; + w = ox - 20; + x = sx + 10; y = sy + oy; - h_offset = 5; cellwidth = w / 4; + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - frameBuffer->paintBackgroundBoxRel(x,y,w,h); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + h = std::max(fh, icol_h+4); + + frameBuffer->paintBackgroundBoxRel(sx,y,ox,h); // hide only? - if (! pshow) return; + if (! pshow) + return; - frameBuffer->paintBoxRel(x,y,w,h, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round + frameBuffer->paintBoxRel(sx,y,ox,h, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round + if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x, y, cellwidth*2, h, 2, EpgButtons); + else + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x + cellwidth*2, y, cellwidth, h, 1, &EpgButtons[1]); + +#if 0 // Button: Timer Record & Channelswitch if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { @@ -1060,6 +1084,7 @@ void CEpgData::showTimerEventBar (bool pshow) pos = 2; frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset ); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR, 0, true); // UTF-8 +#endif } // -- EPG Data Viewer Menu Handler Class diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 8a67db99b..b62ba5efd 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -222,10 +222,25 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam height = h_max (480, 20); iheight = 30; // info bar height (see below, hard coded at this time) + + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + if(iheight < fh) + iheight = fh; + + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + if(iheight < icol_h) + iheight = icol_h; + theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); if(theight < PIC_H) theight = PIC_H; + int iw, ih; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iw, &ih); + if(theight < ih) + theight = ih; + fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); { int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight(); @@ -266,7 +281,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam int oldselected = selected; - uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); bool loop = true; while (loop) @@ -274,7 +289,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); if ( msg <= CRCInput::RC_MaxRC ) - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup) { @@ -406,6 +421,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam hide(); recDirs.exec(NULL,""); paint(channel_id); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else { printf("[CEventList] no network devices available\n"); @@ -437,9 +453,11 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam evtlist[selected].startTime - (ANNOUNCETIME + 120), TIMERD_APIDS_CONF, true, recDir,true); ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } else { ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } timerlist.clear(); @@ -467,6 +485,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(channel_id); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_timeout) @@ -513,6 +532,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam } else { + //FIXME why getMsg ? g_RCInput->getMsg( &msg, &data, 0 ); if ( ( msg != CRCInput::RC_red ) && ( msg != CRCInput::RC_timeout ) ) @@ -520,19 +540,21 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam // RC_red schlucken g_RCInput->postMsg( msg, data ); } + /* in case timer was added in g_EpgData */ timerlist.clear(); g_Timerd->getTimerList (timerlist); paintHead(channel_id, name); paint(channel_id); showFunctionBar(true); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } } else if ( msg==CRCInput::RC_green ) { in_search = findEvents(); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { g_RCInput->postMsg (msg, 0); @@ -633,19 +655,8 @@ void EventList::paintItem(unsigned int pos, t_channel_id channel_id) sprintf(tmpstr, "[%d min]", evtlist[liststart+pos].duration / 60 ); duration_str = tmpstr; -#if 0 - CTimerd::TimerList::iterator timer = timerlist.begin(); - for(; timer != timerlist.end(); timer++) { - if(timer->channel_id == channel_id && (timer->eventType == CTimerd::TIMER_ZAPTO || timer->eventType == CTimerd::TIMER_RECORD)) { - if(timer->epgID == evtlist[liststart+pos].eventID) { - if(timer->epg_starttime == evtlist[liststart+pos].startTime) - icontype = timer->eventType == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_BUTTON_YELLOW : NEUTRINO_ICON_BUTTON_RED; - break; - } - } - } -#endif } + CTimerd::CTimerEventTypes etype = isScheduled(channel_id, &evtlist[liststart+pos]); icontype = etype == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_BUTTON_YELLOW : etype == CTimerd::TIMER_RECORD ? NEUTRINO_ICON_BUTTON_RED : 0; @@ -663,10 +674,14 @@ void EventList::paintItem(unsigned int pos, t_channel_id channel_id) g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20- w, ypos+ fheight1+3, fwidth2, beginnt, color); } g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x+width-fwidth2-5- 20, ypos+ fheight1+3, fwidth2, duration_str, color, 0, true); // UTF-8 - if(icontype != 0) - frameBuffer->paintIcon(icontype, x+2, ypos + fheight - 16 - (fheight1 - 16)/2); + int iw = 0, ih; + if(icontype != 0) { + frameBuffer->getIconSize(icontype, &iw, &ih); + //frameBuffer->paintIcon(icontype, x+5, ypos + fheight - 16 - (fheight1 - 16)/2); + frameBuffer->paintIcon(icontype, x+5, ypos + fheight - ih - (fheight1 - ih)/2, fheight1); + } // 2nd line - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+ 20, ypos+ fheight, width- 25- 20, evtlist[liststart+pos].description, color, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20, evtlist[liststart+pos].description, color, 0, true); } } @@ -689,8 +704,11 @@ void EventList::paint(t_channel_id channel_id) { liststart = (selected/listmaxshow)*listmaxshow; - if (evtlist[0].eventID != 0) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 30, y+ 5 ); + int iw = 0, ih; + if (evtlist[0].eventID != 0) { + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iw, &ih); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width - 4 - iw, y, theight); + } frameBuffer->paintBoxRel(x, y+theight, width, height-theight-iheight, COL_MENUCONTENT_PLUS_0, 0, CORNER_TOP); for(unsigned int count=0;countpaintBackgroundBoxRel(x,by,width,bh); + // -- hide only? + if (! show) return; - frameBuffer->paintBackgroundBoxRel(bx,by,bw,bh); - // -- hide only? - if (! show) return; + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - // -- frameBuffer->paintBoxRel(x,y,w,h, COL_INFOBAR_SHADOW_PLUS_1); - //frameBuffer->paintBoxRel(bx,by,bw,bh, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(bx,by,bw,bh, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x,by,width,bh, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + // -- Button: Timer Record & Channelswitch + if ((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) && + ((unsigned int) g_settings.key_channelList_addrecord != CRCInput::RC_nokey)) + { + pos = 0; + // FIXME : display other icons depending on g_settings.key_channelList_addrecord + if ((g_settings.key_channelList_addrecord == CRCInput::RC_red) && !g_settings.minimode) { + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, bx + cellwidth*pos, by + (iheight-icol_h)/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx + icol_w + 8 + cellwidth*pos, by+bh-(iheight-fh)/2, cellwidth-icol_w-8, g_Locale->getText(LOCALE_EVENTLISTBAR_RECORDEVENT), COL_INFOBAR, 0, true); // UTF-8 + } + } + if (1) + { + pos = 1; + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, bx + cellwidth*pos, by + (iheight-icol_h)/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx + icol_w + 8 + cellwidth*pos, by+bh-(iheight-fh)/2, cellwidth-icol_w-8, g_Locale->getText(LOCALE_EVENTFINDER_SEARCH), COL_INFOBAR, 0, true); // UTF-8 + } - // -- Button: Timer Record & Channelswitch - if ((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) && - ((unsigned int) g_settings.key_channelList_addrecord != CRCInput::RC_nokey)) - { - pos = 0; - // FIXME : display other icons depending on g_settings.key_channelList_addrecord - if ((g_settings.key_channelList_addrecord == CRCInput::RC_red) && !g_settings.minimode) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, bx+8+cellwidth*pos, by+h_offset); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTLISTBAR_RECORDEVENT), COL_INFOBAR, 0, true); // UTF-8 - } - } - if (1) - { - pos = 1; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, bx+8+cellwidth*pos, by+h_offset); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTFINDER_SEARCH), COL_INFOBAR, - 0, true); // UTF-8 - } + // Button: Timer Channelswitch + if ((unsigned int) g_settings.key_channelList_addremind != CRCInput::RC_nokey) + { + pos = 2; + // FIXME : display other icons depending on g_settings.key_channelList_addremind + if (g_settings.key_channelList_addremind == CRCInput::RC_yellow) { + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, bx + cellwidth*pos, by + (iheight-icol_h)/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx + icol_w + 8 + cellwidth*pos, by+bh-(iheight-fh)/2, cellwidth-icol_w-8, g_Locale->getText(LOCALE_EVENTLISTBAR_CHANNELSWITCH), COL_INFOBAR, 0, true); // UTF-8 + } + } - // Button: Timer Channelswitch - if ((unsigned int) g_settings.key_channelList_addremind != CRCInput::RC_nokey) - { - pos = 2; - // FIXME : display other icons depending on g_settings.key_channelList_addremind - if (g_settings.key_channelList_addremind == CRCInput::RC_yellow) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, bx+8+cellwidth*pos, by+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTLISTBAR_CHANNELSWITCH), COL_INFOBAR, 0, true); // UTF-8 - } - - // Button: Event Re-Sort - if ((unsigned int) g_settings.key_channelList_sort != CRCInput::RC_nokey) - { - pos = 3; - //FIXME: display other icons depending on g_settings.key_channelList_sort value - if (g_settings.key_channelList_sort == CRCInput::RC_blue) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, bx+8+cellwidth*pos, by+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTLISTBAR_EVENTSORT), COL_INFOBAR, 0, true); // UTF-8 - } + // Button: Event Re-Sort + if ((unsigned int) g_settings.key_channelList_sort != CRCInput::RC_nokey) + { + pos = 3; + //FIXME: display other icons depending on g_settings.key_channelList_sort value + if (g_settings.key_channelList_sort == CRCInput::RC_blue) { + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, bx + cellwidth*pos, by + (iheight-icol_h)/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx + icol_w + 8 + cellwidth*pos, by+bh-(iheight-fh)/2, cellwidth-icol_w-8, g_Locale->getText(LOCALE_EVENTLISTBAR_EVENTSORT), COL_INFOBAR, 0, true); // UTF-8 + } + } } int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index d68a36e22..97eed0c66 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1426,7 +1426,7 @@ void CFileBrowser::paintFoot() //Mute-Button if (strncmp(Path.c_str(), VLC_URI, strlen(VLC_URI)) != 0) { //Not in vlc mode - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, x + (2 * dx), by2 - 3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, x + (2 * dx), by2 - 3); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 35 + (2 * dx), ty2, dx - 35, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index baab7579c..0f63f8493 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -465,8 +465,11 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con /* showChannelLogo() changes this, so better reset it every time... */ ChanNameX = BoxStartX + ChanWidth + SHADOW_OFFSET; + /* assuming all color icons must have same size */ + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + asize = (BoxEndX - (2*ICON_LARGE_WIDTH + 2*ICON_SMALL_WIDTH + 4*2) - 102) - ChanInfoX; - asize = asize - (NEUTRINO_ICON_BUTTON_RED_WIDTH+6)*4; + asize = asize - (icol_w+6)*4; asize = asize / 4; #if 0 @@ -560,14 +563,17 @@ fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_set frameBuffer->paintBoxRel(ChanInfoX, BBarY, BoxEndX - ChanInfoX, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM); //round showSNR(); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, ChanInfoX + 16*3 + asize * 3 + 2*6, + //frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, ChanInfoX + 16*3 + asize * 3 + 2*6, + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_BLUE, ChanInfoX + 10 + (icol_w + 4 + asize + 2) * 3, BBarY, InfoHeightY_Info); std::string txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_BLUE]; if (txt.empty()) txt = g_Locale->getText(LOCALE_INFOVIEWER_STREAMINFO); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(ChanInfoX + 16*4 + asize * 3 + 2*8, BBarFontY, ButtonWidth - (2 + NEUTRINO_ICON_BUTTON_BLUE_WIDTH + 4 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 + //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(ChanInfoX + 16*4 + asize * 3 + 2*8, BBarFontY, ButtonWidth - (2 + icol_w + 4 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(ChanInfoX + 10 + (icol_w + 4 + asize + 2) * 3 + icol_w + 4, + BBarFontY, ButtonWidth - (2 + icol_w + 4 + 2), txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 showButton_Audio (); showButton_SubServices (); @@ -1054,13 +1060,15 @@ void CInfoViewer::showButton_SubServices () { if (!(g_RemoteControl->subChannels.empty ())) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, - ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4 + asize + 2, BBarY, InfoHeightY_Info); + ChanInfoX + 10 + (icol_w + 4 + asize + 2) * 2, BBarY, InfoHeightY_Info); + /*ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4 + asize + 2, BBarY, InfoHeightY_Info);*/ std::string txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_YELLOW]; if (txt.empty()) txt = g_Locale->getText((g_RemoteControl->are_subchannels) ? LOCALE_INFOVIEWER_SUBSERVICE : LOCALE_INFOVIEWER_SELECTTIME); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString( - ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 4, + ChanInfoX + 10 + (icol_w + 4 + asize + 2) * 2 + icol_w + 4, + /*ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_YELLOW_WIDTH + 4,*/ BBarFontY, asize, txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 } } @@ -1390,7 +1398,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) std::string txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_RED]; if (txt.empty()) txt = g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(ChanInfoX + (10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4), BBarFontY, asize, txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(ChanInfoX + (10 + icol_w + 4), BBarFontY, asize, txt, COL_INFOBAR_BUTTONS, 0, true); // UTF-8 } } @@ -1524,13 +1532,14 @@ void CInfoViewer::showButton_Audio () // green, in case of several APIDs uint32_t count = g_RemoteControl->current_PIDs.APIDs.size (); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, - ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2, + ChanInfoX + 10 + icol_w + 4 + asize + 2, BBarY, InfoHeightY_Info); std::string txt = g_settings.usermenu_text[SNeutrinoSettings::BUTTON_GREEN]; if (count > 0) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; - int sx = ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4; + /*int sx = ChanInfoX + 10 + NEUTRINO_ICON_BUTTON_RED_WIDTH + 4 + asize + 2 + NEUTRINO_ICON_BUTTON_GREEN_WIDTH + 4;*/ + int sx = ChanInfoX + 10 + (icol_w + 4)*2 + asize + 2; frameBuffer->paintBoxRel(sx, BBarY, asize, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND); diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 9775d6f93..3ab325a9e 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -80,6 +80,7 @@ class CInfoViewer int BBarFontY; int asize; + int icol_w, icol_h; CSectionsdClient::CurrentNextInfo info_CurrentNext; t_channel_id channel_id; diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 56303d1af..f8ff4961e 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -344,7 +344,9 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) if(sit != satellitePositions.end()) { printf("[motorcontrol] new positions configured for %s\n", sit->second.name.c_str()); std::string buf = g_Locale->getText(LOCALE_MOTORCONTROL_OVERRIDE); + buf += " "; buf += sit->second.name; + buf += " ?"; store = (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); } } diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 7dee27186..80d476299 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1501,6 +1501,7 @@ void CMovieBrowser::refreshFoot(void) { //TRACE("[mb]->refreshButtonLine \r\n"); int color = (CFBWindow::color_t) COL_MENUHEAD; + int iw = 0, ih; std::string filter_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FILTER); filter_text += m_settings.filter.optionString; @@ -1522,14 +1523,18 @@ void CMovieBrowser::refreshFoot(void) // draw yellow (sort) if (m_settings.gui != MB_GUI_LAST_PLAY && m_settings.gui != MB_GUI_LAST_RECORD) { - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, m_cBoxFrame.iX+xpos1, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + 4 + (ADD_FOOT_HEIGHT>>1)); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1 + 20, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, sort_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); + //m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, m_cBoxFrame.iX+xpos1, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + 4 + (ADD_FOOT_HEIGHT>>1)); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, m_cBoxFrame.iX+xpos1, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, sort_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 } if (m_settings.gui != MB_GUI_LAST_PLAY && m_settings.gui != MB_GUI_LAST_RECORD) { - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, m_cBoxFrame.iX+xpos1+width, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + 4 + (ADD_FOOT_HEIGHT>>1)); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+ xpos1+width + 20, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width -30, filter_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); + //m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, m_cBoxFrame.iX+xpos1+width, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + 4 + (ADD_FOOT_HEIGHT>>1)); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, m_cBoxFrame.iX+xpos1+width, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+ xpos1+width + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width -30, filter_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 } //std::string ok_text; if(m_settings.gui == MB_GUI_FILTER && m_windowFocus == MB_FOCUS_FILTER) @@ -1540,11 +1545,15 @@ void CMovieBrowser::refreshFoot(void) { ok_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY); } - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 30, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); + //m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 //delte icon - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 30 , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); + //m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 5cb64ff46..8f92debfd 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -115,8 +115,23 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & /*actionKey height = h_max (570, 0); sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - buttonHeight = std::min(25, sheight); + + int icol_w, icol_h; + theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + + frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &icol_w, &icol_h); + theight = std::max(theight, icol_h); + + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + buttonHeight = 8 + std::max(icol_h+2, sheight); + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); listmaxshow = (height-theight-2*buttonHeight)/(fheight); height = theight+2*buttonHeight+listmaxshow*fheight; // recalc height @@ -568,14 +583,19 @@ void CPictureViewerGui::paintHead() { // printf("paintHead{\n"); std::string strCaption = g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD); + + int iw1, iw2, iw3, ih; + frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw1, &ih); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iw2, &ih); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iw3, &ih); + frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - frameBuffer->paintIcon(NEUTRINO_ICON_MP3,x+7,y+10); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+35,y+theight+0, width- 45, strCaption, COL_MENUHEAD, 0, true); // UTF-8 - int ypos=y+0; - if (theight > 26) - ypos = (theight-26) / 2 + y ; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 60, ypos ); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- 30, ypos ); + + frameBuffer->paintIcon(NEUTRINO_ICON_MP3, x+5, y, theight); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+iw1+10, y+theight+0, width- iw1 - iw2 - iw3 - 5*5, strCaption, COL_MENUHEAD, 0, true); // UTF-8 + + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- iw2 - 5, y, theight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- iw2 - iw3 - 10, y, theight ); // printf("paintHead}\n"); } @@ -593,28 +613,43 @@ void CPictureViewerGui::paintFoot() // printf("paintFoot{\n"); int ButtonWidth = (width-20) / 4; int ButtonWidth2 = (width-50) / 2; + frameBuffer->paintBoxRel(x, y+(height-2*buttonHeight), width, 2*buttonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); frameBuffer->paintHLine(x, x+width, y+(height-2*buttonHeight), COL_INFOBAR_SHADOW_PLUS_0); if (!playlist.empty()) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + 1* ButtonWidth2 + 25, y+(height-buttonHeight)-3); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 1 * ButtonWidth2 + 53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, g_Locale->getText(LOCALE_PICTUREVIEWER_SHOW), COL_INFOBAR, 0, true); // UTF-8 + //frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + 1* ButtonWidth2 + 25, y+(height-buttonHeight)-3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + 1* ButtonWidth2 + 25, y+height-buttonHeight, buttonHeight); + //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 1 * ButtonWidth2 + 53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, g_Locale->getText(LOCALE_PICTUREVIEWER_SHOW), COL_INFOBAR, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 1 * ButtonWidth2 + 53 , + y + height - buttonHeight + sheight + (buttonHeight - sheight)/2, ButtonWidth2- 28, + g_Locale->getText(LOCALE_PICTUREVIEWER_SHOW), COL_INFOBAR, 0, true); // UTF-8 - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+(height-buttonHeight)-3); + //frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+(height-buttonHeight)-3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+height-buttonHeight, buttonHeight); std::string tmp = g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER); tmp += ' '; if (m_sort==FILENAME) tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_DATE); else if (m_sort==DATE) tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_FILENAME); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8 + //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , + y + height - buttonHeight + sheight + (buttonHeight - sheight)/2, + ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8 - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - 2 * buttonHeight) + 4, ButtonWidth, 4, PictureViewerButtons); + //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - 2 * buttonHeight) + 4, ButtonWidth, 4, PictureViewerButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x + 10, y + (height - 2 * buttonHeight), ButtonWidth, buttonHeight, + 4, PictureViewerButtons); } else - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + ButtonWidth + 10, y + (height - 2 * buttonHeight) + 4, ButtonWidth, 1, &(PictureViewerButtons[1])); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + /*x + ButtonWidth + 10, y + (height - 2 * buttonHeight) + 4, ButtonWidth,*/ + x + ButtonWidth + 10, y + (height - 2 * buttonHeight), ButtonWidth, buttonHeight, + 1, &(PictureViewerButtons[1])); // printf("paintFoot}\n"); } //------------------------------------------------------------------------ diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 772231309..e3fb9095f 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -46,14 +46,11 @@ #include #include -int x_box = 15 * 5; -int y_box; //=15*25; -int BoxHeight; //=15*4; -int BoxWidth; //=15*23; +//int x_box = 15 * 5; inline unsigned int make16color(__u32 rgb) { - return 0xFF000000 | rgb; + return 0xFF000000 | rgb; } CScreenSetup::CScreenSetup() @@ -73,13 +70,20 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) parent->hide(); } + x_box = 15*5; y_box = frameBuffer->getScreenHeight(true) / 2; - BoxHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + + BoxHeight = std::max(icol_h+4, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); BoxWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT)); + int tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT)); if (tmp > BoxWidth) BoxWidth = tmp; - BoxWidth += 30; + + BoxWidth += 10 + icol_w; x_coord[0] = g_settings.screen_StartX; x_coord[1] = g_settings.screen_EndX; @@ -256,8 +260,16 @@ void CScreenSetup::unpaintBorder(int pselected) void CScreenSetup::paintIcons() { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x_box + 6, y_box + 8); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x_box + 6, y_box + 8 + BoxHeight); + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x_box + 5, y_box, BoxHeight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x_box + 5, y_box+BoxHeight, BoxHeight); + + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight, BoxWidth, + g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), COL_MENUCONTENTSELECTED , 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight * 2, BoxWidth, + g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), COL_MENUCONTENT, 0, true); // UTF-8 } void CScreenSetup::paintBorderUL() @@ -313,29 +325,17 @@ void CScreenSetup::paint() for(int count = 0; count < w; count += 15) frameBuffer->paintVLine(count, 0, h-1, make16color(0x505050) ); - //frameBuffer->paintBox(0,0, 15*15,15*15, make16color(0xA0A0A0)); - //frameBuffer->paintBox(32*15+1, 23*15+1, 719,575, make16color(0xA0A0A0)); frameBuffer->paintBox(0, 0, w/3, h/3, make16color(0xA0A0A0)); frameBuffer->paintBox(w-w/3, h-h/3, w-1, h-1, make16color(0xA0A0A0)); -//new - //frameBuffer->paintBoxRel(225, 89, 496, 3, COL_MENUCONTENT_PLUS_0); //upper letterbox marker - //frameBuffer->paintBoxRel(0, 495, 481, 3, COL_MENUCONTENT_PLUS_0); //lower letterbox marker frameBuffer->paintBoxRel(x_box, y_box, BoxWidth, BoxHeight, COL_MENUCONTENTSELECTED_PLUS_0); //upper selected box frameBuffer->paintBoxRel(x_box, y_box + BoxHeight, BoxWidth, BoxHeight, COL_MENUCONTENT_PLUS_0); //lower selected box +#if 0 g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + 30, y_box + BoxHeight, BoxWidth, g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), COL_MENUCONTENTSELECTED , 0, true); // UTF-8 g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + 30, y_box + BoxHeight * 2, BoxWidth, g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), COL_MENUCONTENT, 0, true); // UTF-8 -//new end -#if 0 // old - int x=15*5; - int y=15*24; - frameBuffer->paintBoxRel(x,y, 15*23,15*4, COL_MENUCONTENT_PLUS_0); - - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+30,y+29, 15*23, g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), COL_MENUHEAD , 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+30,y+49, 15*23, g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), COL_MENUCONTENT, 0, true); // UTF-8 #endif paintIcons(); diff --git a/src/gui/screensetup.h b/src/gui/screensetup.h index 65d007109..a8572ca88 100644 --- a/src/gui/screensetup.h +++ b/src/gui/screensetup.h @@ -45,6 +45,10 @@ class CScreenSetup : public CMenuTarget private: CFrameBuffer * frameBuffer; int selected; + int x_box; + int y_box; + int BoxHeight; + int BoxWidth; int x_coord[2]; int y_coord[2]; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index b2f2bfd1c..cace593ca 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -243,7 +243,15 @@ CTimerList::CTimerList() liststart = 0; Timer = new CTimerdClient(); skipEventID=0; - buttonHeight = 25; + + /* assuming all color icons must have same size */ + int icol_w, icol_h, ih2; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &icol_w, &ih2); + icol_h = std::max(icol_h, ih2); + + //buttonHeight = 7 + std::max(icol_h+2, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); + buttonHeight = std::max(icol_h+4, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); } CTimerList::~CTimerList() @@ -398,6 +406,15 @@ void CTimerList::updateEvents(void) width = w_max(720, 0); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &icol_w, &icol_h); + if(theight < icol_h) + theight = icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); + if(theight < icol_h) + theight = icol_h; + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); height = frameBuffer->getScreenHeight() - (info_height+50); @@ -742,13 +759,17 @@ void CTimerList::paintItem(int pos) void CTimerList::paintHead() { - frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); - frameBuffer->paintIcon(NEUTRINO_ICON_TIMER,x+5,y+4); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+35,y+theight+0, width- 45, g_Locale->getText(LOCALE_TIMERLIST_NAME), COL_MENUHEAD, 0, true); // UTF-8 + int icol_w, icol_h; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 30, y+ 5 ); - /* if (bouquetList!=NULL) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, x+ width- 60, y+ 5 );*/ + frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &icol_w, &icol_h); + + frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); + frameBuffer->paintIcon(NEUTRINO_ICON_TIMER, x+5, y, theight); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+icol_w+15, y+theight+0, width - 45, + g_Locale->getText(LOCALE_TIMERLIST_NAME), COL_MENUHEAD, 0, true); // UTF-8 + + frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &icol_w, &icol_h); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - icol_w - 10, y, theight); } const struct button_label TimerListButtons[3] = @@ -765,13 +786,17 @@ void CTimerList::paintFoot() //frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); if (timerlist.empty()) - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + ButtonWidth + 10, y + height + 4, ButtonWidth, 2, &(TimerListButtons[1])); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x + ButtonWidth + 10, y + height, ButtonWidth, buttonHeight, 2, &(TimerListButtons[1])); else { - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height + 4, ButtonWidth, 3, TimerListButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x + 10, y + height, ButtonWidth, buttonHeight, 3, TimerListButtons); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+24 - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_TIMERLIST_MODIFY), COL_INFOBAR, 0, true); // UTF-8 + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height, buttonHeight); + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, + y + height + fh + (buttonHeight - fh)/2 , ButtonWidth- 28, g_Locale->getText(LOCALE_TIMERLIST_MODIFY), COL_INFOBAR, 0, true); // UTF-8 } } diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 696970ca4..b7abf9b57 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -26,22 +26,24 @@ #include #include - +#if 1 void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLocaleManager * const localemanager, const int x, const int y, const unsigned int buttonwidth, const unsigned int count, const struct button_label * const content) { for (unsigned int i = 0; i < count; i++) { -#if 0 - int iw, ih, yy; - int fh = font->getHeight(); - frameBuffer->getIconSize(content[i].button, &iw, &ih); - yy = y + (fh - ih)/2; - frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, yy); - font->RenderString(x + i * buttonwidth + iw + 5, y + 19, buttonwidth - iw - 5, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 -#else frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, y); - //FIXME why y+19 ?? font->RenderString(x + i * buttonwidth + 20, y + 19, buttonwidth - 20, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 -#endif + } +} +#endif +void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLocaleManager * const localemanager, const int x, const int y, const unsigned int buttonwidth, const unsigned int height, const unsigned int count, const struct button_label * const content) +{ + int iw, ih; + for (unsigned int i = 0; i < count; i++) + { + int fh = font->getHeight(); + frameBuffer->getIconSize(content[i].button, &iw, &ih); + frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, y, height); + font->RenderString(x + i * buttonwidth + iw + 5, y + (height-fh)/2 + fh, buttonwidth - iw - 5, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 } } diff --git a/src/gui/widget/buttons.h b/src/gui/widget/buttons.h index 96e241cfd..8253f93ef 100644 --- a/src/gui/widget/buttons.h +++ b/src/gui/widget/buttons.h @@ -33,5 +33,6 @@ typedef struct button_label } button_label_struct; void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLocaleManager * const localemanager, const int x, const int y, const unsigned int buttonwidth, const unsigned int count, const struct button_label * const content); +void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLocaleManager * const localemanager, const int x, const int y, const unsigned int buttonwidth, const unsigned int height, const unsigned int count, const struct button_label * const content); #endif /* __gui_widget_buttons_h__ */ diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 7c2871e92..58f319069 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -208,6 +208,8 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) *value[VALUE_B] = b_alt; if (value[VALUE_ALPHA]) *value[VALUE_ALPHA] = a_alt; + loop = false; + break; case CRCInput::RC_sat: case CRCInput::RC_favorites: diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index e1d69fec7..2b87e6a29 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -161,8 +161,11 @@ void CHintBox::refresh(void) if (!iconfile.empty()) { - window->paintIcon(iconfile.c_str(), 8, 5); - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 40, theight, width - 40, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 + int iw, ih; + CFrameBuffer::getInstance()->getIconSize(iconfile.c_str(), &iw, &ih); + //window->paintIcon(iconfile.c_str(), 8, 5); + window->paintIcon(iconfile.c_str(), 10, 0, theight); + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 } else window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index f208f8c12..aca058963 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -181,9 +181,18 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 selected -= step; + + if((prev_selected-step) < 0) { + if(prev_selected != 0 && step != 1) + selected = 0; + else + selected = getItemCount() - 1; + } + +#if 0 if((prev_selected-step) < 0) // because of uint selected = getItemCount() - 1; - +#endif paintItem(prev_selected - liststart); unsigned int oldliststart = liststart; liststart = (selected/listmaxshow)*listmaxshow; @@ -198,17 +207,28 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { if(getItemCount()!=0) { unsigned int step = 0; - int prev_selected = selected; + unsigned int prev_selected = selected; step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1 selected += step; + if(selected >= getItemCount()) { + if((getItemCount() - listmaxshow -1 < prev_selected) && (prev_selected != (getItemCount() - 1)) && (step != 1)) + selected = getItemCount() - 1; + else if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries + selected = 0; + else + selected = ((step == listmaxshow) && (selected < (((getItemCount() / listmaxshow)+1) * listmaxshow))) ? (getItemCount() - 1) : 0; + } + +#if 0 if(selected >= getItemCount()) { if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries selected = 0; else selected = ((step == listmaxshow) && (selected < (((getItemCount() / listmaxshow) + 1) * listmaxshow))) ? (getItemCount() - 1) : 0; } +#endif paintItem(prev_selected - liststart); unsigned int oldliststart = liststart; diff --git a/src/gui/widget/listbox.h b/src/gui/widget/listbox.h index e61c3cd96..6f94da917 100644 --- a/src/gui/widget/listbox.h +++ b/src/gui/widget/listbox.h @@ -44,6 +44,8 @@ class CListBox : public CMenuWidget int fheight; int theight; + int iheight; + int iconoffset; unsigned int selected; unsigned int liststart; diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 69367c43c..68048d3e2 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -97,7 +97,6 @@ void CMessageBox::paintButtons() uint8_t color; fb_pixel_t bgcolor; - //m_window->paintBoxRel(0, m_height - (m_fheight << 1), m_width, (m_fheight << 1), (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0); m_window->paintBoxRel(0, m_height - (m_fheight << 1), m_width, (m_fheight << 1), (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //irgendwann alle vergleichen - aber cancel ist sicher der längste @@ -105,13 +104,11 @@ void CMessageBox::paintButtons() int ButtonWidth = 20 + 33 + MaxButtonTextWidth; -// int ButtonSpacing = 40; -// int startpos = (m_width - ((ButtonWidth*3)+(ButtonSpacing*2))) / 2; - int ButtonSpacing = (m_width - 20 - (ButtonWidth * 3)) / 2; if(ButtonSpacing <= 5) ButtonSpacing = 5; int xpos = 10; + int iw, ih; if (showbuttons & mbYes) { @@ -125,14 +122,15 @@ void CMessageBox::paintButtons() color = COL_INFOBAR_SHADOW; bgcolor = COL_INFOBAR_SHADOW_PLUS_0; } - //m_window->paintBoxRel(xpos, m_height - m_fheight - 20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor); + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &iw, &ih); m_window->paintBoxRel(xpos, m_height - m_fheight - 20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - m_window->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14, m_height - m_fheight - 15); + //m_window->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14, m_height - m_fheight - 15); + //m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, m_height-m_fheight+4, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color, 0, true); // UTF-8 + m_window->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14, m_height - m_fheight - 20, m_fheight); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, m_height-m_fheight+4, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color, 0, true); // UTF-8 xpos += ButtonWidth + ButtonSpacing; } - if (showbuttons & mbNo) { if (result == mbrNo) @@ -146,9 +144,9 @@ void CMessageBox::paintButtons() bgcolor = COL_INFOBAR_SHADOW_PLUS_0; } - //m_window->paintBoxRel(xpos, m_height-m_fheight-20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor); m_window->paintBoxRel(xpos, m_height-m_fheight-20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - m_window->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos+14, m_height-m_fheight-15); + //m_window->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos+14, m_height-m_fheight-15); + m_window->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos+14, m_height-m_fheight - 20, m_fheight); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, m_height-m_fheight+4, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color, 0, true); // UTF-8 xpos += ButtonWidth + ButtonSpacing; } @@ -167,9 +165,9 @@ void CMessageBox::paintButtons() bgcolor = COL_INFOBAR_SHADOW_PLUS_0; } - //m_window->paintBoxRel(xpos, m_height-m_fheight-20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor); m_window->paintBoxRel(xpos, m_height-m_fheight-20, ButtonWidth, m_fheight, (CFBWindow::color_t)bgcolor, RADIUS_LARGE);//round - m_window->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10, m_height-m_fheight-19); + //m_window->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10, m_height-m_fheight-19); + m_window->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+14, m_height-m_fheight - 20, m_fheight); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + 43, m_height-m_fheight+4, ButtonWidth- 53, g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color, 0, true); // UTF-8 } } diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index eef1ff11a..68fa32cc4 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -134,6 +134,12 @@ void CStringInput::init() width = neededWidth+20; hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + if (!(iconfile.empty())) + { + int icol_w, icol_h; + frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h); + hheight = std::max(hheight, icol_h+4); + } mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); @@ -474,16 +480,16 @@ const char * CStringInput::getHint1(void) void CStringInput::paint() { int iconoffset; + int icol_w, icol_h; - //frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0); - //frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round if (!(iconfile.empty())) { - frameBuffer->paintIcon(iconfile, x + 8, y + 5); - iconoffset = 28; + frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h); + frameBuffer->paintIcon(iconfile, x + 8, y, hheight); + iconoffset = icol_w + 10; } else iconoffset = 0; @@ -580,7 +586,6 @@ void CStringInputSMS::initSMS(const char * const Valid_Chars) y = ((500-height)>>1); } - void CStringInputSMS::NormalKeyPressed(const neutrino_msg_t key) { if (CRCInput::isNumeric(key)) @@ -687,14 +692,23 @@ const struct button_label CStringInputSMSButtons[2] = void CStringInputSMS::paint() { + int icol_w, icol_h; + int bh, bw, fh; + CStringInput::paint(); + fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + bh = std::max(fh, icol_h+4); + bw = (width - 20) / 2; + frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x+20+140, y+ hheight+ mheight+ iheight* 3+ 30, 0, COL_MENUCONTENT); - frameBuffer->paintBoxRel(x,y+height-25, width,25, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - frameBuffer->paintHLine(x, x+width, y+height-25, COL_INFOBAR_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x, y+height-bh, width, bh, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + //frameBuffer->paintHLine(x, x+width, y+height-25, COL_INFOBAR_SHADOW_PLUS_0); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y+height-25+1, 230, 2, CStringInputSMSButtons); + //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y+height-25+1, 230, 2, CStringInputSMSButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y+height-bh, bw, bh, 2, CStringInputSMSButtons); } void CPINInput::paintChar(int pos) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9cb74c436..8948f3329 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3288,8 +3288,13 @@ printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout); return messages_return::handled; } else if (msg == NeutrinoMessages::RECORD_START) { - if( mode == mode_standby ) + if( mode == mode_standby ) {//FIXME better at announce ? cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + if(g_settings.ci_standby_reset) { + g_CamHandler->exec(NULL, "reset1"); + g_CamHandler->exec(NULL, "reset2"); + } + } if(autoshift) { stopAutoRecord(); @@ -3630,6 +3635,8 @@ skip_message: return messages_return::unhandled; } +extern time_t timer_minutes; + void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) { if (!recordingstatus || @@ -3657,16 +3664,50 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) } if(retcode) { - neutrino_msg_t msg; - neutrino_msg_data_t data; - printf("entering off state\n"); mode = mode_off; - stop_daemons(false); + stop_daemons(true); system("/bin/sync"); system("/bin/umount -a"); + system("/etc/init.d/rcK"); + sleep(1); + { + standby_data_t standby; + time_t mtime = time(NULL); + struct tm *tmtime = localtime(&mtime); + time_t fp_timer = 0; + + if(timer_minutes) + fp_timer = (timer_minutes - mtime)/60; +printf("now: %ld, timer %ld, FP timer %ld\n", mtime/60, timer_minutes/60, fp_timer);fflush(stdout); + + standby.brightness = g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS]; + standby.flags = 0; + standby.current_hour = tmtime->tm_hour; + standby.current_minute = tmtime->tm_min; + standby.timer_minutes_hi = fp_timer >> 8;; + standby.timer_minutes_lo = fp_timer & 0xFF; + + int fd = open("/dev/display", O_RDONLY); + if (fd < 0) { + perror("/dev/display"); + reboot(LINUX_REBOOT_CMD_RESTART); + } else { + + if (ioctl(fd, IOC_VFD_STANDBY, (standby_data_t *) &standby)) { + perror("IOC_VFD_STANDBY"); + reboot(LINUX_REBOOT_CMD_RESTART); + } else { + while(true) sleep(1); + } + } + } +#if 0 + neutrino_msg_t msg; + neutrino_msg_data_t data; + cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); powerManager->SetStandby(true, true); int fspeed = 0; @@ -3697,6 +3738,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) reboot(LINUX_REBOOT_CMD_RESTART); } } +#endif } else { if (g_RCInput != NULL) delete g_RCInput; @@ -3753,10 +3795,10 @@ void CNeutrinoApp::AudioMute( int newValue, bool isEvent ) int x = g_settings.screen_EndX-dx; int y = g_settings.screen_StartY; +printf("AudioMute: current %d new %d isEvent: %d\n", current_muted, newValue, isEvent); CVFD::getInstance()->setMuted(newValue); current_muted = newValue; -printf("AudioMute: current %d new %d isEvent: %d\n", current_muted, newValue, isEvent); //if( !isEvent ) g_Zapit->muteAudio(current_muted); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 75ffb19a8..2060f87c3 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -723,7 +723,8 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_REBOOT, true, NULL, this, "reboot", CRCInput::convertDigitToKey(shortcut++))); - //mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER));//FIXME + if(system_rev >= 8) + mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER)); mainMenu.addItem( new CMenuSeparator(CMenuSeparator::LINE) ); mainMenu.addItem( new CMenuForwarder(LOCALE_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, CRCInput::convertDigitToKey(shortcut++))); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 0b93c0eb7..8fcfe4224 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -46,7 +46,7 @@ #define FP_IOCTL_GET_RTC 0x102 extern bool timeset; - +time_t timer_minutes; static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; //------------------------------------------------------------ @@ -664,7 +664,7 @@ void CTimerManager::saveEventsToConfig() //------------------------------------------------------------ bool CTimerManager::shutdown() { - +timerd_debug = 1; time_t nextAnnounceTime=0; bool status=false; dprintf("stopping timermanager thread ...\n"); @@ -690,6 +690,7 @@ bool CTimerManager::shutdown() for(;pos != events.end();pos++) { CTimerEvent *event = pos->second; +dprintf("shutdown: timer type %d state %d announceTime: %ld\n", event->eventType, event->eventState, event->announceTime); if((event->eventType == CTimerd::TIMER_RECORD || event->eventType == CTimerd::TIMER_ZAPTO ) && event->eventState == CTimerd::TIMERSTATE_SCHEDULED) @@ -698,18 +699,18 @@ bool CTimerManager::shutdown() if(event->announceTime < nextAnnounceTime || nextAnnounceTime==0) { nextAnnounceTime=event->announceTime; + dprintf("shutdown: nextAnnounceTime %ld\n", nextAnnounceTime); } } } -#if 0 - int erg; + timer_minutes = 0; if(nextAnnounceTime!=0) { -//FIXME: do we have wakeup ? - time_t minutes = nextAnnounceTime-3*60; + timer_minutes = nextAnnounceTime-3*60; } -#endif + dprintf("shutdown: timeset: %d timer_minutes %ld\n", timeset, timer_minutes); + pthread_mutex_unlock(&tm_eventsMutex); return status; } diff --git a/src/zapit/src/descriptors.cpp b/src/zapit/src/descriptors.cpp index a4b388214..a5efc7121 100644 --- a/src/zapit/src/descriptors.cpp +++ b/src/zapit/src/descriptors.cpp @@ -485,6 +485,8 @@ void service_descriptor(const unsigned char * const buffer, const t_service_id s providerName = CDVBString((const char*)&(buffer[4]), service_provider_name_length).getContent(); serviceName = CDVBString((const char*)&(buffer[4 + service_provider_name_length + 1]), (2 + buffer[1]) - (4 + service_provider_name_length + 1)).getContent(); } + if(serviceName.empty()) + return; found_channels++; eventServer->sendEvent ( CZapitClient::EVT_SCAN_NUM_CHANNELS, CEventServer::INITID_ZAPIT, &found_channels, sizeof(found_channels)); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 363e98f72..f9443587f 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -400,6 +400,7 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", channel pmt_stop_update_filter(&pmt_update_fd); stopPlayBack(true); + ci->SendPMT((unsigned char*) "", 0); /* store the new channel */ if ((!channel) || (channel_id != channel->getChannelID()))