mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-19 20:34:26 +01:00
Add a new Choice subclass which lets the UI display a value in addition to the title, similar to other controls.
This commit is contained in:
1 parent
ceb5a94c4a
commit
085faa87cc
2 files changed
+30
No files matched your search
@@ -450,4 +450,19 @@ void TextEditPopupScreen::OnCompleted(DialogResult result) {
|
||||
}
|
||||
}
|
||||
|
||||
void ChoiceWithValueDisplay::Draw(UIContext &dc) {
|
||||
Style style = dc.theme->itemStyle;
|
||||
std::ostringstream valueText;
|
||||
Choice::Draw(dc);
|
||||
dc.SetFontStyle(dc.theme->uiFont);
|
||||
|
||||
if (sValue_ != nullptr) {
|
||||
valueText << *sValue_;
|
||||
} else if (iValue_ != nullptr) {
|
||||
valueText << *iValue_;
|
||||
}
|
||||
|
||||
dc.DrawText(valueText.str().c_str(), bounds_.x2() - 12, bounds_.centerY(), style.fgColor, ALIGN_RIGHT | ALIGN_VCENTER);
|
||||
}
|
||||
|
||||
} // namespace UI
|
||||
Reference in new issue
Block a user