Project "Tuxbox-GIT: apps": The branch, master has been updated via 4321a0a23cc7315cf644759bbf9e7a917d367e97 (commit) from fd6d7dc6a37543156212f4f0caa97b8d977b9be7 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4321a0a23cc7315cf644759bbf9e7a917d367e97 Author: Christian Schuett <gaucho...@hotmail.com> Date: Sat May 11 22:46:49 2013 +0200 Neutrino: consider icon height when calculating head height head icon could overflow the window at very small font height Signed-off-by: Christian Schuett <gaucho...@hotmail.com> diff --git a/tuxbox/neutrino/src/gui/audioplayer.cpp b/tuxbox/neutrino/src/gui/audioplayer.cpp index 66ffe51..a517a42 100644 --- a/tuxbox/neutrino/src/gui/audioplayer.cpp +++ b/tuxbox/neutrino/src/gui/audioplayer.cpp @@ -254,7 +254,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &) m_height = h_max(570, 0); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_buttonHeight = std::min(25, m_sheight); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &m_ticonwidth, &m_ticonheight); + m_theight = std::max(m_ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_title_height = m_fheight*2 + 20 + m_sheight + 4; m_info_height = m_fheight*2; @@ -1596,7 +1597,6 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist) return; - int iconw = 0, iconh = 0; int c_rad_mid = RADIUS_MID; std::string strCaption; if (m_inetmode) @@ -1605,15 +1605,15 @@ void CAudioPlayerGui::paintHead() 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->getIconSize(NEUTRINO_ICON_MP3, &iconw, &iconh); - int ypos = m_y + m_title_height + (m_theight / 2) - (iconh / 2); + int ypos = m_y + m_title_height + (m_theight / 2) - (m_ticonheight / 2); m_frameBuffer->paintIcon(NEUTRINO_ICON_MP3, m_x + 7, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + iconw + 10, m_y + m_title_height + m_theight + 2, - m_width - 7 - iconw - 10, strCaption, COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + m_ticonwidth + 10, m_y + m_title_height + m_theight + 2, + m_width - 7 - m_ticonwidth - 10, strCaption, COL_MENUHEAD, 0, true); // UTF-8 #ifdef ENABLE_GUI_MOUNT if (!m_inetmode) { + int iconw, iconh; m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iconw, &iconh); ypos = m_y + m_title_height + (m_theight / 2) - (iconh / 2); m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_x + m_width - iconw - 8, ypos); diff --git a/tuxbox/neutrino/src/gui/audioplayer.h b/tuxbox/neutrino/src/gui/audioplayer.h index f288e97..19d04b1 100644 --- a/tuxbox/neutrino/src/gui/audioplayer.h +++ b/tuxbox/neutrino/src/gui/audioplayer.h @@ -106,6 +106,8 @@ class CAudioPlayerGui : public CMenuTarget unsigned int m_listmaxshow; int m_fheight; // Fonthoehe Playlist-Inhalt int m_theight; // Fonthoehe Playlist-Titel + int m_ticonwidth; + int m_ticonheight; int m_sheight; // Fonthoehe MP Info int m_buttonHeight; int m_title_height; diff --git a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp index 66b2ef0..4b5e41c 100644 --- a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp +++ b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp @@ -230,8 +230,8 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) width = w_max (720, 30); int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BOOKMARKMANAGER, &iconw, &iconh); - theight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); + frameBuffer->getIconSize(NEUTRINO_ICON_BOOKMARKMANAGER, &ticonwidth, &ticonheight); + theight = std::max(ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iconw, &iconh); footHeight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); @@ -414,14 +414,12 @@ void CBookmarkManager::paintHead() frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); int theight_mid = theight / 2; - int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BOOKMARKMANAGER, &iconw, &iconh); - - int ypos = y + theight_mid - (iconh / 2); + int ypos = y + theight_mid - (ticonheight / 2); frameBuffer->paintIcon(NEUTRINO_ICON_BOOKMARKMANAGER, x + 5, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 5 + iconw + 10, y + theight + 2, width - 5 - iconw - 10, g_Locale->getText(LOCALE_BOOKMARKMANAGER_NAME), COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 5 + ticonwidth + 10, y + theight + 2, width - 5 - ticonwidth - 10, g_Locale->getText(LOCALE_BOOKMARKMANAGER_NAME), COL_MENUHEAD, 0, true); // UTF-8 #if 0 + int iconw, iconh; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iconw, &iconh); ypos = y + theight_mid - (iconh / 2); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - iconw - 8, ypos); diff --git a/tuxbox/neutrino/src/gui/bookmarkmanager.h b/tuxbox/neutrino/src/gui/bookmarkmanager.h index 5a13144..fcff725 100644 --- a/tuxbox/neutrino/src/gui/bookmarkmanager.h +++ b/tuxbox/neutrino/src/gui/bookmarkmanager.h @@ -74,6 +74,8 @@ class CBookmarkManager unsigned int listmaxshow; int fheight; //fontheight timerlist-content (text) int theight; //fontheight timerlist-title + int ticonwidth; + int ticonheight; int footHeight; bool visible; int width; diff --git a/tuxbox/neutrino/src/gui/channellist.cpp b/tuxbox/neutrino/src/gui/channellist.cpp index 60ad352..bb3c215 100644 --- a/tuxbox/neutrino/src/gui/channellist.cpp +++ b/tuxbox/neutrino/src/gui/channellist.cpp @@ -145,16 +145,8 @@ void CChannelList::calcSize() else width = full_width; - /* assuming all color icons must have same size */ - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h); - theight = std::max(theight, icol_h); - fheight = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(), std::max(g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(), std::max(g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getHeight(), diff --git a/tuxbox/neutrino/src/gui/moviebrowser.cpp b/tuxbox/neutrino/src/gui/moviebrowser.cpp index 16713ee..f928638 100644 --- a/tuxbox/neutrino/src/gui/moviebrowser.cpp +++ b/tuxbox/neutrino/src/gui/moviebrowser.cpp @@ -626,10 +626,12 @@ void CMovieBrowser::initFrames(void) m_cBoxFrame.iX = getScreenStartX(m_cBoxFrame.iWidth); m_cBoxFrame.iY = getScreenStartY(m_cBoxFrame.iHeight); + CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_EPGINFO, &m_iconWidthTitle, &m_iconHeightTitle); + m_cBoxFrameTitleRel.iX = 0; m_cBoxFrameTitleRel.iY = 0; m_cBoxFrameTitleRel.iWidth = m_cBoxFrame.iWidth; - m_cBoxFrameTitleRel.iHeight = m_pcFontTitle->getHeight(); + m_cBoxFrameTitleRel.iHeight = std::max(m_iconHeightTitle, m_pcFontTitle->getHeight()); m_cBoxFrameBrowserList.iX = m_cBoxFrame.iX; m_cBoxFrameBrowserList.iY = m_cBoxFrame.iY + m_cBoxFrameTitleRel.iHeight; @@ -1656,21 +1658,20 @@ void CMovieBrowser::refreshTitle(void) RADIUS_MID, CORNER_TOP); - int iconw = 0, iconh = 0; - CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_EPGINFO, &iconw, &iconh); m_pcWindow->paintIcon(NEUTRINO_ICON_EPGINFO, m_cBoxFrameTitleRel.iX + 6, - m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight / 2 - iconh / 2); + m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight / 2 - m_iconHeightTitle / 2); m_pcWindow->RenderString( m_pcFontTitle, - m_cBoxFrameTitleRel.iX + 6 + iconw + TEXT_BORDER_WIDTH, + m_cBoxFrameTitleRel.iX + 6 + m_iconWidthTitle + TEXT_BORDER_WIDTH, m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight + 2, - m_cBoxFrameTitleRel.iWidth - 6 - iconw - TEXT_BORDER_WIDTH, + m_cBoxFrameTitleRel.iWidth - 6 - m_iconWidthTitle - TEXT_BORDER_WIDTH, m_textTitle.c_str(), TITLE_FONT_COLOR, 0, true); // UTF-8 + int iconw, iconh; CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iconw, &iconh); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - iconw - 12, diff --git a/tuxbox/neutrino/src/gui/moviebrowser.h b/tuxbox/neutrino/src/gui/moviebrowser.h index 9065a47..44e9893 100644 --- a/tuxbox/neutrino/src/gui/moviebrowser.h +++ b/tuxbox/neutrino/src/gui/moviebrowser.h @@ -261,6 +261,8 @@ class CMovieBrowser : public CMenuTarget Font* m_pcFontFoot; Font* m_pcFontTitle; std::string m_textTitle; + int m_iconWidthTitle; + int m_iconHeightTitle; MB_PARENTAL_LOCK m_parentalLock; MB_STORAGE_TYPE m_storageType; diff --git a/tuxbox/neutrino/src/gui/pictureviewer.cpp b/tuxbox/neutrino/src/gui/pictureviewer.cpp index dd371ad..01802ca 100644 --- a/tuxbox/neutrino/src/gui/pictureviewer.cpp +++ b/tuxbox/neutrino/src/gui/pictureviewer.cpp @@ -125,10 +125,8 @@ 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 iconh = 0, dummy = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &dummy, &iconh); - theight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); + frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &ticonwidth, &ticonheight); + theight = std::max(ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); listmaxshow = (height-theight-2*buttonHeight)/(fheight); height = theight+2*buttonHeight+listmaxshow*fheight; // recalc height @@ -597,15 +595,14 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { // printf("paintHead{\n"); - int iconw = 0, iconh = 0; int theight_mid = theight / 2; - frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iconw, &iconh); - int ypos = y + theight_mid - (iconh / 2); + int ypos = y + theight_mid - (ticonheight / 2); frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); frameBuffer->paintIcon(NEUTRINO_ICON_MP3, x + 7, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 7 + iconw + 10, y + theight + 2, width - 7 - iconw - 10, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD), COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 7 + ticonwidth + 10, y + theight + 2, width - 7 - ticonwidth - 10, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD), COL_MENUHEAD, 0, true); // UTF-8 + int iconw, iconh; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iconw, &iconh); int xpos = x + width - iconw - 6; ypos = y + theight_mid - (iconh / 2); diff --git a/tuxbox/neutrino/src/gui/pictureviewer.h b/tuxbox/neutrino/src/gui/pictureviewer.h index 5d43e04..f2c8a6a 100644 --- a/tuxbox/neutrino/src/gui/pictureviewer.h +++ b/tuxbox/neutrino/src/gui/pictureviewer.h @@ -76,6 +76,8 @@ class CPictureViewerGui : public CMenuTarget int fheight; // Fonthoehe Playlist-Inhalt int theight; // Fonthoehe Playlist-Titel int sheight; // Fonthoehe MP Info + int ticonwidth; + int ticonheight; int buttonHeight; bool visible; State m_state; diff --git a/tuxbox/neutrino/src/gui/pluginlist.cpp b/tuxbox/neutrino/src/gui/pluginlist.cpp index 7de8ddf..1cadfca 100644 --- a/tuxbox/neutrino/src/gui/pluginlist.cpp +++ b/tuxbox/neutrino/src/gui/pluginlist.cpp @@ -77,6 +77,14 @@ CPluginList::CPluginList(const neutrino_locale_t Name, const uint listtype) buttonname = LOCALE_MENU_BACK; selected = 0; liststart = 0; + if (listtype == CPlugins::P_TYPE_GAME) + iconfile = NEUTRINO_ICON_GAMES; + else if (listtype == CPlugins::P_TYPE_SCRIPT) + iconfile = NEUTRINO_ICON_SHELL; + else + iconfile = ""; + ticonwidth = 0; + ticonheight = 0; } CPluginList::~CPluginList() @@ -261,18 +269,10 @@ void CPluginList::paintHead() frameBuffer->paintBoxRel(x, y, width + sb_width, theight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); int iconoffset = 0; - if(pluginlisttype == CPlugins::P_TYPE_GAME) + if (!iconfile.empty()) { - int iconw, iconh; - frameBuffer->getIconSize(NEUTRINO_ICON_GAMES, &iconw, &iconh); - frameBuffer->paintIcon(NEUTRINO_ICON_GAMES, x + 8, y + theight / 2 - iconh / 2); - iconoffset = 8 + iconw; - } else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) - { - int iconw, iconh; - frameBuffer->getIconSize(NEUTRINO_ICON_SHELL, &iconw, &iconh); - frameBuffer->paintIcon(NEUTRINO_ICON_SHELL, x + 8, y + theight / 2 - iconh / 2); - iconoffset = 8 + iconw; + frameBuffer->paintIcon(iconfile, x + 8, y + theight / 2 - ticonheight / 2); + iconoffset = 8 + ticonwidth; } g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + iconoffset + 10, y + theight + 2, width - iconoffset - 10, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 } @@ -283,7 +283,9 @@ void CPluginList::paint() width = w_max (500, 100); height = h_max (526, 50); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + if (!iconfile.empty()) + frameBuffer->getIconSize(iconfile.c_str(), &ticonwidth, &ticonheight); + theight = std::max(ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); // fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMLARGE]->getHeight(); fheight2 = g_Font[SNeutrinoSettings::FONT_TYPE_GAMELIST_ITEMSMALL]->getHeight(); @@ -294,7 +296,6 @@ void CPluginList::paint() sb_width = (pluginlist.size() > listmaxshow) ? 15 : 0; x = getScreenStartX(width + sb_width); y = getScreenStartY(height + (c_rad_mid / 3 * 2)); - liststart = (selected/listmaxshow)*listmaxshow; CLCD::getInstance()->setMode(CLCD::MODE_MENU_UTF8, g_Locale->getText(name)); diff --git a/tuxbox/neutrino/src/gui/pluginlist.h b/tuxbox/neutrino/src/gui/pluginlist.h index 1c8ec4a..a7eeaf0 100644 --- a/tuxbox/neutrino/src/gui/pluginlist.h +++ b/tuxbox/neutrino/src/gui/pluginlist.h @@ -65,9 +65,12 @@ class CPluginList : public CMenuTarget unsigned int listmaxshow; neutrino_locale_t name; uint pluginlisttype; + std::string iconfile; int fheight; // Fonthoehe Channellist-Inhalt int theight; // Fonthoehe Channellist-Titel + int ticonwidth; + int ticonheight; int fheight1,fheight2; diff --git a/tuxbox/neutrino/src/gui/timerlist.cpp b/tuxbox/neutrino/src/gui/timerlist.cpp index 2826a23..b2e18bb 100644 --- a/tuxbox/neutrino/src/gui/timerlist.cpp +++ b/tuxbox/neutrino/src/gui/timerlist.cpp @@ -434,8 +434,8 @@ void CTimerList::updateEvents(void) int CTimerList::show() { int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &iconw, &iconh); - theight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); + frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &ticonwidth, &ticonheight); + theight = std::max(ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iconw, &iconh); footHeight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); @@ -749,12 +749,11 @@ void CTimerList::paintHead() frameBuffer->paintBoxRel(x, y, width, theight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); int theight_mid = theight / 2; - int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &iconw, &iconh); - int ypos = y + theight_mid - (iconh / 2); + int ypos = y + theight_mid - (ticonheight / 2); frameBuffer->paintIcon(NEUTRINO_ICON_TIMER, x + 5, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 5 + iconw + 10, y + theight + 2, width - 5 - iconw - 10, g_Locale->getText(LOCALE_TIMERLIST_NAME), COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + 5 + ticonwidth + 10, y + theight + 2, width - 5 - ticonwidth - 10, g_Locale->getText(LOCALE_TIMERLIST_NAME), COL_MENUHEAD, 0, true); // UTF-8 + int iconw, iconh; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &iconw, &iconh); ypos = y + theight_mid - (iconh / 2); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + width - iconw - 8, ypos); diff --git a/tuxbox/neutrino/src/gui/timerlist.h b/tuxbox/neutrino/src/gui/timerlist.h index 1cc5b91..6317150 100644 --- a/tuxbox/neutrino/src/gui/timerlist.h +++ b/tuxbox/neutrino/src/gui/timerlist.h @@ -51,6 +51,8 @@ class CTimerList : public CMenuTarget unsigned int listmaxshow; int fheight; //fontheight timerlist-content (text) int theight; //fontheight timerlist-title + int ticonwidth; + int ticonheight; int footHeight; int time_width; bool visible; diff --git a/tuxbox/neutrino/src/gui/upnpbrowser.cpp b/tuxbox/neutrino/src/gui/upnpbrowser.cpp index 27a8b61..cb4e0aa 100644 --- a/tuxbox/neutrino/src/gui/upnpbrowser.cpp +++ b/tuxbox/neutrino/src/gui/upnpbrowser.cpp @@ -138,7 +138,8 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ m_height = h_max(570, 0); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_buttonHeight = std::min(25, m_sheight); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + m_frameBuffer->getIconSize(NEUTRINO_ICON_UPNP, &m_ticonwidth, &m_ticonheight); + m_theight = std::max(m_ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); m_title_height = m_mheight*2 + 20 + m_sheight + 4; @@ -1034,11 +1035,10 @@ void CUpnpBrowserGui::paintDevice() // Head tmp = g_Locale->getText(LOCALE_UPNPBROWSER_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->getIconSize(NEUTRINO_ICON_UPNP, &iconw, &iconh); - ypos = m_y + m_title_height + m_theight / 2 - iconh / 2; + ypos = m_y + m_title_height + m_theight / 2 - m_ticonheight / 2; m_frameBuffer->paintIcon(NEUTRINO_ICON_UPNP, m_x + 7, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + iconw + 10, m_y + m_title_height + m_theight + 2, - m_width - 7 - iconw - 10, tmp, COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + m_ticonwidth + 10, m_y + m_title_height + m_theight + 2, + m_width - 7 - m_ticonwidth - 10, tmp, COL_MENUHEAD, 0, true); // UTF-8 m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iconw, &iconh); ypos = m_y + m_title_height + m_theight / 2 - iconh / 2; m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_x + m_width - iconw - 8, ypos); @@ -1148,11 +1148,10 @@ void CUpnpBrowserGui::paintItem(std::vector<UPnPEntry> *entry, unsigned int sele // Head tmp = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD); m_frameBuffer->paintBoxRel(m_x, m_y + m_title_height, m_width, m_theight, COL_MENUHEAD_PLUS_0); - m_frameBuffer->getIconSize(NEUTRINO_ICON_UPNP, &iconw, &iconh); - ypos = m_y + m_title_height + m_theight / 2 - iconh / 2; + ypos = m_y + m_title_height + m_theight / 2 - m_ticonheight / 2; m_frameBuffer->paintIcon(NEUTRINO_ICON_UPNP, m_x + 7, ypos); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + iconw + 10, m_y + m_title_height + m_theight + 2, - m_width - 7 - iconw - 10, tmp, COL_MENUHEAD, 0, true); // UTF-8 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 7 + m_ticonwidth + 10, m_y + m_title_height + m_theight + 2, + m_width - 7 - m_ticonwidth - 10, tmp, COL_MENUHEAD, 0, true); // UTF-8 m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_DBOX, &iconw, &iconh); ypos = m_y + m_title_height + m_theight / 2 - iconh / 2; m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_DBOX, m_x + m_width - iconw - 8, ypos); diff --git a/tuxbox/neutrino/src/gui/upnpbrowser.h b/tuxbox/neutrino/src/gui/upnpbrowser.h index 03b6cc7..de1702a 100644 --- a/tuxbox/neutrino/src/gui/upnpbrowser.h +++ b/tuxbox/neutrino/src/gui/upnpbrowser.h @@ -85,6 +85,8 @@ class CUpnpBrowserGui : public CMenuTarget unsigned int m_selecteddevice; int m_fheight; // Fonthoehe Inhalt int m_theight; // Fonthoehe Titel + int m_ticonwidth; + int m_ticonheight; int m_mheight; // Fonthoehe Info int m_sheight; // Fonthoehe Status int m_buttonHeight; diff --git a/tuxbox/neutrino/src/gui/widget/hintbox.cpp b/tuxbox/neutrino/src/gui/widget/hintbox.cpp index a53ff9b..48f7324 100644 --- a/tuxbox/neutrino/src/gui/widget/hintbox.cpp +++ b/tuxbox/neutrino/src/gui/widget/hintbox.cpp @@ -53,7 +53,21 @@ CHintBox::CHintBox(const neutrino_locale_t Caption, const char * const Text, con width = Width; - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + if (Icon != NULL) + { + iconfile = Icon; + int iconw; + CFrameBuffer::getInstance()->getIconSize(Icon, &iconw, &ticonheight); + ticonoffset = 8 + iconw; + } + else + { + iconfile = ""; + ticonheight = 0; + ticonoffset = 0; + } + + theight = std::max(ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); height = theight + fheight; @@ -87,13 +101,7 @@ CHintBox::CHintBox(const neutrino_locale_t Caption, const char * const Text, con else additional_width = 20 + 0; - if (Icon != NULL) - { - iconfile = Icon; - additional_width += 30; - } - else - iconfile = ""; + additional_width += ticonoffset; nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(caption), true); // UTF-8 @@ -156,16 +164,9 @@ void CHintBox::refresh(void) // title window->paintBoxRel(0, 0, width, theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, c_rad_mid , CORNER_TOP); - - int iconoffset = 0; if (!iconfile.empty()) - { - int iconw, iconh; - CFrameBuffer::getInstance()->getIconSize(iconfile.c_str(), &iconw, &iconh); - window->paintIcon(iconfile.c_str(), 8, theight / 2 - iconh / 2); - iconoffset = 8 + iconw; - } - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iconoffset + 10, theight + 2, width - iconoffset - 10, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 + window->paintIcon(iconfile.c_str(), 8, theight / 2 - ticonheight / 2); + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], ticonoffset + 10, theight + 2, width - ticonoffset - 10, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 // background of text panel window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, c_rad_mid , CORNER_BOTTOM); diff --git a/tuxbox/neutrino/src/gui/widget/hintbox.h b/tuxbox/neutrino/src/gui/widget/hintbox.h index e647b5e..4c7e67c 100644 --- a/tuxbox/neutrino/src/gui/widget/hintbox.h +++ b/tuxbox/neutrino/src/gui/widget/hintbox.h @@ -54,6 +54,8 @@ class CHintBox int fheight; int theight; + int ticonheight; + int ticonoffset; neutrino_locale_t caption; char * message; std::vector<char *> line; diff --git a/tuxbox/neutrino/src/gui/widget/hintboxext.cpp b/tuxbox/neutrino/src/gui/widget/hintboxext.cpp index 1799d09..66ee7e0 100644 --- a/tuxbox/neutrino/src/gui/widget/hintboxext.cpp +++ b/tuxbox/neutrino/src/gui/widget/hintboxext.cpp @@ -101,7 +101,22 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c { m_width = Width; int nw = 0; - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + + if (Icon != NULL) + { + m_iconfile = Icon; + int iconw; + CFrameBuffer::getInstance()->getIconSize(Icon, &iconw, &m_ticonheight); + m_ticonoffset = 8 + iconw; + } + else + { + m_iconfile = ""; + m_ticonheight = 0; + m_ticonoffset = 0; + } + + m_theight = std::max(m_ticonheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_height = m_theight + m_fheight; m_maxEntriesPerPage = 0; @@ -178,13 +193,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c else additional_width = 20 + 0; - if (Icon != NULL) - { - m_iconfile = Icon; - additional_width += 30; - } - else - m_iconfile = ""; + additional_width += m_ticonoffset; nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(m_caption), true); // UTF-8 @@ -230,16 +239,9 @@ void CHintBoxExt::refresh(void) // title m_window->paintBoxRel(0, 0, m_width, m_theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, c_rad_mid, CORNER_TOP); - - int iconoffset = 0; if (!m_iconfile.empty()) - { - int iconw, iconh; - CFrameBuffer::getInstance()->getIconSize(m_iconfile.c_str(), &iconw, &iconh); - m_window->paintIcon(m_iconfile.c_str(), 8, m_theight / 2 - iconh / 2); - iconoffset = 8 + iconw; - } - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iconoffset + 10, m_theight + 2, m_width - iconoffset - 10, g_Locale->getText(m_caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 + m_window->paintIcon(m_iconfile.c_str(), 8, m_theight / 2 - m_ticonheight / 2); + m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], m_ticonoffset + 10, m_theight + 2, m_width - m_ticonoffset - 10, g_Locale->getText(m_caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8 // background of text panel m_window->paintBoxRel(0, m_theight, m_width, (m_maxEntriesPerPage + 1) * m_fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0); diff --git a/tuxbox/neutrino/src/gui/widget/hintboxext.h b/tuxbox/neutrino/src/gui/widget/hintboxext.h index 05f9c3a..63fd68c 100644 --- a/tuxbox/neutrino/src/gui/widget/hintboxext.h +++ b/tuxbox/neutrino/src/gui/widget/hintboxext.h @@ -58,6 +58,8 @@ class CHintBoxExt int m_fheight; int m_theight; + int m_ticonheight; + int m_ticonoffset; neutrino_locale_t m_caption; char * m_message; ContentLines m_lines; diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp b/tuxbox/neutrino/src/gui/widget/menue.cpp index a39fd47..bd4db51 100644 --- a/tuxbox/neutrino/src/gui/widget/menue.cpp +++ b/tuxbox/neutrino/src/gui/widget/menue.cpp @@ -626,7 +626,15 @@ void CMenuWidget::paint() if (neededWidth > width - 48) width = w_max(neededWidth + 49, 0); - int hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + int hiconheight = 0, hiconoffset = 0; + if (!iconfile.empty()) + { + int iconw; + frameBuffer->getIconSize(iconfile.c_str(), &iconw, &hiconheight); + hiconoffset = 8 + iconw; + } + + int hheight = std::max(hiconheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); int itemHeightTotal=0; int heightCurrPage=0; @@ -680,15 +688,9 @@ void CMenuWidget::paint() frameBuffer->paintBoxRel(x, y + height - ((c_rad_mid * 2) + 1) + (c_rad_mid / 3 * 2), width + sb_width, ((c_rad_mid * 2) + 1), COL_MENUCONTENT_PLUS_0, c_rad_mid, CORNER_BOTTOM); frameBuffer->paintBoxRel(x, y, width + sb_width, hheight, COL_MENUHEAD_PLUS_0, c_rad_mid, CORNER_TOP); - int head_iconoffset = 0; if (!iconfile.empty()) - { - int iconw, iconh; - frameBuffer->getIconSize(iconfile.c_str(), &iconw, &iconh); - frameBuffer->paintIcon(iconfile, x + 8, y + hheight / 2 - iconh / 2); - head_iconoffset = 8 + iconw; - } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + head_iconoffset + 10, y + hheight + 2, width - head_iconoffset - 10, nameString.c_str(), COL_MENUHEAD, 0, true); // UTF-8 + frameBuffer->paintIcon(iconfile, x + 8, y + hheight / 2 - hiconheight / 2); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + hiconoffset + 10, y + hheight + 2, width - hiconoffset - 10, nameString.c_str(), COL_MENUHEAD, 0, true); // UTF-8 item_start_y = y+hheight; paintItems(); diff --git a/tuxbox/neutrino/src/gui/widget/msgbox.cpp b/tuxbox/neutrino/src/gui/widget/msgbox.cpp index 8b76a5d..0a2b1ba 100644 --- a/tuxbox/neutrino/src/gui/widget/msgbox.cpp +++ b/tuxbox/neutrino/src/gui/widget/msgbox.cpp @@ -98,10 +98,21 @@ CMsgBox::CMsgBox(const char *text, //TRACE("->CMsgBox::CMsgBox\r\n"); initVar(); - if(title != NULL) m_cTitle = title; - if(fontTitle != NULL) m_pcFontTitle = fontTitle; - if(icon != NULL) m_cIcon = icon; - if(position != NULL) m_cBoxFrame = *position; + if(title != NULL) + m_cTitle = title; + if(fontTitle != NULL) + { + m_pcFontTitle = fontTitle; + m_nFontTitleHeight = fontTitle->getHeight(); + } + if(icon != NULL) + { + m_cIcon = icon; + frameBuffer->getIconSize(icon, &m_nTitleIconWidth, &m_nTitleIconHeight); + m_nFontTitleHeight = std::max(m_nTitleIconHeight, m_nFontTitleHeight); + } + if(position != NULL) + m_cBoxFrame = *position; m_nMode = _mode; //TRACE(" CMsgBox::cText: %d ,m_cTitle %d,m_nMode %d\t\r\n",strlen(text),m_cTitle.size(),m_nMode); @@ -445,13 +456,11 @@ void CMsgBox::refreshTitle(void) if (!m_cIcon.empty()) { // draw icon and title text - int iconw, iconh; - CFrameBuffer::getInstance()->getIconSize(m_cIcon.c_str(), &iconw, &iconh); - m_pcWindow->paintIcon(m_cIcon.c_str(), m_cBoxFrameTitleRel.iX + 8, m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight / 2 - iconh / 2); + m_pcWindow->paintIcon(m_cIcon.c_str(), m_cBoxFrameTitleRel.iX + 8, m_cBoxFrameTitleRel.iY + m_cBoxFrameTitleRel.iHeight / 2 - m_nTitleIconHeight / 2); m_pcWindow->RenderString( m_pcFontTitle, - m_cBoxFrameTitleRel.iX + 8 + iconw + TEXT_BORDER_WIDTH, + m_cBoxFrameTitleRel.iX + 8 + m_nTitleIconWidth + TEXT_BORDER_WIDTH, m_cBoxFrameTitleRel.iHeight + 2, - m_cBoxFrameTitleRel.iWidth - 8 - iconw - TEXT_BORDER_WIDTH, + m_cBoxFrameTitleRel.iWidth - 8 - m_nTitleIconWidth - TEXT_BORDER_WIDTH, m_cTitle.c_str(), (CFBWindow::color_t)COL_MENUHEAD, 0, diff --git a/tuxbox/neutrino/src/gui/widget/msgbox.h b/tuxbox/neutrino/src/gui/widget/msgbox.h index 7307ed9..0bb11fb 100644 --- a/tuxbox/neutrino/src/gui/widget/msgbox.h +++ b/tuxbox/neutrino/src/gui/widget/msgbox.h @@ -116,6 +116,8 @@ class CMsgBox Font* m_pcFontTitle; int m_nFontTitleHeight; + int m_nTitleIconWidth; + int m_nTitleIconHeight; Font* m_pcFontFoot; int m_nFontFootHeight; diff --git a/tuxbox/neutrino/src/gui/widget/stringinput.cpp b/tuxbox/neutrino/src/gui/widget/stringinput.cpp index 886b2b1..a2fd32f 100644 --- a/tuxbox/neutrino/src/gui/widget/stringinput.cpp +++ b/tuxbox/neutrino/src/gui/widget/stringinput.cpp @@ -64,7 +64,10 @@ CStringInput::CStringInput(const neutrino_locale_t Name, char* Value, int Size, hint_1 = Hint_1; hint_2 = Hint_2; validchars = Valid_Chars; + iconfile = Icon ? Icon : ""; + hiconheight = 0; + hiconoffset = 0; observ = Observ; } @@ -87,7 +90,10 @@ CStringInput::CStringInput(const neutrino_locale_t Name, std::string* Value, int hint_1 = Hint_1; hint_2 = Hint_2; validchars = Valid_Chars; + iconfile = Icon ? Icon : ""; + hiconheight = 0; + hiconoffset = 0; observ = Observ; } @@ -108,12 +114,17 @@ void CStringInput::init() width = 420; int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name), true); // UTF-8 - if (!(iconfile.empty())) - neededWidth += 28; + if (!iconfile.empty()) + { + int iconw; + frameBuffer->getIconSize(iconfile.c_str(), &iconw, &hiconheight); + hiconoffset = 8 + iconw; + neededWidth += hiconoffset; + } if (neededWidth+20> width) width = neededWidth+20; - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + hheight = std::max(hiconheight, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); @@ -456,22 +467,14 @@ const char * CStringInput::getHint1(void) void CStringInput::paint() { - int iconoffset, c_rad_mid = RADIUS_MID; + int c_rad_mid = RADIUS_MID; frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, c_rad_mid, CORNER_TOP); frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, c_rad_mid, CORNER_BOTTOM); - if (!(iconfile.empty())) - { - int iconw, iconh; - frameBuffer->getIconSize(iconfile.c_str(), &iconw, &iconh); - frameBuffer->paintIcon(iconfile, x + 8, y + hheight / 2 - iconh / 2); - iconoffset = 8 + iconw; - } - else - iconoffset = 0; - - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + iconoffset + 10, y + hheight + 2, width - iconoffset - 10, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 + if (!iconfile.empty()) + frameBuffer->paintIcon(iconfile, x + 8, y + hheight / 2 - hiconheight / 2); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + hiconoffset + 10, y + hheight + 2, width - hiconoffset - 10, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8 if (hint_1 != NONEXISTANT_LOCALE) { diff --git a/tuxbox/neutrino/src/gui/widget/stringinput.h b/tuxbox/neutrino/src/gui/widget/stringinput.h index 403cab4..16c5665 100644 --- a/tuxbox/neutrino/src/gui/widget/stringinput.h +++ b/tuxbox/neutrino/src/gui/widget/stringinput.h @@ -50,6 +50,8 @@ class CStringInput : public CMenuTarget int width; int height; int hheight; // head font height + int hiconheight; + int hiconoffset; int mheight; // menu font height int iheight; ----------------------------------------------------------------------- Summary of changes: tuxbox/neutrino/src/gui/audioplayer.cpp | 12 ++++---- tuxbox/neutrino/src/gui/audioplayer.h | 2 + tuxbox/neutrino/src/gui/bookmarkmanager.cpp | 12 +++---- tuxbox/neutrino/src/gui/bookmarkmanager.h | 2 + tuxbox/neutrino/src/gui/channellist.cpp | 8 ----- tuxbox/neutrino/src/gui/moviebrowser.cpp | 13 ++++---- tuxbox/neutrino/src/gui/moviebrowser.h | 2 + tuxbox/neutrino/src/gui/pictureviewer.cpp | 13 +++----- tuxbox/neutrino/src/gui/pictureviewer.h | 2 + tuxbox/neutrino/src/gui/pluginlist.cpp | 27 +++++++++-------- tuxbox/neutrino/src/gui/pluginlist.h | 3 ++ tuxbox/neutrino/src/gui/timerlist.cpp | 11 +++---- tuxbox/neutrino/src/gui/timerlist.h | 2 + tuxbox/neutrino/src/gui/upnpbrowser.cpp | 17 +++++------ tuxbox/neutrino/src/gui/upnpbrowser.h | 2 + tuxbox/neutrino/src/gui/widget/hintbox.cpp | 35 ++++++++++++----------- tuxbox/neutrino/src/gui/widget/hintbox.h | 2 + tuxbox/neutrino/src/gui/widget/hintboxext.cpp | 36 ++++++++++++----------- tuxbox/neutrino/src/gui/widget/hintboxext.h | 2 + tuxbox/neutrino/src/gui/widget/menue.cpp | 20 +++++++------ tuxbox/neutrino/src/gui/widget/msgbox.cpp | 27 ++++++++++++------ tuxbox/neutrino/src/gui/widget/msgbox.h | 2 + tuxbox/neutrino/src/gui/widget/stringinput.cpp | 33 ++++++++++++---------- tuxbox/neutrino/src/gui/widget/stringinput.h | 2 + 24 files changed, 157 insertions(+), 130 deletions(-) -- Tuxbox-GIT: apps ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Tuxbox-cvs-commits mailing list Tuxbox-cvs-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits