From 249352e5dc0ba8a068e1517f502281b38e34e74a Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 15 Jul 2010 11:04:22 +0000 Subject: [PATCH] osd fixes git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@668 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/audioplayer.cpp | 20 +++++++++---------- src/gui/filebrowser.cpp | 6 +++--- src/gui/pictureviewer.cpp | 41 +++++++++++++++++--------------------- src/gui/widget/buttons.cpp | 2 +- src/system/locals.h | 1 - src/system/locals_intern.h | 1 - 6 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 83814b163..9de97006e 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1680,6 +1680,12 @@ const struct button_label AudioPlayerButtons[][4] = void CAudioPlayerGui::paintFoot() { // printf("paintFoot{\n"); +const struct button_label ScondLineButtons[2] = +{ + { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, + { NEUTRINO_ICON_BUTTON_HELP , LOCALE_AUDIOPLAYER_KEYLEVEL }, +}; + int top; int c_rad_mid = RADIUS_MID; if (m_show_playlist) @@ -1688,22 +1694,14 @@ void CAudioPlayerGui::paintFoot() top = m_y + (m_height - 2 * m_buttonHeight); int ButtonWidth = (m_width - 20) / 4; - int ButtonWidth2 = (m_width - 50) / 2; + //int ButtonWidth2 = (m_width - 50) / 2; m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, CORNER_BOTTOM); m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1); if (!m_playlist.empty()) { - // play - m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_x + 1 * ButtonWidth2 + 25, top + m_buttonHeight - 3); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] - ->RenderString(m_x + 1 * ButtonWidth2 + 53, top + m_buttonHeight + 24 - 4, ButtonWidth2 - 28, - g_Locale->getText(LOCALE_AUDIOPLAYER_PLAY), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 - // keylevel switch - m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, m_x + 0 * ButtonWidth + 25, top + m_buttonHeight - 3); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] - ->RenderString(m_x + 0 * ButtonWidth + 53 , top + m_buttonHeight + 24 - 4, ButtonWidth2 - 28, - g_Locale->getText(LOCALE_AUDIOPLAYER_KEYLEVEL), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 + ::paintButtons(m_frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, m_x + 10, top+m_buttonHeight, ButtonWidth, 2, ScondLineButtons); + } if (m_key_level == 0) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index e5e5813a5..21d7282fb 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1419,18 +1419,18 @@ void CFileBrowser::paintFoot() //OK-Button if( (filelist[selected].getType() != CFile::FILE_UNKNOWN) || (S_ISDIR(filelist[selected].Mode)) ) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x +3 , by2 - 3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x +10 , by2 - 3); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + noname, ty2, dx - noname, g_Locale->getText(LOCALE_FILEBROWSER_SELECT), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 } //?-Button - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + (1 * dx), by2 - 3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x + 10 +(1 * dx), by2 - 3); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + noname + (1 * dx), ty2, dx - noname, g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 //Mute-Button if (strncmp(Path.c_str(), VLC_URI, strlen(VLC_URI)) != 0) { //Not in vlc mode - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, x + (2 * dx), by2 - 3); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, x + 10 + (2 * dx), by2 - 3); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + noname + (2 * dx), ty2, dx - noname, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), COL_INFOBAR /*_SHADOW_PLUS_1*/, 0, true); // UTF-8 } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 8f92debfd..7e1823694 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -607,43 +607,38 @@ const struct button_label PictureViewerButtons[4] = { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_DELETEALL }, { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_PICTUREVIEWER_SLIDESHOW } }; - +const struct button_label PictureViewerButtons2[][2] = +{ + { + { NEUTRINO_ICON_BUTTON_5 , LOCALE_PICTUREVIEWER_SORTORDER_DATE }, + { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_PICTUREVIEWER_SHOW } + }, + { + { NEUTRINO_ICON_BUTTON_5 , LOCALE_PICTUREVIEWER_SORTORDER_FILENAME }, + { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_PICTUREVIEWER_SHOW } + } +}; void CPictureViewerGui::paintFoot() { // printf("paintFoot{\n"); int ButtonWidth = (width-20) / 4; - int ButtonWidth2 = (width-50) / 2; +// int ButtonWidth2 = (width-50) / 2; frameBuffer->paintBoxRel(x, y+(height-2*buttonHeight), width, 2*buttonHeight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); frameBuffer->paintHLine(x, x+width, y+(height-2*buttonHeight), COL_INFOBAR_SHADOW_PLUS_0); if (!playlist.empty()) { - //frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + 1* ButtonWidth2 + 25, y+(height-buttonHeight)-3); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x + 1* ButtonWidth2 + 25, y+height-buttonHeight, buttonHeight); - //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 1 * ButtonWidth2 + 53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, g_Locale->getText(LOCALE_PICTUREVIEWER_SHOW), COL_INFOBAR, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x + 1 * ButtonWidth2 + 53 , - y + height - buttonHeight + sheight + (buttonHeight - sheight)/2, ButtonWidth2- 28, - g_Locale->getText(LOCALE_PICTUREVIEWER_SHOW), COL_INFOBAR, 0, true); // UTF-8 - - //frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+(height-buttonHeight)-3); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_5, x+ 0* ButtonWidth2 + 25, y+height-buttonHeight, buttonHeight); - std::string tmp = g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER); - tmp += ' '; - if (m_sort==FILENAME) - tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_DATE); - else if (m_sort==DATE) - tmp += g_Locale->getText(LOCALE_PICTUREVIEWER_SORTORDER_FILENAME); - //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , y+(height-buttonHeight)+24 - 4, ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8 - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+ 0* ButtonWidth2 +53 , - y + height - buttonHeight + sheight + (buttonHeight - sheight)/2, - ButtonWidth2- 28, tmp, COL_INFOBAR, 0, true); // UTF-8 - - //::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - 2 * buttonHeight) + 4, ButtonWidth, 4, PictureViewerButtons); ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - 2 * buttonHeight), ButtonWidth, buttonHeight, 4, PictureViewerButtons); + + ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, + x + 10, y + (height - buttonHeight), ButtonWidth*2, buttonHeight, + 2, (m_sort==FILENAME)?PictureViewerButtons2[0]:PictureViewerButtons2[1]); + + } else ::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 73f15004f..3db193670 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -36,7 +36,7 @@ void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLo frameBuffer->getIconSize(content[i].button, &iw, &ih); frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, y); - font->RenderString(x + i * buttonwidth + 20, y + fh-(fh-ih)/2, buttonwidth - 20, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 + font->RenderString(x + i * buttonwidth + iw + 5, y + fh-(fh-ih)/2, buttonwidth - iw - 5, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 } } #endif diff --git a/src/system/locals.h b/src/system/locals.h index 5b8e27907..f54cfdcd2 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -875,7 +875,6 @@ typedef enum { LOCALE_PICTUREVIEWER_SHOW, LOCALE_PICTUREVIEWER_SLIDE_TIME, LOCALE_PICTUREVIEWER_SLIDESHOW, - LOCALE_PICTUREVIEWER_SORTORDER, LOCALE_PICTUREVIEWER_SORTORDER_DATE, LOCALE_PICTUREVIEWER_SORTORDER_FILENAME, LOCALE_PING_OK, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7645d4151..d4d336645 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -875,7 +875,6 @@ const char *locale_real_names[] = { "pictureviewer.show", "pictureviewer.slide_time", "pictureviewer.slideshow", - "pictureviewer.sortorder", "pictureviewer.sortorder.date", "pictureviewer.sortorder.filename", "ping.ok",