mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
* CMessageBox: Buttons draw better
- Paint the default button corrected. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2074 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -83,19 +83,16 @@ void CMessageBox::Init(const CMessageBox::result_ Default, const uint32_t ShowBu
|
|||||||
|
|
||||||
ButtonCount = 0;
|
ButtonCount = 0;
|
||||||
if (showbuttons & mbYes) {
|
if (showbuttons & mbYes) {
|
||||||
Buttons[ButtonCount].def = (result == mbrYes) ? true : false;
|
|
||||||
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED;
|
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_RED;
|
||||||
Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES);
|
Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_YES);
|
||||||
ButtonCount++;
|
ButtonCount++;
|
||||||
}
|
}
|
||||||
if (showbuttons & mbNo) {
|
if (showbuttons & mbNo) {
|
||||||
Buttons[ButtonCount].def = (result == mbrNo) ? true : false;
|
|
||||||
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN;
|
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_GREEN;
|
||||||
Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO);
|
Buttons[ButtonCount].text = g_Locale->getText(LOCALE_MESSAGEBOX_NO);
|
||||||
ButtonCount++;
|
ButtonCount++;
|
||||||
}
|
}
|
||||||
if (showbuttons & (mbCancel | mbBack | mbOk)) {
|
if (showbuttons & (mbCancel | mbBack | mbOk)) {
|
||||||
Buttons[ButtonCount].def = (result >= mbrCancel) ? true : false;
|
|
||||||
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME;
|
Buttons[ButtonCount].icon = NEUTRINO_ICON_BUTTON_HOME;
|
||||||
Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK);
|
Buttons[ButtonCount].text = g_Locale->getText((showbuttons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : (showbuttons & mbOk) ? LOCALE_MESSAGEBOX_OK : LOCALE_MESSAGEBOX_BACK);
|
||||||
ButtonCount++;
|
ButtonCount++;
|
||||||
@@ -129,8 +126,8 @@ void CMessageBox::paintButtons()
|
|||||||
{
|
{
|
||||||
fb_pixel_t color;
|
fb_pixel_t color;
|
||||||
fb_pixel_t bgcolor;
|
fb_pixel_t bgcolor;
|
||||||
|
int iw, ih, i;
|
||||||
|
|
||||||
int iw, ih;
|
|
||||||
int xpos = (m_width - bb_width) / 2;
|
int xpos = (m_width - bb_width) / 2;
|
||||||
if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1)
|
if (mbBtnAlign == CMessageBox::mbBtnAlignCenter1)
|
||||||
xpos = ButtonDistance;
|
xpos = ButtonDistance;
|
||||||
@@ -145,7 +142,19 @@ void CMessageBox::paintButtons()
|
|||||||
|
|
||||||
m_window->paintBoxRel(0, m_height - bb_height, m_width, bb_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
m_window->paintBoxRel(0, m_height - bb_height, m_width, bb_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
||||||
|
|
||||||
for (int i = 0; i < ButtonCount; i++) {
|
i = 0;
|
||||||
|
if (showbuttons & mbYes) {
|
||||||
|
Buttons[i].def = (result == mbrYes) ? true : false;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (showbuttons & mbNo) {
|
||||||
|
Buttons[i].def = (result == mbrNo) ? true : false;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (showbuttons & (mbCancel | mbBack | mbOk))
|
||||||
|
Buttons[i].def = (result >= mbrCancel) ? true : false;
|
||||||
|
|
||||||
|
for (i = 0; i < ButtonCount; i++) {
|
||||||
if (Buttons[i].def) {
|
if (Buttons[i].def) {
|
||||||
color = COL_MENUCONTENTSELECTED;
|
color = COL_MENUCONTENTSELECTED;
|
||||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||||
|
Reference in New Issue
Block a user