From ae2e8bec7c03b3fd0cda996c366d7e141aa4bc7f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 1 Nov 2017 15:10:38 +0100 Subject: [PATCH 1/3] vfd-setup: use new display_can_deepstandby member from libstb-hal Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d1eadb0830d03a2a4ff43e0e05404a12afbff631 Author: vanhofen Date: 2017-11-01 (Wed, 01 Nov 2017) Origin message was: ------------------ - vfd-setup: use new display_can_deepstandby member from libstb-hal ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 1 + src/gui/vfd_setup.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 156c6ea5d..8f75c2791 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -29,6 +29,7 @@ hw_caps_t *get_hwcaps(void) { caps.display_type = HW_DISPLAY_LINE_TEXT; caps.display_xres = 12; caps.display_yres = 0; + caps.display_can_deepstandby = (rev > 7); caps.can_set_display_brightness = 1; caps.can_ar_14_9 = 1; caps.can_ps_14_9 = 1; diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index a64996a21..a0e9e33fc 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -230,12 +230,14 @@ int CVfdSetup::showBrightnessSetup() nc->setActivateObserver(this); mn_widget->addItem(nc); - if(cs_get_revision() > 7) { + if (g_info.hw_caps->display_can_deepstandby) + { nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDEEPSTANDBY); nc->setActivateObserver(this); mn_widget->addItem(nc); } + nc = new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, CRCInput::RC_nokey, NULL, 0, -1, LOCALE_OPTIONS_OFF, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDIM); nc->setActivateObserver(this); From ddc29f630fff8fccb7f305583654af9af037c503 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 1 Nov 2017 15:17:52 +0100 Subject: [PATCH 2/3] rename can_set_display_brightness => display_can_set_brightness Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8a6c8ee06d8cd3ffbbf0ed0357b1b65b9c183c40 Author: vanhofen Date: 2017-11-01 (Wed, 01 Nov 2017) Origin message was: ------------------ - rename can_set_display_brightness => display_can_set_brightness ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 6 +++--- lib/hardware/coolstream/hardware_caps.h | 2 +- src/gui/vfd_setup.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 8f75c2791..174c87b19 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -30,7 +30,7 @@ hw_caps_t *get_hwcaps(void) { caps.display_xres = 12; caps.display_yres = 0; caps.display_can_deepstandby = (rev > 7); - caps.can_set_display_brightness = 1; + caps.display_can_set_brightness = 1; caps.can_ar_14_9 = 1; caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; @@ -67,7 +67,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Trinity V2"); strcpy(caps.boxarch, "Kronos"); } - caps.can_set_display_brightness = 0; + caps.display_can_set_brightness = 0; break; case 12: strcpy(caps.boxname, "Zee2"); @@ -80,7 +80,7 @@ hw_caps_t *get_hwcaps(void) { case 14: strcpy(caps.boxname, "Trinity Duo"); strcpy(caps.boxarch, "Kronos"); - caps.can_set_display_brightness = 0; + caps.display_can_set_brightness = 0; break; default: strcpy(caps.boxname, "UNKNOWN_BOX"); diff --git a/lib/hardware/coolstream/hardware_caps.h b/lib/hardware/coolstream/hardware_caps.h index aaea1334e..30c59847a 100644 --- a/lib/hardware/coolstream/hardware_caps.h +++ b/lib/hardware/coolstream/hardware_caps.h @@ -33,7 +33,7 @@ typedef struct hw_caps display_type_t display_type; int display_xres; /* x resolution or chars per line */ int display_yres; - int can_set_display_brightness; + int display_can_set_brightness; char boxvendor[64]; char boxname[64]; char boxarch[64]; diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index a0e9e33fc..68f71e255 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -130,7 +130,7 @@ int CVfdSetup::showSetup() vfds->addItem(mf); } - if (g_info.hw_caps->can_set_display_brightness) + if (g_info.hw_caps->display_can_set_brightness) { //vfd brightness menu mf = new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, this, "brightness", CRCInput::RC_green); From eff0495a4baf649df0e2ca222c38e7a5b4f978fe Mon Sep 17 00:00:00 2001 From: GetAway Date: Thu, 2 Nov 2017 12:35:41 +0100 Subject: [PATCH 3/3] menue.cpp: dont use one-time init of a variable that could be changed on runtime Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1ce74f7766ec993ad24c160c2471c8084b98f51 Author: GetAway Date: 2017-11-02 (Thu, 02 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 17 ++++++++--------- src/gui/widget/menue.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 5f0fa7847..e91a25b7f 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -79,7 +79,6 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I x = -1; used = false; - icon_frame_w = OFFSET_INNER_MID; hint = NONEXISTANT_LOCALE; name = NONEXISTANT_LOCALE; nameString = ""; @@ -102,7 +101,7 @@ void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) y = Y; dx = DX; offx = OFFX; - name_start_x = x + offx + icon_frame_w; + name_start_x = x + offx + OFFSET_INNER_MID; getItemColors(item_color, item_bgcolor); } @@ -237,7 +236,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text if (iconName_Info_right) { CFrameBuffer::getInstance()->getIconSize(iconName_Info_right, &icon_w, &icon_h); if (icon_w) - _dx -= icon_frame_w + icon_w; + _dx -= OFFSET_INNER_MID + icon_w; } int desc_height = 0; @@ -253,7 +252,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text); int stringstartposOption; if (*left_text) - stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx + stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + OFFSET_INNER_MID, x + dx - stringwidth - OFFSET_INNER_MID); //+ offx else stringstartposOption = name_start_x; if (right_bgcol) { @@ -274,7 +273,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text col.paint(false); } if (*right_text) { - stringstartposOption -= (icon_w == 0 ? 0 : icon_w + icon_frame_w); + stringstartposOption -= (icon_w == 0 ? 0 : icon_w + OFFSET_INNER_MID); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height - desc_height, dx - stringstartposOption + x - OFFSET_INNER_MID, right_text, item_color); } } @@ -319,7 +318,7 @@ void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, } int left_needed = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text); - int space = dx - right_needed - icon_frame_w - left_needed - OFFSET_INNER_MID; + int space = dx - right_needed - OFFSET_INNER_MID - left_needed - OFFSET_INNER_MID; if (space < bar_full) return ; @@ -363,8 +362,8 @@ void CMenuItem::paintItemButton(const bool select_mode, int item_height, const c icon_name = icon_Name; } - int icon_start_x = x+icon_frame_w; //start of icon space - int icon_space_x = name_start_x - icon_frame_w - icon_start_x; //size of space where to paint icon + int icon_start_x = x+OFFSET_INNER_MID; //start of icon space + int icon_space_x = name_start_x - OFFSET_INNER_MID - icon_start_x; //size of space where to paint icon int icon_space_mid = icon_start_x + icon_space_x/2; //get data of number icon and paint @@ -2490,7 +2489,7 @@ int CMenuProgressbar::paint(bool selected) //progress bar int pb_x; if (*left_text) - pb_x = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - scale.getWidth() - icon_frame_w); + pb_x = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + OFFSET_INNER_MID, x + dx - scale.getWidth() - OFFSET_INNER_MID); else pb_x = name_start_x; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index a23b2f29c..60e6e8a6f 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -112,7 +112,7 @@ class CMenuItem : public CComponentsSignals void setIconName(); CMenuWidget* parent_widget; protected: - int x, y, dx, offx, name_start_x, icon_frame_w; + int x, y, dx, offx, name_start_x; bool used; fb_pixel_t item_color, item_bgcolor; bool initModeCondition(const int& stb_mode);