messagebox/msgbox: respect user colors for inactive buttons; ...

paint buttons with shadow and small frame


Origin commit data
------------------
Branch: ni/coolstream
Commit: ba9a54a0a9
Author: vanhofen <vanhofen@gmx.de>
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
This commit is contained in:
vanhofen
2016-08-12 15:35:22 +02:00
parent da9e03b1df
commit ecce3ca6b9
2 changed files with 19 additions and 13 deletions

View File

@@ -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);

View File

@@ -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);