Skip to content

Commit

Permalink
Merge pull request #14725 from unknownbrackets/ui-store
Browse files Browse the repository at this point in the history
Store: Make description focusable
  • Loading branch information
hrydgard committed Aug 14, 2021
2 parents 32f0c19 + 69ef21a commit aeb01a9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions UI/Store.cpp
Expand Up @@ -270,13 +270,16 @@ void ProductView::CreateViews() {
cancelButton_->SetVisibility(isDownloading ? V_VISIBLE : V_GONE);

// Add star rating, comments etc?
Add(new TextView(entry_.description, ALIGN_LEFT | FLAG_WRAP_TEXT, false));

float size = entry_.size / (1024.f * 1024.f);
char temp[256];
sprintf(temp, "%s: %.2f %s", st->T("Size"), size, st->T("MB"));
// Draw each line separately so focusing can scroll.
std::vector<std::string> lines;
SplitString(entry_.description, '\n', lines);
for (auto &line : lines) {
Add(new TextView(line, ALIGN_LEFT | FLAG_WRAP_TEXT, false))->SetFocusable(true);
}

Add(new TextView(temp));
float size = entry_.size / (1024.f * 1024.f);
Add(new TextView(StringFromFormat("%s: %.2f %s", st->T("Size"), size, st->T("MB"))));
}

void ProductView::Update() {
Expand Down

0 comments on commit aeb01a9

Please sign in to comment.