From 226bcb07ecc4071fc2fa385515072b4a6cfe9702 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 27 Sep 2017 14:13:28 +0200 Subject: [PATCH 1/2] bouqueteditor_channels: allow to navigate with left/right through the bouquets add corresponding context-icons to header Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e94e0780b03196a3265c356c5c7f40785dc7196f Author: vanhofen Date: 2017-09-27 (Wed, 27 Sep 2017) Origin message was: ------------------ - bouqueteditor_channels: allow to navigate with left/right through the bouquets add corresponding context-icons to header ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_bouquets.cpp | 1 + src/gui/bedit/bouqueteditor_channels.cpp | 30 ++++++++++++++++++++++++ src/gui/bedit/bouqueteditor_channels.h | 1 + 3 files changed, 32 insertions(+) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 15a0d7e61..b431d3680 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -355,6 +355,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* CBEChannelWidget* channelWidget = new CBEChannelWidget(ChannelWidgetCaption, selected); channelWidget->exec(this, ""); + selected = channelWidget->getBouquet(); if (channelWidget->hasChanged()) bouquetsChanged = true; delete channelWidget; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8b445b2c0..532bdb420 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -70,6 +70,8 @@ CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bou status_icon_width = std::max(status_icon_width, iw); frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &iw, &ih); status_icon_width = std::max(status_icon_width, iw); + + header.addContextButton(CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT); } CBEChannelWidget::~CBEChannelWidget() @@ -416,6 +418,34 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* paintFoot(); paintItems(); } + else if (msg == CRCInput::RC_left || msg == CRCInput::RC_right) + { + unsigned int bouquet_size = g_bouquetManager->Bouquets.size(); + + if (msg == CRCInput::RC_left) + { + if (bouquet == 0) + bouquet = bouquet_size - 1; + else + bouquet--; + } + else + { + if (bouquet < bouquet_size - 1) + bouquet++; + else + bouquet = 0; + } + + Channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels); + caption = g_bouquetManager->Bouquets[bouquet]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[bouquet]->Name; + + selected = 0; + paintHead(); + paintBody(); + paintFoot(); + paintItems(); + } else if (msg == CRCInput::RC_ok) { if (state == beDefault) diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index 72e73d20d..e8a9b521c 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -89,6 +89,7 @@ class CBEChannelWidget : public CBEGlobals, public CMenuTarget, public CListHelp ZapitChannelList * Channels; int exec(CMenuTarget* parent, const std::string & actionKey); bool hasChanged(); + unsigned int getBouquet() { return bouquet; }; }; #endif From 85e3acf202a8248e8cc6341e9ad4a0c8b2782e8a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 27 Sep 2017 14:26:22 +0200 Subject: [PATCH 2/2] menue: only add hint_height to full_height, if we really have a hint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/58e05cfd9923e12bfde2587bd77d274aef1d2371 Author: vanhofen Date: 2017-09-27 (Wed, 27 Sep 2017) Origin message was: ------------------ - menue: only add hint_height to full_height, if we really have a hint ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index eb34d4d74..943541713 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1304,7 +1304,10 @@ void CMenuWidget::setMenuPos(const int& menu_width) int scr_y = frameBuffer->getScreenY(); int scr_w = frameBuffer->getScreenWidth(); int scr_h = frameBuffer->getScreenHeight(); - int real_h = full_height + OFFSET_INTER + hint_height + OFFSET_SHADOW; // full_height includes footer_height : see calcSize + int hint_h = 0; + if (hint_height) + hint_h = OFFSET_INTER + hint_height + OFFSET_SHADOW; + int real_h = full_height + hint_h; // full_height includes footer_height : see calcSize int x_old = x; int y_old = y; //configured positions @@ -1424,20 +1427,23 @@ void CMenuWidget::saveScreen() return; delete[] background; - saveScreen_height = full_height + OFFSET_INTER + hint_height + OFFSET_SHADOW; // full_height includes footer_height : see calcSize + int hint_h = 0; + if (hint_height) + hint_h = OFFSET_INTER + hint_height + OFFSET_SHADOW; + saveScreen_height = full_height + hint_h; // full_height includes footer_height : see calcSize saveScreen_width = full_width; saveScreen_y = y; saveScreen_x = x; background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->SaveScreen(saveScreen_x, saveScreen_y, saveScreen_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->RestoreScreen(saveScreen_x, saveScreen_y, saveScreen_width, saveScreen_height, background); } }