- add and use OFFSET_INTER definition

This commit is contained in:
svenhoefer
2016-10-10 14:19:55 +02:00
parent 5d450c60d3
commit 98500fdeb6
7 changed files with 19 additions and 23 deletions

View File

@@ -228,7 +228,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
{
int xpos = x - ConnectLineBox_Width;
int ypos1 = y + theight+0 + pos*iheight;
int ypos2 = y + height + INFO_BOX_Y_OFFSET;
int ypos2 = y + height + OFFSET_INTER;
int ypos1a = ypos1 + (fheight/2);
int ypos2a = ypos2 + (info_height/2);

View File

@@ -290,7 +290,7 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
{
int xpos = x - ConnectLineBox_Width;
int ypos1 = y + theight+0 + pos*iheight;
int ypos2 = y + height + INFO_BOX_Y_OFFSET;
int ypos2 = y + height + OFFSET_INTER;
int ypos1a = ypos1 + (fheight/2);
int ypos2a = ypos2 + (info_height/2);

View File

@@ -41,7 +41,6 @@ InfoBox has been originally intended for displaying text information or menue hi
but is also usable like each other CCItems.
*/
#define INFO_BOX_Y_OFFSET 2
class CComponentsInfoBox : public CComponentsText
{
private:

View File

@@ -148,8 +148,6 @@ const CMenuOptionChooser::keyval MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS[MESSAGEBOX_
#define TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]
#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]
#define INTER_FRAME_SPACE 4 // space between e.g. upper and lower window
const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] =
{
LOCALE_MOVIEBROWSER_SHORT_FILENAME,
@@ -511,18 +509,18 @@ void CMovieBrowser::initFrames(void)
m_cBoxFrameLastPlayList.iX = m_cBoxFrameBrowserList.iX;
m_cBoxFrameLastPlayList.iY = m_cBoxFrameBrowserList.iY ;
m_cBoxFrameLastPlayList.iWidth = (m_cBoxFrameBrowserList.iWidth>>1) - (INTER_FRAME_SPACE>>1);
m_cBoxFrameLastPlayList.iWidth = (m_cBoxFrameBrowserList.iWidth>>1) - (OFFSET_INTER>>1);
m_cBoxFrameLastPlayList.iHeight = m_cBoxFrameBrowserList.iHeight;
m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth + INTER_FRAME_SPACE;
m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth + OFFSET_INTER;
m_cBoxFrameLastRecordList.iY = m_cBoxFrameLastPlayList.iY;
m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth - INTER_FRAME_SPACE;
m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth - OFFSET_INTER;
m_cBoxFrameLastRecordList.iHeight = m_cBoxFrameLastPlayList.iHeight;
m_cBoxFrameInfo.iX = m_cBoxFrameBrowserList.iX;
m_cBoxFrameInfo.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight + INTER_FRAME_SPACE;
m_cBoxFrameInfo.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight + OFFSET_INTER;
m_cBoxFrameInfo.iWidth = m_cBoxFrameBrowserList.iWidth;
m_cBoxFrameInfo.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - INTER_FRAME_SPACE - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight;
m_cBoxFrameInfo.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - OFFSET_INTER - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight;
m_cBoxFrameFilter.iX = m_cBoxFrameInfo.iX;
m_cBoxFrameFilter.iY = m_cBoxFrameInfo.iY;

View File

@@ -81,8 +81,6 @@ CUpnpBrowserGui::CUpnpBrowserGui()
CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit);
}
#define INNER_OFFSET OFFSET_SHADOW
void CUpnpBrowserGui::Init()
{
font_item = SNeutrinoSettings::FONT_TYPE_MENU;
@@ -125,19 +123,19 @@ void CUpnpBrowserGui::Init()
/* From top to bottom we have:
*
* topbox (with shadow)
* INNER_OFFSET
* OFFSET_INTER
* mainwindow (with shadow)
* - header
* - body (items*listshowmax)
* - footer
* INNER_OFFSET
* OFFSET_INTER
* infobox/timebox (with shadow)
*/
m_listmaxshow = (m_height - m_topbox_height - OFFSET_SHADOW - INNER_OFFSET - m_header_height - m_footer_height - OFFSET_SHADOW - INNER_OFFSET - m_infobox_height - OFFSET_SHADOW) / (m_item_height);
m_listmaxshow = (m_height - m_topbox_height - OFFSET_SHADOW - OFFSET_INTER - m_header_height - m_footer_height - OFFSET_SHADOW - OFFSET_INTER - m_infobox_height - OFFSET_SHADOW) / (m_item_height);
// recalc height
m_height = m_topbox_height + OFFSET_SHADOW + INNER_OFFSET + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + OFFSET_SHADOW + INNER_OFFSET + m_infobox_height + OFFSET_SHADOW;
m_height = m_topbox_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + OFFSET_SHADOW + OFFSET_INTER + m_infobox_height + OFFSET_SHADOW;
footer.setHeight(m_footer_height);
footer.enableShadow(CC_SHADOW_ON, -1, true);
@@ -148,10 +146,10 @@ void CUpnpBrowserGui::Init()
m_y=getScreenStartY(m_height);
// calc positions
m_header_y = m_y + m_topbox_height + OFFSET_SHADOW + INNER_OFFSET;
m_header_y = m_y + m_topbox_height + OFFSET_SHADOW + OFFSET_INTER;
m_item_y = m_header_y + m_header_height;
m_footer_y = m_item_y + (m_listmaxshow * m_item_height);
m_infobox_y = m_footer_y + m_footer_height + OFFSET_SHADOW + INNER_OFFSET;
m_infobox_y = m_footer_y + m_footer_height + OFFSET_SHADOW + OFFSET_INTER;
}
CUpnpBrowserGui::~CUpnpBrowserGui()
@@ -1124,7 +1122,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
if(lastname != entry->albumArtURI){
tmpname = lastname = entry->albumArtURI.c_str();
tmpname = g_PicViewer->DownloadImage(tmpname);
int h_image = infobox.getHeight() - INNER_OFFSET - infobox.getCornerRadius();
int h_image = infobox.getHeight() - OFFSET_INTER - infobox.getCornerRadius();
int y_image = infobox.getYPos() + infobox.getHeight()/2 - h_image/2;
if (!image){
image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0);
@@ -1133,7 +1131,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry)
}
image->setPicture(tmpname);
image->setHeight(h_image, true);
int x_image = infobox.getXPos() + infobox.getWidth() - image->getWidth() - INNER_OFFSET - infobox.getCornerRadius();
int x_image = infobox.getXPos() + infobox.getWidth() - image->getWidth() - OFFSET_INTER - infobox.getCornerRadius();
image->setXPos(x_image);
}
}else{
@@ -1194,7 +1192,7 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing)
{
// Foot info
int timebox_width = m_infobox_height; // maybe not enough
infobox.setDimensionsAll(m_x, m_infobox_y, m_width - OFFSET_SHADOW - INNER_OFFSET - timebox_width, m_infobox_height);
infobox.setDimensionsAll(m_x, m_infobox_y, m_width - OFFSET_SHADOW - OFFSET_INTER - timebox_width, m_infobox_height);
timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), m_infobox_height, timebox_width);
printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown);

View File

@@ -1191,7 +1191,7 @@ void CMenuWidget::calcSize()
sb_width=15;
full_width = /*ConnectLineBox_Width+*/width+sb_width+OFFSET_SHADOW;
full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+INFO_BOX_Y_OFFSET*/;
full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+OFFSET_INTER*/;
/* + ConnectLineBox_Width for the hintbox connection line
* + center_offset for symmetry
* + 20 for setMenuPos calculates 10 pixels border left and right */
@@ -1448,7 +1448,7 @@ void CMenuWidget::paintHint(int pos)
int iheight = item->getHeight();
int rad = RADIUS_LARGE;
int xpos = x - ConnectLineBox_Width;
int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + INFO_BOX_Y_OFFSET;
int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + OFFSET_INTER;
int iwidth = width+sb_width;
//init details line and infobox dimensions

View File

@@ -884,6 +884,7 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO
// offsets
#define OFFSET_SHADOW 6
#define OFFSET_INTER 6
struct SglobalInfo
{