Permalink
Browse files

UI: Actually offset text shadow.

It wasn't actually visible before, since it was strictly underneath text
that was usually white.
  • Loading branch information...
unknownbrackets committed Jan 2, 2018
1 parent c793da5 commit d4400b358a1c1db2b26146e1c7ff66c77e75426c
Showing with 5 additions and 4 deletions.
  1. +4 −3 UI/ReportScreen.cpp
  2. +1 −1 ext/native/ui/view.cpp
View
@@ -62,11 +62,11 @@ class RatingChoice : public LinearLayout {
RatingChoice::RatingChoice(const char *captionKey, int *value, LayoutParams *layoutParams)
: LinearLayout(ORIENT_VERTICAL, layoutParams), value_(value) {
SetSpacing(-8.0f);
SetSpacing(0.0f);
I18NCategory *rp = GetI18NCategory("Reporting");
group_ = new LinearLayout(ORIENT_HORIZONTAL);
Add(new InfoItem(rp->T(captionKey), ""));
Add(new TextView(rp->T(captionKey)))->SetShadow(true);
Add(group_);
group_->SetSpacing(0.0f);
@@ -223,7 +223,7 @@ void ReportScreen::CreateViews() {
ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL);
leftColumnItems->Add(new TextView(rp->T("FeedbackDesc", "How's the emulation? Let us and the community know!"), new LinearLayoutParams(Margins(12, 5, 0, 5))));
leftColumnItems->Add(new TextView(rp->T("FeedbackDesc", "How's the emulation? Let us and the community know!"), new LinearLayoutParams(Margins(12, 5, 0, 5))))->SetShadow(true);
if (!Reporting::IsEnabled()) {
reportingNotice_ = leftColumnItems->Add(new TextView(rp->T("FeedbackDisabled", "Compatibility server reports must be enabled."), new LinearLayoutParams(Margins(12, 5, 0, 5))));
reportingNotice_->SetShadow(true);
@@ -258,6 +258,7 @@ void ReportScreen::CreateViews() {
leftColumnItems->Add(new CompatRatingChoice("Overall", (int *)&overall_))->SetEnabledPtr(&enableReporting_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
overallDescription_ = leftColumnItems->Add(new TextView("", new LinearLayoutParams(Margins(10, 0))));
overallDescription_->SetShadow(true);
leftColumnItems->Add(new RatingChoice("Graphics", &graphics_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
leftColumnItems->Add(new RatingChoice("Speed", &speed_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
leftColumnItems->Add(new RatingChoice("Gameplay", &gameplay_))->SetEnabledPtr(&ratingEnabled_)->OnChoice.Handle(this, &ReportScreen::HandleChoice);
View
@@ -837,7 +837,7 @@ void TextView::Draw(UIContext &dc) {
dc.SetFontStyle(small_ ? dc.theme->uiFontSmall : dc.theme->uiFont);
if (shadow_) {
uint32_t shadowColor = 0x80000000;
dc.DrawTextRect(text_.c_str(), bounds_, shadowColor, textAlign_);
dc.DrawTextRect(text_.c_str(), bounds_.Offset(1.0f, 1.0f), shadowColor, textAlign_);
}
uint32_t textColor = hasTextColor_ ? textColor_ : dc.theme->infoStyle.fgColor;
dc.DrawTextRect(text_.c_str(), bounds_, textColor, textAlign_);

0 comments on commit d4400b3

Please sign in to comment.