From da9e03b1df3648c3aa9f8db5839392bded92f6d0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 12 Aug 2016 15:31:51 +0200 Subject: [PATCH 1/2] fb_window: add possibility to paint frame boxes Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/220260c71845a8d17db7ef5285b0731e35a1359b Author: vanhofen Date: 2016-08-12 (Fri, 12 Aug 2016) Origin message was: ------------------ - fb_window: add possibility to paint frame boxes ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fb_window.cpp | 5 +++++ src/driver/fb_window.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/driver/fb_window.cpp b/src/driver/fb_window.cpp index efe5dfdfa..19431f358 100644 --- a/src/driver/fb_window.cpp +++ b/src/driver/fb_window.cpp @@ -68,6 +68,11 @@ void CFBWindow::paintBoxRel(const int _x, const int _y, const int _dx, const int frameBuffer->paintBoxRel(x + _x, y + _y, _dx, _dy, _col, radius, type); } +void CFBWindow::paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius, int type) +{ + frameBuffer->paintBoxFrame(x + _x, y + _y, _dx, _dy, _px, _col, radius, type); +} + void CFBWindow::paintVLineRel(int _x, int _y, int _dy, const color_t _col) { frameBuffer->paintVLineRel(x + _x, y + _y, _dy, _col); diff --git a/src/driver/fb_window.h b/src/driver/fb_window.h index 3cad57c77..5d9efc0f7 100644 --- a/src/driver/fb_window.h +++ b/src/driver/fb_window.h @@ -43,6 +43,7 @@ class CFBWindow ~CFBWindow(); void paintBoxRel(const int _x, const int _y, const int _dx, const int _dy, const color_t _col, int radius = 0, int type = 0xF); + void paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius = 0, int type = 0xf); void paintVLineRel(int _x, int _y, int _dy, const color_t _col); void paintHLineRel(int _x, int _dx, int _y, const color_t _col); bool paintIcon(const char * const _filename, const int _x, const int _y, const int _h = 0, const color_t _offset = 1); From ecce3ca6b958122a7fdcdfb71e464ddd7e87d7b1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 12 Aug 2016 15:35:22 +0200 Subject: [PATCH 2/2] messagebox/msgbox: respect user colors for inactive buttons; ... paint buttons with shadow and small frame Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba9a54a0a91c05d46ec369181c2754073de0501b Author: vanhofen Date: 2016-08-12 (Fri, 12 Aug 2016) Origin message was: ------------------ - messagebox/msgbox: respect user colors for inactive buttons; ... paint buttons with shadow and small frame ------------------ This commit was generated by Migit --- src/gui/widget/messagebox.cpp | 12 +++++++----- src/gui/widget/msgbox.cpp | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index f5d6aa117..5f09532c4 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -74,8 +74,8 @@ void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowB i_maxw = std::max(w, i_maxw); } fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - b_height = std::max(fh, ih) + 8 + (RADIUS_LARGE / 2); - m_bbheight = b_height + fh/2 + ButtonSpacing; + b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2); + m_bbheight = b_height + fh/2 + ButtonSpacing + SHADOW_OFFSET; result = Default; b_width = getButtonWidth(); if (ShowButtons & CMessageBox::mbBtnAlignCenter1) @@ -172,11 +172,13 @@ void CMessageBox::paintButtons() color = COL_MENUCONTENTSELECTED_TEXT; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); + m_window->paintBoxRel(xpos + SHADOW_OFFSET, ypos + SHADOW_OFFSET, b_width, b_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); + m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 4f9821ebe..6578437e6 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -356,10 +356,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); @@ -377,11 +379,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); @@ -399,11 +402,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, ButtonWidth, m_nFontFootHeight + 4, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color);