From 4714a30f835525c5ecab8afd7cfc23d2a90be11c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 25 Mar 2013 09:45:22 +0100 Subject: [PATCH] - strech most windows to full screen * switchable with existing switch for 'big_windows' * 'big_windows' default is on Conflicts: src/gui/bedit/bouqueteditor_bouquets.cpp src/gui/bedit/bouqueteditor_channels.cpp src/gui/bedit/bouqueteditor_chanselect.cpp --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- src/driver/framebuffer.cpp | 11 +++++++++++ src/driver/framebuffer.h | 5 +++++ src/gui/audioplayer.cpp | 10 +++------- src/gui/bedit/bouqueteditor_bouquets.cpp | 11 +++++------ src/gui/bedit/bouqueteditor_channels.cpp | 15 +++++++-------- src/gui/bedit/bouqueteditor_chanselect.cpp | 14 ++++++-------- src/gui/channellist.cpp | 6 ++---- src/gui/epgview.cpp | 16 +++++----------- src/gui/filebrowser.cpp | 10 +++++----- src/gui/moviebrowser.cpp | 9 +++++---- src/gui/pictureviewer.cpp | 5 +++-- src/gui/upnpbrowser.cpp | 9 ++------- src/gui/widget/menue.cpp | 2 -- src/neutrino.cpp | 2 +- 16 files changed, 62 insertions(+), 67 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 2286cf746..cbdaadad4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -736,7 +736,7 @@ menu.hint_auto_subs Automatische Anzeige der Untertitel in Ihrer bevorzugten Spr menu.hint_back Zurück zum vorherigen Menü.\nDie Taste 'Menü' schließt alle Menüs menu.hint_backup Sichern von Konfigurationen und Kanallisten menu.hint_bedit Bearbeiten ihrer Favoriten und der Bouquets -menu.hint_bigwindows EPG-Informationen werden immer im großen Fenster angezeigt. Dies erreichen Sie auch mit der Taste 'Info' +menu.hint_bigwindows Kanalliste, EPG-Infos, Audioplayer und einige andere Fenster werden bildschirmfüllend angezeigt menu.hint_cache_txt Startet das Zwischenspeichern des Teletextes nach einem Kanalwechsel menu.hint_cec_mode CEC-Modus menu.hint_cec_standby CEC-Standby diff --git a/data/locale/english.locale b/data/locale/english.locale index c6c274aa0..a0ece343c 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -740,7 +740,7 @@ menu.hint_auto_subs Auto-start subtitles for preferred language menu.hint_back Return to previous menu\nPress menu key to close all menus menu.hint_backup Backup configs and channels to selected dir menu.hint_bedit Edit favorites and bouquets -menu.hint_bigwindows Always show big epg detail window\nelse 'info' button switch big font + window size +menu.hint_bigwindows Channellist, EPG-infos, audioplayer and some other windows are displayed full screen menu.hint_cache_txt Start teletext caching after channel switch menu.hint_cec_mode CEC mode menu.hint_cec_standby CEC standby diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 5969fe1e7..a14964dd9 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -430,6 +430,17 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } +unsigned int CFrameBuffer::getScreenWidthRel() +{ + // always reduce a possible detailline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * (g_settings.big_windows ? 100 : NON_BIG_WINDOWS) / 100; +} + +unsigned int CFrameBuffer::getScreenHeightRel() +{ + return (g_settings.screen_EndY - g_settings.screen_StartY) * (g_settings.big_windows ? 100 : NON_BIG_WINDOWS) / 100; +} + unsigned int CFrameBuffer::getScreenX() { return g_settings.screen_StartX; diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 7ebde01f4..e1f79e119 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -53,6 +53,9 @@ typedef struct fb_var_screeninfo t_fb_var_screeninfo; #define FADE_STEP 5 #define FADE_RESET 0xFFFF +#define NON_BIG_WINDOWS 85 // % +#define ConnectLineBox_Width 16 // px + /** Ausfuehrung als Singleton */ class CFrameBuffer { @@ -143,6 +146,8 @@ class CFrameBuffer unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); + unsigned int getScreenWidthRel(); + unsigned int getScreenHeightRel(); unsigned int getScreenX(); unsigned int getScreenY(); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 12644aa42..c8e56e5b3 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -98,11 +98,6 @@ #include extern cVideo * videoDecoder; -#ifdef ConnectLineBox_Width -#undef ConnectLineBox_Width -#endif -#define ConnectLineBox_Width 16 - #define AUDIOPLAYERGUI_SMSKEY_TIMEOUT 1000 #define SHOW_FILE_LOAD_LIMIT 50 @@ -275,9 +270,10 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_current = 0; m_selected = 0; - m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - 2*ConnectLineBox_Width - 5; - m_height = (g_settings.screen_EndY - g_settings.screen_StartY - 5); + m_width = m_frameBuffer->getScreenWidthRel(); + m_height = m_frameBuffer->getScreenHeightRel(); + m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_buttonHeight = std::max(25, m_sheight); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 157723695..b24bf70b1 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -123,6 +123,7 @@ void CBEBouquetWidget::paint() float sbh= (sb- 4)/ sbc; int sbs= (selected/listmaxshow); + //scrollbar frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3); } @@ -225,14 +226,12 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* iheight = std::max(iheight, icol_h+2); iconoffset = std::max(iconoffset, icol_w); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); - int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - width = w_max (64 * fw, 20); - height = h_max (20 * fh, 50); + width = frameBuffer->getScreenWidthRel(); + height = frameBuffer->getScreenHeightRel() - ButtonHeight; listmaxshow = (height-theight-0)/iheight; height = theight+0+listmaxshow*iheight; // recalc height - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2; + x = getScreenStartX(width); + y = getScreenStartY(height + ButtonHeight); Bouquets = &g_bouquetManager->Bouquets; paintHead(); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index e951bbed3..e52a7d067 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -201,8 +201,6 @@ void CBEChannelWidget::paintDetails(int index) void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) { -#define ConnectLineBox_Width 16 - int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*fheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; @@ -272,15 +270,16 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* if (parent) parent->hide(); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); - width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100); - height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), (frameBuffer->getScreenHeight() / 20 * 2)); + width = frameBuffer->getScreenWidthRel(); + info_height = 2*iheight + 4; + height = frameBuffer->getScreenHeightRel() - info_height; listmaxshow = (height-theight-footerHeight-0)/iheight; height = theight+footerHeight+listmaxshow*iheight; // recalc height - info_height = 2*iheight + 10; - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2; + x = getScreenStartX(width); + if (x < ConnectLineBox_Width) + x = ConnectLineBox_Width; + y = getScreenStartY(height + info_height); Channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels); paintHead(); diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 7abb90115..738504cd9 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -45,7 +45,6 @@ #include #include - extern CBouquetManager *g_bouquetManager; CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsigned int Bouquet, CZapitClient::channelsMode Mode) @@ -168,15 +167,16 @@ void CBEChannelSelectWidget::onOkKeyPressed() int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & actionKey) { - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); - width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100); - height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), (frameBuffer->getScreenHeight() / 20 * 2)); + width = frameBuffer->getScreenWidthRel(); + height = frameBuffer->getScreenHeightRel(); listmaxshow = (height-theight-footerHeight-0)/iheight; height = theight+footerHeight+listmaxshow*iheight; // recalc height info_height = 2*iheight + 10; - x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; - y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2; + x = getScreenStartX(width); + if (x < ConnectLineBox_Width) + x = ConnectLineBox_Width; + y = getScreenStartY(height + info_height); bouquetChannels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels); @@ -227,8 +227,6 @@ void CBEChannelSelectWidget::paintDetails(int index) void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) { -#define ConnectLineBox_Width 16 - int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*fheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ae81b68ce..97438a0db 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -94,8 +94,6 @@ extern int old_b_id; extern cVideo * videoDecoder; -#define ConnectLineBox_Width 16 - CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vlist) { frameBuffer = CFrameBuffer::getInstance(); @@ -487,7 +485,7 @@ void CChannelList::calcSize() footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; // calculate width - full_width = frameBuffer->getScreenWidth() - frameBuffer->getScreenX() - 2*ConnectLineBox_Width; + full_width = frameBuffer->getScreenWidthRel(); if (g_settings.channellist_additional) width = full_width / 3 * 2; else @@ -495,7 +493,7 @@ void CChannelList::calcSize() // calculate height (the infobox below mainbox is handled outside height) info_height = 2*fheight + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight() + 10; - height = h_max ((frameBuffer->getScreenHeight() / 20 * 18) - info_height, 0); + height = frameBuffer->getScreenHeightRel() - info_height; // calculate x position x = getScreenStartX(full_width); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 1a7eafcd9..16f7dd77e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -117,17 +117,8 @@ CEpgData::CEpgData() void CEpgData::start() { - /* This defines the size of the EPG window. We use 90% of the screen width and - * 90% of the screen height. It adjusts itself to the "visible screen" settings - */ - float epgwin_scale_factor = BIG_FONT_FAKTOR; /* stupid useless use of float */ - if (g_settings.big_windows) - epgwin_scale_factor = 1; - - ox = (frameBuffer->getScreenWidth() / 20 * 18) / (bigFonts ? 1 : epgwin_scale_factor); - oy = (frameBuffer->getScreenHeight() / 20 * 18) / (bigFonts ? 1 : epgwin_scale_factor); - sx = getScreenStartX(ox); - sy = getScreenStartY(oy); + ox = frameBuffer->getScreenWidthRel(); + oy = frameBuffer->getScreenHeightRel(); topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); topboxheight = topheight + 6; @@ -142,6 +133,9 @@ void CEpgData::start() medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); medlinecount = sb / medlineheight; toph = topboxheight; + + sx = getScreenStartX(ox); + sy = getScreenStartY(oy + buttonheight/2); /* button box is handled separately (why?) */ } void CEpgData::addTextToArray(const std::string & text, int screening) // UTF-8 diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index ef4fd9801..9ed1852c1 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -372,11 +373,9 @@ void CFileBrowser::commonInit() selected = 0; selections.clear(); - x = g_settings.screen_StartX + 20; - y = g_settings.screen_StartY + 20; - - width = (g_settings.screen_EndX - g_settings.screen_StartX - 40); - height = (g_settings.screen_EndY - g_settings.screen_StartY - 40); + width = frameBuffer->getScreenWidthRel(); + height = frameBuffer->getScreenHeightRel(); + x = getScreenStartX(width); theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); @@ -389,6 +388,7 @@ void CFileBrowser::commonInit() //recalc height height = theight + listmaxshow * fheight + 2 * foheight; + y = getScreenStartY(height); m_SMSKeyInput.setTimeout(SMSKEY_TIMEOUT); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 24d3e8d56..59c218958 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -39,6 +39,7 @@ #endif #include +#include #include #include @@ -602,10 +603,10 @@ void CMovieBrowser::initFrames(void) m_pcFontTitle = TITLE_FONT; //TRACE("[mb]->initFrames\r\n"); - m_cBoxFrame.iX = g_settings.screen_StartX + 10; - m_cBoxFrame.iY = g_settings.screen_StartY + 10; - m_cBoxFrame.iWidth = g_settings.screen_EndX - g_settings.screen_StartX - 20; - m_cBoxFrame.iHeight = g_settings.screen_EndY - g_settings.screen_StartY - 20; + m_cBoxFrame.iWidth = m_pcWindow->getScreenWidthRel(); + m_cBoxFrame.iHeight = m_pcWindow->getScreenHeightRel(); + m_cBoxFrame.iX = getScreenStartX(m_cBoxFrame.iWidth); + m_cBoxFrame.iY = getScreenStartY(m_cBoxFrame.iHeight); m_cBoxFrameTitleRel.iX = 0; m_cBoxFrameTitleRel.iY = 0; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 44b4a8bcb..a80532cad 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -128,8 +128,9 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) audioplayer = true; selected = 0; - width = w_max (710, 0); - height = h_max (570, 0); + + width = frameBuffer->getScreenWidthRel(); + height = frameBuffer->getScreenHeightRel(); sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index be46fe341..b94734237 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -69,11 +69,6 @@ #include extern cVideo * videoDecoder; -#ifdef ConnectLineBox_Width -#undef ConnectLineBox_Width -#endif -#define ConnectLineBox_Width 15 - const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN}; const struct button_label StopButton = {NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP}; const struct button_label PUpButton = {NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE}; @@ -127,8 +122,8 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ #endif m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - m_width=(g_settings.screen_EndX - g_settings.screen_StartX) - 2*ConnectLineBox_Width; - m_height = (g_settings.screen_EndY - g_settings.screen_StartY); + m_width = m_frameBuffer->getScreenWidthRel(); + m_height = m_frameBuffer->getScreenHeightRel(); m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); m_buttonHeight = std::min(25, m_sheight); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a25be27ab..dbfe03047 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -42,8 +42,6 @@ #include -#define ConnectLineBox_Width 16 - /* the following generic menu items are integrated into multiple menus at the same time */ CMenuSeparator CGenericMenuSeparator; CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 4ceba3183..726de248d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -648,7 +648,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.screen_height = configfile.getInt32("screen_height", 0); g_settings.bigFonts = configfile.getInt32("bigFonts", 0); - g_settings.big_windows = configfile.getInt32("big_windows", 0); + g_settings.big_windows = configfile.getInt32("big_windows", 1); g_settings.remote_control_hardware = configfile.getInt32( "remote_control_hardware", CRCInput::RC_HW_COOLSTREAM); g_settings.audiochannel_up_down_enable = configfile.getBool("audiochannel_up_down_enable", false);