Make update notification a little better - correct colour. Correct multiline label for Confirm prompt

This commit is contained in:
Simon Robertshaw 2012-07-03 13:58:59 +01:00
parent e5f96cd3c9
commit c996d01228
5 changed files with 16 additions and 3 deletions

View File

@ -738,11 +738,17 @@ void Graphics::draw_icon(int x, int y, Icon icon)
drawchar(x, y, 0x8C, 160, 144, 32, 255); drawchar(x, y, 0x8C, 160, 144, 32, 255);
drawchar(x, y, 0x84, 255, 255, 255, 255); drawchar(x, y, 0x84, 255, 255, 255, 255);
break; break;
case IconClose:
drawchar(x, y, 0xAA, 230, 230, 230, 255);
break;
case IconVoteSort: case IconVoteSort:
case IconDateSort: case IconDateSort:
case IconFolder: case IconFolder:
case IconSearch: case IconSearch:
case IconDelete: case IconDelete:
drawchar(x, y, 0x86, 255, 55, 55, 255);
drawchar(x, y, 0x85, 255, 255, 255, 255);
break;
default: default:
drawchar(x, y, 't', 255, 255, 255, 255); drawchar(x, y, 't', 255, 255, 255, 255);
break; break;

View File

@ -79,7 +79,8 @@ enum Icon
IconDelete, IconDelete,
IconReport, IconReport,
IconUsername, IconUsername,
IconPassword IconPassword,
IconClose
}; };
//"Graphics lite" - slightly lower performance due to variable size, //"Graphics lite" - slightly lower performance due to variable size,

View File

@ -23,6 +23,7 @@ ConfirmPrompt::ConfirmPrompt(std::string title, std::string message, ConfirmDial
ui::Label * messageLabel = new ui::Label(ui::Point(4, 25), ui::Point(Size.X-8, -1), message); ui::Label * messageLabel = new ui::Label(ui::Point(4, 25), ui::Point(Size.X-8, -1), message);
messageLabel->SetMultiline(true);
messageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; messageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
messageLabel->Appearance.VerticalAlign = ui::Appearance::AlignTop; messageLabel->Appearance.VerticalAlign = ui::Appearance::AlignTop;
AddComponent(messageLabel); AddComponent(messageLabel);

View File

@ -681,7 +681,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
} }
}; };
gameModel->AddNotification(new UpdateNotification(this, "An Update is available")); gameModel->AddNotification(new UpdateNotification(this, "A new version is available - click here to download"));
} }
void GameController::RemoveNotification(Notification * notification) void GameController::RemoveNotification(Notification * notification)

View File

@ -2,6 +2,7 @@
#include <iomanip> #include <iomanip>
#include "Config.h" #include "Config.h"
#include "Style.h"
#include "GameView.h" #include "GameView.h"
#include "Graphics.h" #include "Graphics.h"
#include "interface/Window.h" #include "interface/Window.h"
@ -988,12 +989,16 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
int width = (Graphics::textwidth((*iter)->Message.c_str()))+8; int width = (Graphics::textwidth((*iter)->Message.c_str()))+8;
ui::Button * tempButton = new ui::Button(ui::Point(XRES-width-22, currentY), ui::Point(width, 15), (*iter)->Message); ui::Button * tempButton = new ui::Button(ui::Point(XRES-width-22, currentY), ui::Point(width, 15), (*iter)->Message);
tempButton->SetActionCallback(new NotificationButtonAction(this, *iter)); tempButton->SetActionCallback(new NotificationButtonAction(this, *iter));
tempButton->Appearance.BorderInactive = style::Colour::WarningTitle;
tempButton->Appearance.TextInactive = style::Colour::WarningTitle;
AddComponent(tempButton); AddComponent(tempButton);
notificationComponents.push_back(tempButton); notificationComponents.push_back(tempButton);
tempButton = new ui::Button(ui::Point(XRES-20, currentY), ui::Point(15, 15)); tempButton = new ui::Button(ui::Point(XRES-20, currentY), ui::Point(15, 15));
tempButton->SetIcon(IconDelete); tempButton->SetIcon(IconClose);
tempButton->SetActionCallback(new CloseNotificationButtonAction(this, *iter)); tempButton->SetActionCallback(new CloseNotificationButtonAction(this, *iter));
tempButton->Appearance.BorderInactive = style::Colour::WarningTitle;
tempButton->Appearance.TextInactive = style::Colour::WarningTitle;
AddComponent(tempButton); AddComponent(tempButton);
notificationComponents.push_back(tempButton); notificationComponents.push_back(tempButton);