Thread: [Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-184-g4321a0a
Tuxbox Sources
Brought to you by:
dbt1
|
From: Thilo G. <tux...@ne...> - 2013-06-03 18:32:10
|
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 <Gau...@ho...>
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 <Gau...@ho...>
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_nFontTitl...
[truncated message content] |