From 10e3e6f32a09a7d5ddd519887dab4df2231be7b3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 17 Jul 2012 15:53:33 +0200 Subject: [PATCH 1/5] deutsch.locale: infobar isn't a "statusbalken" Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/34368532d225e38b3dee4f7d52776b2d0b7c246f Author: vanhofen Date: 2012-07-17 (Tue, 17 Jul 2012) Origin message was: ------------------ - deutsch.locale: infobar isn't a "statusbalken" ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 448d65d6a..a7938b856 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -259,7 +259,7 @@ colormenusetup.menucontent Fensterinhalt colormenusetup.menucontent_inactive Fensterinhalt deaktiviert colormenusetup.menucontent_selected Fensterinhalt selektiert colormenusetup.menuhead Titelleiste -colorstatusbar.text Statusbalken +colorstatusbar.text Infobar colorthememenu.head Theme auswählen colorthememenu.head2 Themes laden colorthememenu.name Themename From 42a055e9bd5c98da6a484d2f179ee760a10be5d1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 17 Jul 2012 16:49:44 +0200 Subject: [PATCH 2/5] Add CComponentsInfoBox to CComponents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c862f76a909106ea39f2414a799404a97946430 Author: Michael Liebmann Date: 2012-07-17 (Tue, 17 Jul 2012) Origin message was: ------------------ * Add CComponentsInfoBox to CComponents ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/components.cpp | 54 ++++++++++++++++++++++++++++++++++- src/gui/widget/components.h | 19 ++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/components.cpp b/src/gui/widget/components.cpp index 21f79986c..0609f0207 100644 --- a/src/gui/widget/components.cpp +++ b/src/gui/widget/components.cpp @@ -41,11 +41,15 @@ CComponents::CComponents(const int x_pos, const int y_pos, const int h, const in height = h; width = w; frameBuffer = CFrameBuffer::getInstance(); + bg_buf = NULL; } CComponents::~CComponents() { - + if (bg_buf) { + delete[] bg_buf; + bg_buf = NULL; + } } //------------------------------------------------------------------------------------------------------- @@ -123,3 +127,51 @@ void CComponentsDetailLine::hide() col2 = c_tmp2; } +//------------------------------------------------------------------------------------------------------- +//sub class CComponentsInfoBox +CComponentsInfoBox::CComponentsInfoBox( const int x_pos, const int y_pos, const int width_, const int height_, bool shadow_, + fb_pixel_t color1, fb_pixel_t color2, fb_pixel_t color3) +{ + x = x_pos; + y = y_pos; + width = width_; + height = height_; + rad = RADIUS_LARGE; + shadow = shadow_; + bg_saved = false; + + col_frame = color1; + col_body = color2; + col_shadow = color3; + bg_buf = new fb_pixel_t[(width+SHADOW_OFFSET) * (height+SHADOW_OFFSET)]; +} + +void CComponentsInfoBox::paint(int rad_) +{ + rad = rad_; + if ((bg_buf != NULL) && (!bg_saved)) { + frameBuffer->SaveScreen(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET, bg_buf); + bg_saved = true; + } + + /* box shadow */ + if (shadow) + frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y+SHADOW_OFFSET, width, height, col_shadow, rad); + /* box frame */ +// frameBuffer->paintBoxFrame(x, y, width, height, 2, col_frame, rad); + frameBuffer->paintBoxRel(x, y, width, height, col_frame, rad); + /* box fill */ + frameBuffer->paintBoxRel(x+2, y+2, width-4, height-4, col_body, rad); +} + +void CComponentsInfoBox::hide(bool full) +{ + if (full) { + if (bg_buf != NULL) + frameBuffer->RestoreScreen(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET, bg_buf); + else + frameBuffer->paintBackgroundBoxRel(x, y, width+SHADOW_OFFSET, height+SHADOW_OFFSET); + } + else + frameBuffer->paintBoxRel(x+2, y+2, width-4, height-4, col_body, rad); +} diff --git a/src/gui/widget/components.h b/src/gui/widget/components.h index d8259ec88..588a0bdde 100644 --- a/src/gui/widget/components.h +++ b/src/gui/widget/components.h @@ -34,6 +34,7 @@ class CComponents { protected: int x, y, height, width; + fb_pixel_t *bg_buf; CFrameBuffer * frameBuffer; @@ -64,4 +65,22 @@ class CComponentsDetailLine : public CComponents void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; }; +class CComponentsInfoBox : public CComponents +{ + private: + int width, height, rad; + fb_pixel_t col_frame, col_body, col_shadow; + bool shadow, bg_saved; + + public: + CComponentsInfoBox( const int x_pos, const int y_pos, const int width_, const int height_, bool shadow_ = true, + fb_pixel_t color1 = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color2 = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color3 = COL_MENUCONTENTDARK_PLUS_0); + + void paint(int rad_); + void hide(bool full = false); + void setColor(fb_pixel_t color1, fb_pixel_t color2, fb_pixel_t color3){col_frame = color1; col_body = color2; col_shadow = color3;}; +}; + #endif From 79a997f386ab014b3074d4ae489b7b2d3d6b92dd Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 17 Jul 2012 16:51:00 +0200 Subject: [PATCH 3/5] Use CComponentsInfoBox for menu hint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fd1ec29d832d5ce6a1d42d117c55543801296fe7 Author: Michael Liebmann Date: 2012-07-17 (Tue, 17 Jul 2012) Origin message was: ------------------ * Use CComponentsInfoBox for menu hint ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 25 +++++++++++++++---------- src/gui/widget/menue.h | 2 ++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d61c72d0c..c84e1a68a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -324,6 +324,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg frameBuffer = CFrameBuffer::getInstance(); iconfile = Icon; details_line = NULL; + info_box = NULL; //handle select values if(w_index > MN_WIDGET_ID_MAX){ @@ -393,6 +394,7 @@ CMenuWidget::~CMenuWidget() #endif resetWidget(true); delete details_line; + delete info_box; } void CMenuWidget::addItem(CMenuItem* menuItem, const bool defaultselected) @@ -1071,7 +1073,6 @@ void CMenuWidget::paintHint(int pos) if (pos < 0 && !hint_painted) return; - fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; int rad = RADIUS_LARGE; int xpos = x - ConnectLineBox_Width; @@ -1083,8 +1084,8 @@ void CMenuWidget::paintHint(int pos) if (details_line != NULL) details_line->hide(); /* clear info box */ - frameBuffer->paintBackgroundBoxRel(x, ypos2, iwidth+SHADOW_OFFSET, hint_height+SHADOW_OFFSET); - + if (info_box != NULL) + info_box->hide((pos == -1) ? true : false); hint_painted = false; } if (pos < 0) @@ -1093,8 +1094,11 @@ void CMenuWidget::paintHint(int pos) CMenuItem* item = items[pos]; printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText(item->hint)); - if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) + if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) { + if (info_box != NULL) + info_box->hide(true); return; + } hint_painted = true; @@ -1113,12 +1117,13 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText details_line->setYPos(ypos1a); details_line->paint(); - /* box shadow */ - frameBuffer->paintBoxRel(x+SHADOW_OFFSET, ypos2+SHADOW_OFFSET, width + sb_width, hint_height, COL_MENUCONTENTDARK_PLUS_0, rad); - /* box frame and fill */ - frameBuffer->paintBoxFrame(x, ypos2, iwidth, hint_height, 2, col1, rad); - /* box frame and fill */ - frameBuffer->paintBoxRel(x+2, ypos2+2, iwidth-4, hint_height-4, COL_MENUCONTENTDARK_PLUS_0, rad); + if (info_box == NULL) + info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height, rad); + else { + info_box->setXPos(x); + info_box->setYPos(ypos2); + } + info_box->paint(rad); int offset = 10; if (!item->hintIcon.empty()) { diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 995f744a6..3fc6b98af 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -424,6 +424,8 @@ class CMenuWidget : public CMenuTarget mn_widget_id_t widget_index; CMenuGlobal *mglobal; CComponentsDetailLine *details_line; + CComponentsInfoBox *info_box; + protected: std::string nameString; neutrino_locale_t name; From 77f2e05c4672655d96e855289a90d197413903df Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 17 Jul 2012 19:18:59 +0200 Subject: [PATCH 4/5] Fix the position of CComponentsDetailLine Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ea33afbcf8b4f57dd02b0059f87218521cc1b149 Author: Michael Liebmann Date: 2012-07-17 (Tue, 17 Jul 2012) Origin message was: ------------------ * Fix the position of CComponentsDetailLine ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/components.h | 1 + src/gui/widget/menue.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/components.h b/src/gui/widget/components.h index 588a0bdde..c46c16e87 100644 --- a/src/gui/widget/components.h +++ b/src/gui/widget/components.h @@ -63,6 +63,7 @@ class CComponentsDetailLine : public CComponents void hide(); void setColor(fb_pixel_t color1, fb_pixel_t color2){col1 = color1; col2 = color2;}; void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; + void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; }; class CComponentsInfoBox : public CComponents diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c84e1a68a..784d0088d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1113,8 +1113,12 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText if (details_line == NULL) details_line = new CComponentsDetailLine(xpos, ypos1a, ypos2a, imarkh, markh); - else + else { + details_line->setXPos(xpos); details_line->setYPos(ypos1a); + details_line->setYPosDown(ypos2a); + details_line->setHMarkDown(markh); + } details_line->paint(); if (info_box == NULL) From 4b4b65ff9a1b38651ea3c1b748b276fc909c391a Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 17 Jul 2012 22:22:09 +0200 Subject: [PATCH 5/5] CComponentsInfoBox: missing shadow - Removed wrong parameter 'rad' from function call CComponentsInfoBox Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/301193ce01848fa975b1e4a81f2981310ae52aa5 Author: Michael Liebmann Date: 2012-07-17 (Tue, 17 Jul 2012) Origin message was: ------------------ * CComponentsInfoBox: missing shadow - Removed wrong parameter 'rad' from function call CComponentsInfoBox ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 784d0088d..fae5376ce 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1122,7 +1122,7 @@ printf("paintHint: icon %s text %s\n", item->hintIcon.c_str(), g_Locale->getText details_line->paint(); if (info_box == NULL) - info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height, rad); + info_box = new CComponentsInfoBox(x, ypos2, iwidth, hint_height); else { info_box->setXPos(x); info_box->setYPos(ypos2);