Fix text wrapping on PromptScreen by improving the layout

This commit is contained in:
Henrik Rydgård 2021-12-13 22:42:03 +01:00
parent ff887b0f11
commit c07068f89b
2 changed files with 5 additions and 7 deletions

View File

@ -732,6 +732,7 @@ void SoftwareTransform::ExpandRectangles(int vertexCount, int &maxIndex, u16 *&i
if (throughmode) {
RotateUVThrough(trans);
} else {
// transVtxTL.z == transVtxBR.z actually, but the pos_w might be different.
float tlz = transVtxTL.z / transVtxTL.pos_w;
float brz = transVtxBR.z / transVtxBR.pos_w;
if (!gstate.isDepthClampEnabled()) {

View File

@ -488,16 +488,13 @@ void PromptScreen::CreateViews() {
Margins actionMenuMargins(0, 100, 15, 0);
root_ = new LinearLayout(ORIENT_HORIZONTAL);
root_ = new AnchorLayout();
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
root_->Add(leftColumn);
root_->Add(new TextView(message_, ALIGN_LEFT | FLAG_WRAP_TEXT, false, new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, 15, 15, 330, 10)))->SetClip(false);
float leftColumnWidth = dp_xres - actionMenuMargins.left - actionMenuMargins.right - 300.0f;
leftColumn->Add(new TextView(message_, ALIGN_LEFT | FLAG_WRAP_TEXT, false, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, 10, NONE, NONE)))->SetClip(false);
ViewGroup *rightColumnItems = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
ViewGroup *rightColumnItems = new LinearLayout(ORIENT_VERTICAL, new AnchorLayoutParams(300, WRAP_CONTENT, NONE, 15, 15, NONE));
root_->Add(rightColumnItems);
Choice *yesButton = rightColumnItems->Add(new Choice(yesButtonText_));
yesButton->OnClick.Handle(this, &PromptScreen::OnYes);
root_->SetDefaultFocusView(yesButton);