[Commits] : Tuxbox-GIT: apps branch master updated. CVS-Final-154-g76fec78
Tuxbox Sources
Brought to you by:
dbt1
From: Thilo G. <tux...@ne...> - 2013-05-09 18:06:21
|
Project "Tuxbox-GIT: apps": The branch, master has been updated via 76fec7853d6086cbcca771c9f11e6d6259db6523 (commit) via 4f495f8890d473467c0ca82a93feefc4a6619f5f (commit) via 6fdce193e126b597d767c9147b4766e9612a2bb2 (commit) from 3883256691d2c786e72622a986a6aa57a78c5e28 (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 76fec7853d6086cbcca771c9f11e6d6259db6523 Author: GetAway <get...@t-...> Date: Thu May 9 17:56:26 2013 +0200 menu.cpp: clean only the width that has been drawn Signed-off-by: Thilo Graf <db...@no...> diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp b/tuxbox/neutrino/src/gui/widget/menue.cpp index d73152c..a39fd47 100644 --- a/tuxbox/neutrino/src/gui/widget/menue.cpp +++ b/tuxbox/neutrino/src/gui/widget/menue.cpp @@ -606,7 +606,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) void CMenuWidget::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width + 15 + SHADOW_OFFSET, height + (CORNER_RADIUS_MID / 3 * 2) + SHADOW_OFFSET); + frameBuffer->paintBackgroundBoxRel(x, y, width + sb_width + SHADOW_OFFSET, height + (CORNER_RADIUS_MID / 3 * 2) + SHADOW_OFFSET); /* x = -1 is a marker which prevents the item from being painted on setActive changes */ for (unsigned int count = 0; count < items.size(); count++) @@ -669,11 +669,7 @@ void CMenuWidget::paint() if(hheight+itemHeightTotal < height) height=hheight+itemHeightTotal; - int sb_width; - if(total_pages > 1) - sb_width=15; - else - sb_width=0; + sb_width = (total_pages > 1) ? 15 : 0; int c_rad_mid = RADIUS_MID; diff --git a/tuxbox/neutrino/src/gui/widget/menue.h b/tuxbox/neutrino/src/gui/widget/menue.h index be6de3d..1a0de0a 100644 --- a/tuxbox/neutrino/src/gui/widget/menue.h +++ b/tuxbox/neutrino/src/gui/widget/menue.h @@ -307,6 +307,7 @@ class CMenuWidget : public CMenuTarget std::string iconfile; int width; + int sb_width; int height; int wanted_height; int x; commit 4f495f8890d473467c0ca82a93feefc4a6619f5f Author: Christian Schuett <Gau...@ho...> Date: Thu May 9 15:10:39 2013 +0200 Neutrino: always calculate button bar height and ... ... consider it when calculating start pos Signed-off-by: Christian Schuett <Gau...@ho...> Signed-off-by: Thilo Graf <db...@no...> diff --git a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_bouquets.cpp b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_bouquets.cpp index 428c217..cfabcf4 100644 --- a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -144,9 +144,10 @@ struct button_label CBEBouquetWidgetButtons1[5] = void CBEBouquetWidget::paintFoot() { - frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + int fy = y + height - ButtonHeight; + int ButtonWidth = (width - 10) / 5; + frameBuffer->paintBoxRel(x, fy, width, ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); // frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); - switch( blueFunction) { case beRename: @@ -159,12 +160,12 @@ void CBEBouquetWidget::paintFoot() CBEBouquetWidgetButtons1[4].locale = LOCALE_BOUQUETEDITOR_LOCK; break; } - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, y + height + 2, (width - 10) / 5, 5, CBEBouquetWidgetButtons1); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, fy + 2, ButtonWidth, 5, CBEBouquetWidgetButtons1); } void CBEBouquetWidget::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height+ButtonHeight); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); } void CBEBouquetWidget::updateSelection(unsigned int newpos) @@ -201,13 +202,13 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string&) int res = menu_return::RETURN_REPAINT; width = w_max (550, 0); - height = h_max (440, 50); + height = h_max (465, 50); - ButtonHeight = 25; + ButtonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - theight - ButtonHeight - 0) / fheight; + height = theight + ButtonHeight + 0 + listmaxshow * fheight; // recalc height x = getScreenStartX (width); y = getScreenStartY (height); diff --git a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_channels.cpp b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_channels.cpp index 29200b8..4430bb5 100644 --- a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_channels.cpp +++ b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_channels.cpp @@ -141,13 +141,15 @@ const struct button_label CBEChannelWidgetButtons[4] = void CBEChannelWidget::paintFoot() { - frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, (width - 20) / 4, 4, CBEChannelWidgetButtons); + int fy = y + height - ButtonHeight; + int ButtonWidth = (width - 20) / 4; + frameBuffer->paintBoxRel(x, fy, width, ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, fy + 2, ButtonWidth, 4, CBEChannelWidgetButtons); } void CBEChannelWidget::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height+ButtonHeight); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); } void CBEChannelWidget::updateSelection(unsigned int newpos) @@ -184,12 +186,12 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string &) int res = menu_return::RETURN_REPAINT; width = w_max (550, 0); - height = h_max (440, 50); - ButtonHeight = 25; + height = h_max (465, 50); + ButtonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - listmaxshow = (height-theight-0)/fheight; - height = theight + 0 + listmaxshow * fheight; // recalc height + listmaxshow = (height - theight - ButtonHeight - 0) / fheight; + height = theight + ButtonHeight + 0 + listmaxshow * fheight; // recalc height x = getScreenStartX (width); y = getScreenStartY (height); diff --git a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_chanselect.cpp b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_chanselect.cpp index ac13741..739d641 100644 --- a/tuxbox/neutrino/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/tuxbox/neutrino/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -54,14 +54,13 @@ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsi bouquet = Bouquet; mode = Mode; - width = w_max (550, 0); - height = h_max (440, 50); - ButtonHeight = 25; - + width = w_max (550, 0); + height = h_max (465, 50); + ButtonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - theight - ButtonHeight - 0) / fheight; + height = theight + ButtonHeight + 0 + listmaxshow * fheight; // recalc height x = getScreenStartX (width); y = getScreenStartY (height); liststart = 0; @@ -168,8 +167,8 @@ const struct button_label CBEBouquetSelectWidgetButtons[2] = void CBEChannelSelectWidget::paintFoot() { - int y_foot = y + height; + int y_foot = y + height - ButtonHeight; + int ButtonWidth = (width - 10) / 2; frameBuffer->paintBoxRel(x, y_foot, width, ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, y_foot, (width - 10) / 2, 2, CBEBouquetSelectWidgetButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 5, y_foot + 2, ButtonWidth, 2, CBEBouquetSelectWidgetButtons); } diff --git a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp index 8bd46ff..66b2ef0 100644 --- a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp +++ b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp @@ -442,15 +442,12 @@ const struct button_label BookmarkmanagerButtonOK[1] = //------------------------------------------------------------------------ void CBookmarkManager::paintFoot() { + int y_foot = y + height - footHeight; int ButtonWidth = (width - 20) / 4; - - frameBuffer->paintBoxRel(x, y + height - footHeight, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + width - 1 * ButtonWidth, y + height - footHeight, ButtonWidth, 1, BookmarkmanagerButtonOK); - + frameBuffer->paintBoxRel(x, y_foot, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + width - 1 * ButtonWidth, y_foot, ButtonWidth, 1, BookmarkmanagerButtonOK); if (!bookmarks.empty()) - { - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height - footHeight, ButtonWidth, 2, BookmarkmanagerButtons); - } + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y_foot, ButtonWidth, 2, BookmarkmanagerButtons); } //------------------------------------------------------------------------ diff --git a/tuxbox/neutrino/src/gui/bouquetlist.cpp b/tuxbox/neutrino/src/gui/bouquetlist.cpp index 9f0a62e..3a28a1f 100644 --- a/tuxbox/neutrino/src/gui/bouquetlist.cpp +++ b/tuxbox/neutrino/src/gui/bouquetlist.cpp @@ -168,14 +168,15 @@ int CBouquetList::show() int res = -1; width = w_max (500, 0); - height = h_max (440, 40); + height = h_max (465, 40); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - listmaxshow = (height-theight-0)/fheight; - height = theight + listmaxshow * fheight; // recalc height + footHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; + listmaxshow = (height - theight - footHeight - 0) / fheight; + height = theight + footHeight + listmaxshow * fheight; // recalc height x = getScreenStartX (width); - y = getScreenStartY (height) - theight/2; + y = getScreenStartY (height); if (Bouquets.empty()) { @@ -305,7 +306,7 @@ int CBouquetList::show() void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height + theight); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); } void CBouquetList::paintItem(int pos) @@ -394,11 +395,10 @@ void CBouquetList::paint() frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); //footbar - int fy = y + theight + listmaxshow * fheight ; + int fy = y + height - footHeight; int ButtonWith = (width - 8) / 3; - int icony = fy + theight / 2 - 12; - frameBuffer->paintBoxRel(x, fy, width, theight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 4, icony, ButtonWith, 6, CBouquetListButtons); + frameBuffer->paintBoxRel(x, fy, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 4, fy + 2, ButtonWith, 6, CBouquetListButtons); } void CBouquetList::updateSelection(unsigned int newpos) diff --git a/tuxbox/neutrino/src/gui/bouquetlist.h b/tuxbox/neutrino/src/gui/bouquetlist.h index 468ccba..a541c3c 100644 --- a/tuxbox/neutrino/src/gui/bouquetlist.h +++ b/tuxbox/neutrino/src/gui/bouquetlist.h @@ -83,6 +83,7 @@ class CBouquetList unsigned int maxpos; int fheight; // Fonthoehe Bouquetlist-Inhalt int theight; // Fonthoehe Bouquetlist-Titel + int footHeight; int width; int height; diff --git a/tuxbox/neutrino/src/gui/epgview.cpp b/tuxbox/neutrino/src/gui/epgview.cpp index 1d9f964..96ed31f 100644 --- a/tuxbox/neutrino/src/gui/epgview.cpp +++ b/tuxbox/neutrino/src/gui/epgview.cpp @@ -125,16 +125,18 @@ void CEpgData::start() /* This defines the size of the EPG window. We leave 35 pixels left and right, * 25 pixels top and bottom. It adjusts itself to the "visible screen" settings */ - ox = w_max (768, 70); - oy = h_max (576, 50 + 30); // 30 for the bottom button box. + ox = w_max (720, 70); + oy = h_max (576, 50); topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); topboxheight = topheight + 6; botheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); botboxheight = botheight + 6; + buttonheight = std::max(16, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) + BUTTONBAR_FONT_OFFSET; sx = getScreenStartX (ox); - sy = getScreenStartY (oy) - 30/2; + sy = getScreenStartY (oy); + oy -= buttonheight; /* this is the text box height - and the height of the scroll bar */ sb = oy - topboxheight - botboxheight; medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); @@ -457,9 +459,6 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_ startzeit=*a_startzeit; id=a_id; - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); - int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + BUTTONBAR_FONT_OFFSET; - GetEPGData(channel_id, id, &startzeit ); if (doLoop) { @@ -636,11 +635,11 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_ { if( tags[i].streamContent == 1 && (tags[i].componentType == 2 || tags[i].componentType == 3) ) { - frameBuffer->paintIcon(NEUTRINO_ICON_16_9, ox + sx - (ICON_LARGE_WIDTH + 2 ) - (ICON_LARGE_WIDTH + 2) - 4, sy + oy + (fheight >> 1) - (ICON_HEIGHT >> 1)); + frameBuffer->paintIcon(NEUTRINO_ICON_16_9, ox + sx - (ICON_LARGE_WIDTH + 2 ) - (ICON_LARGE_WIDTH + 2) - 4, sy + oy + (buttonheight >> 1) - (ICON_HEIGHT >> 1)); } else if( tags[i].streamContent == 2 && tags[i].componentType == 5 ) { - frameBuffer->paintIcon(NEUTRINO_ICON_DD, ox + sx - (ICON_LARGE_WIDTH + 2) - 4, sy + oy + (fheight >> 1) - (ICON_HEIGHT >> 1)); + frameBuffer->paintIcon(NEUTRINO_ICON_DD, ox + sx - (ICON_LARGE_WIDTH + 2) - 4, sy + oy + (buttonheight >> 1) - (ICON_HEIGHT >> 1)); } } } @@ -648,7 +647,7 @@ int CEpgData::show(const t_channel_id channel_id, unsigned long long a_id, time_ if ( epg_done!= -1 ) //show event progressbar { CProgressBar pb(true, -1, -1, 100, 0, 0, true); //only green color - pb.paintProgressBarDefault (sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1), sy+oy-height, 104, height-6, epg_done, 100); + pb.paintProgressBarDefault (sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1), sy+oy-botheight, 104, botheight-6, epg_done, 100); } GetPrevNextEPGData( epgData.eventID, &epgData.epg_times.startzeit ); @@ -874,7 +873,7 @@ void CEpgData::hide() } frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); - showTimerEventBar (false); + showTimerEventBar(false); } void CEpgData::GetEPGData(const t_channel_id channel_id, unsigned long long id, time_t* startzeit ) @@ -1009,17 +1008,16 @@ const struct button_label epgviewButtons[3] = void CEpgData::showTimerEventBar(bool _show) { int ButtonWidth = (ox - 16) / 4; // 4 cells - int fheight = std::max(16, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) + BUTTONBAR_FONT_OFFSET; - int by = sy + oy + (fheight >> 3) - 1; + int by = sy + oy + 2; // hide only? if (! _show) { - frameBuffer->paintBackgroundBoxRel(sx, sy + oy, ox, fheight); + frameBuffer->paintBackgroundBoxRel(sx, sy + oy, ox, buttonheight); return; } - frameBuffer->paintBoxRel(sx, sy + oy, ox, fheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + frameBuffer->paintBoxRel(sx, sy + oy, ox, buttonheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); // Button: Timer Record & Channelswitch if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) diff --git a/tuxbox/neutrino/src/gui/epgview.h b/tuxbox/neutrino/src/gui/epgview.h index 5d8872e..43356f2 100644 --- a/tuxbox/neutrino/src/gui/epgview.h +++ b/tuxbox/neutrino/src/gui/epgview.h @@ -75,6 +75,7 @@ class CEpgData std::vector<epg_pair> epgText; int topheight,topboxheight; int botheight,botboxheight; + int buttonheight; int medlineheight,medlinecount; bool bigFonts; diff --git a/tuxbox/neutrino/src/gui/imageinfo.cpp b/tuxbox/neutrino/src/gui/imageinfo.cpp index 177a9f9..e44739d 100644 --- a/tuxbox/neutrino/src/gui/imageinfo.cpp +++ b/tuxbox/neutrino/src/gui/imageinfo.cpp @@ -534,8 +534,9 @@ const struct button_label CImageInfoButtons[5] = void CImageInfo::paintFoot(int xf, int yf) { + int ButtonWidth = (width - 10) / 5; frameBuffer->paintBoxRel(xf, yf, width, ssheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, xf + 5, yf, (width - 10) / 5, 5, CImageInfoButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, xf + 5, yf, ButtonWidth, 5, CImageInfoButtons); } void CImageInfo::paint() diff --git a/tuxbox/neutrino/src/gui/timerlist.cpp b/tuxbox/neutrino/src/gui/timerlist.cpp index 32821f4..698a675 100644 --- a/tuxbox/neutrino/src/gui/timerlist.cpp +++ b/tuxbox/neutrino/src/gui/timerlist.cpp @@ -768,14 +768,13 @@ const struct button_label TimerListButtons[5] = void CTimerList::paintFoot() { + int y_foot = y + height - footHeight; int ButtonWidth = (width - 20) / 5; - - frameBuffer->paintBoxRel(x, y + height - footHeight, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - + frameBuffer->paintBoxRel(x, y_foot, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); if (timerlist.empty()) - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10 + ButtonWidth, y + height - footHeight, ButtonWidth, 3, &(TimerListButtons[1])); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10 + ButtonWidth, y_foot, ButtonWidth, 3, &(TimerListButtons[1])); else - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height - footHeight, ButtonWidth, 5, TimerListButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y_foot, ButtonWidth, 5, TimerListButtons); } void CTimerList::paint() diff --git a/tuxbox/neutrino/src/gui/widget/listbox.cpp b/tuxbox/neutrino/src/gui/widget/listbox.cpp index 8111d98..79ad79f 100644 --- a/tuxbox/neutrino/src/gui/widget/listbox.cpp +++ b/tuxbox/neutrino/src/gui/widget/listbox.cpp @@ -40,13 +40,13 @@ CListBox::CListBox(const char * const Caption) liststart = 0; selected = 0; width = w_max (400, 100); - height = h_max (420, 0); - ButtonHeight = 25; + height = h_max (445, 0); + ButtonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; modified = false; theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); - listmaxshow = (height-theight-0)/fheight; - height = theight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - theight - ButtonHeight - 0) / fheight; + height = theight + ButtonHeight + 0 + listmaxshow * fheight; // recalc height x = getScreenStartX (width); y = getScreenStartY (height); } @@ -58,7 +58,7 @@ void CListBox::setModified(void) void CListBox::paint() { - int c_rad_small = RADIUS_SMALL;; + int c_rad_small = RADIUS_SMALL; liststart = (selected/listmaxshow)*listmaxshow; int ypos = y+ theight; int sb = fheight* listmaxshow; @@ -85,21 +85,23 @@ void CListBox::paintHead() void CListBox::paintFoot() { + int y_foot = y + height - ButtonHeight; + int y_text = y + height - 2; int ButtonWidth = width / 4; - frameBuffer->paintBoxRel(x,y+height, width,ButtonHeight, COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x, y_foot, width, ButtonHeight, COL_MENUHEAD_PLUS_0); frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 4* ButtonWidth+ 8, y+height+1); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 4* ButtonWidth+ 38, y+height+24 - 2, width, "edit", COL_INFOBAR); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + width - 4 * ButtonWidth + 8, y_foot + 1); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + width - 4 * ButtonWidth + 38, y_text, width, "edit", COL_INFOBAR); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+width- 3* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 29, y+height+24 - 2, width- 26, "add", COL_INFOBAR); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x + width - 3 * ButtonWidth + 8, y_foot + 4); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + width - 3 * ButtonWidth + 29, y_text, width - 26, "add", COL_INFOBAR); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+width- 2* ButtonWidth+ 8, y+height+4); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 2* ButtonWidth+ 29, y+height+24 - 2, width- 26, "remove", COL_INFOBAR); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x + width - 2 * ButtonWidth + 8, y_foot + 4); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + width - 2 * ButtonWidth + 29, y_text, width - 26, "remove", COL_INFOBAR); - 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, "ready", COL_INFOBAR); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x + width - ButtonWidth + 8, y_foot + 1); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + width - ButtonWidth + 38, y_text, width, "ready", COL_INFOBAR); } void CListBox::paintItem(int pos) @@ -109,7 +111,7 @@ void CListBox::paintItem(int pos) void CListBox::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height+ButtonHeight); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); } void CListBox::updateSelection(unsigned int newpos) diff --git a/tuxbox/neutrino/src/gui/widget/stringinput.cpp b/tuxbox/neutrino/src/gui/widget/stringinput.cpp index 1adff4b..886b2b1 100644 --- a/tuxbox/neutrino/src/gui/widget/stringinput.cpp +++ b/tuxbox/neutrino/src/gui/widget/stringinput.cpp @@ -671,19 +671,20 @@ const struct button_label CStringInputSMSButtons[2] = void CStringInputSMS::paint() { - height+=260; - y = ((500-height)>>1); + int iconw, iconh; + frameBuffer->getIconSize(NEUTRINO_ICON_NUMERIC_PAD, &iconw, &iconh); + int ButtonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; + height += iheight + 30 + iconh + 25 + ButtonHeight; + y = getScreenStartY(height); CStringInput::paint(); - int iconw, iconh; - frameBuffer->getIconSize(NEUTRINO_ICON_NUMERIC_PAD, &iconw, &iconh); frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x + width / 2 - iconw / 2, y + hheight + mheight + iheight * 3 + 30, COL_MENUCONTENT); - int c_rad_mid = RADIUS_MID; - frameBuffer->paintBoxRel(x, y + height - 25, width, 25, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, CORNER_BOTTOM); - - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y + height - 25, (width - 16) / 2, 2, CStringInputSMSButtons); + int y_foot = y + height - ButtonHeight; + int ButtonWidth = (width - 16) / 2; + frameBuffer->paintBoxRel(x, y_foot, width, ButtonHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y_foot + 2, ButtonWidth, 2, CStringInputSMSButtons); } void CPINInput::paintChar(int pos) commit 6fdce193e126b597d767c9147b4766e9612a2bb2 Author: Christian Schuett <Gau...@ho...> Date: Sun May 5 19:40:08 2013 +0200 Neutrino: fix height calculation in bookmark manager and timer list Signed-off-by: Christian Schuett <Gau...@ho...> Signed-off-by: Thilo Graf <db...@no...> diff --git a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp index 30da28a..8bd46ff 100644 --- a/tuxbox/neutrino/src/gui/bookmarkmanager.cpp +++ b/tuxbox/neutrino/src/gui/bookmarkmanager.cpp @@ -53,8 +53,6 @@ #include <sys/types.h> #include <unistd.h> -#define info_height 60 - #include <driver/screen_max.h> CBookmark::CBookmark(const std::string & inName, const std::string & inUrl, const std::string & inTime) @@ -235,15 +233,17 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) frameBuffer->getIconSize(NEUTRINO_ICON_BOOKMARKMANAGER, &iconw, &iconh); theight = std::max(iconh, 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()); liststart = 0; - height = h_max(576, info_height+50); - listmaxshow = (height-theight-0)/(fheight*2); - height = theight+0+listmaxshow*fheight*2; // recalc height + height = h_max(576, 50); + listmaxshow = (height-theight-footHeight-0)/(fheight*2); + height = theight+footHeight+0+listmaxshow*fheight*2; // recalc height if(bookmarks.size() < listmaxshow) { listmaxshow=bookmarks.size(); - height = theight+0+listmaxshow*fheight*2; // recalc height + height = theight+footHeight+0+listmaxshow*fheight*2; // recalc height } if (!bookmarks.empty() && selected==bookmarks.size()) { @@ -251,7 +251,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) liststart = (selected/listmaxshow)*listmaxshow; } x = getScreenStartX (width); - y = getScreenStartY (height + info_height); + y = getScreenStartY (height); int res = -1; @@ -403,7 +403,7 @@ void CBookmarkManager::hide() { if(visible) { - frameBuffer->paintBackgroundBoxRel(x, y, width, height+ info_height+ 5); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); visible = false; } } @@ -443,16 +443,13 @@ const struct button_label BookmarkmanagerButtonOK[1] = void CBookmarkManager::paintFoot() { int ButtonWidth = (width - 20) / 4; - int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iconw, &iconh); - int footHeight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); - frameBuffer->paintBoxRel(x, y + height, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + width - 1 * ButtonWidth, y + height, ButtonWidth, 1, BookmarkmanagerButtonOK); + frameBuffer->paintBoxRel(x, y + height - footHeight, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + width - 1 * ButtonWidth, y + height - footHeight, ButtonWidth, 1, BookmarkmanagerButtonOK); if (!bookmarks.empty()) { - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, ButtonWidth, 2, BookmarkmanagerButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height - footHeight, ButtonWidth, 2, BookmarkmanagerButtons); } } diff --git a/tuxbox/neutrino/src/gui/bookmarkmanager.h b/tuxbox/neutrino/src/gui/bookmarkmanager.h index 1e351fd..5a13144 100644 --- a/tuxbox/neutrino/src/gui/bookmarkmanager.h +++ b/tuxbox/neutrino/src/gui/bookmarkmanager.h @@ -74,6 +74,7 @@ class CBookmarkManager unsigned int listmaxshow; int fheight; //fontheight timerlist-content (text) int theight; //fontheight timerlist-title + int footHeight; bool visible; int width; int height; diff --git a/tuxbox/neutrino/src/gui/timerlist.cpp b/tuxbox/neutrino/src/gui/timerlist.cpp index c5b86bb..32821f4 100644 --- a/tuxbox/neutrino/src/gui/timerlist.cpp +++ b/tuxbox/neutrino/src/gui/timerlist.cpp @@ -76,8 +76,6 @@ #include <string.h> #include <algorithm> -#define INFO_HEIGHT 60 - class CTimerListNewNotifier : public CChangeObserver { @@ -414,13 +412,13 @@ void CTimerList::updateEvents(void) sort(timerlist.begin(), timerlist.end()); width = w_max(600, 50); - height = h_max(576, INFO_HEIGHT+50); - listmaxshow = (height-theight-0)/(fheight*2); - height = theight+0+listmaxshow*fheight*2; // recalc height + height = h_max(576, 50); + listmaxshow = (height-theight-footHeight-0)/(fheight*2); + height = theight+footHeight+0+listmaxshow*fheight*2; // recalc height if(timerlist.size() < listmaxshow) { listmaxshow=timerlist.size(); - height = theight+0+listmaxshow*fheight*2; // recalc height + height = theight+footHeight+0+listmaxshow*fheight*2; // recalc height } if (!timerlist.empty() && selected==timerlist.size()) { @@ -429,7 +427,7 @@ void CTimerList::updateEvents(void) } x = getScreenStartX (width); - y = getScreenStartY (height+INFO_HEIGHT); + y = getScreenStartY (height); } @@ -439,6 +437,8 @@ int CTimerList::show() frameBuffer->getIconSize(NEUTRINO_ICON_TIMER, &iconw, &iconh); theight = std::max(iconh, 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()); time_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("00.00. 00:00 "); neutrino_msg_t msg; @@ -572,7 +572,7 @@ void CTimerList::hide() { if(visible) { - frameBuffer->paintBackgroundBoxRel(x, y, width, height+ INFO_HEIGHT+ 5); + frameBuffer->paintBackgroundBoxRel(x, y, width, height); visible = false; } } @@ -769,16 +769,13 @@ const struct button_label TimerListButtons[5] = void CTimerList::paintFoot() { int ButtonWidth = (width - 20) / 5; - int iconw = 0, iconh = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iconw, &iconh); - int footHeight = std::max(iconh, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()); - frameBuffer->paintBoxRel(x, y + height, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + height - footHeight, width, footHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); if (timerlist.empty()) - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10 + ButtonWidth, y + height, ButtonWidth, 3, &(TimerListButtons[1])); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10 + ButtonWidth, y + height - footHeight, ButtonWidth, 3, &(TimerListButtons[1])); else - ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height, ButtonWidth, 5, TimerListButtons); + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + height - footHeight, ButtonWidth, 5, TimerListButtons); } void CTimerList::paint() diff --git a/tuxbox/neutrino/src/gui/timerlist.h b/tuxbox/neutrino/src/gui/timerlist.h index 716d613..1cc5b91 100644 --- a/tuxbox/neutrino/src/gui/timerlist.h +++ b/tuxbox/neutrino/src/gui/timerlist.h @@ -51,6 +51,7 @@ class CTimerList : public CMenuTarget unsigned int listmaxshow; int fheight; //fontheight timerlist-content (text) int theight; //fontheight timerlist-title + int footHeight; int time_width; bool visible; ----------------------------------------------------------------------- Summary of changes: .../src/gui/bedit/bouqueteditor_bouquets.cpp | 17 +++++----- .../src/gui/bedit/bouqueteditor_channels.cpp | 16 +++++---- .../src/gui/bedit/bouqueteditor_chanselect.cpp | 17 +++++----- tuxbox/neutrino/src/gui/bookmarkmanager.cpp | 30 +++++++----------- tuxbox/neutrino/src/gui/bookmarkmanager.h | 1 + tuxbox/neutrino/src/gui/bouquetlist.cpp | 18 +++++----- tuxbox/neutrino/src/gui/bouquetlist.h | 1 + tuxbox/neutrino/src/gui/epgview.cpp | 26 +++++++-------- tuxbox/neutrino/src/gui/epgview.h | 1 + tuxbox/neutrino/src/gui/imageinfo.cpp | 3 +- tuxbox/neutrino/src/gui/timerlist.cpp | 28 +++++++---------- tuxbox/neutrino/src/gui/timerlist.h | 1 + tuxbox/neutrino/src/gui/widget/listbox.cpp | 32 ++++++++++--------- tuxbox/neutrino/src/gui/widget/menue.cpp | 8 +---- tuxbox/neutrino/src/gui/widget/menue.h | 1 + tuxbox/neutrino/src/gui/widget/stringinput.cpp | 17 +++++----- 16 files changed, 106 insertions(+), 111 deletions(-) -- Tuxbox-GIT: apps |