diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 6d674cc8c5..0cb3a492ad 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -87,7 +87,7 @@ public: std::string image_path = ReplaceAll(savePath_, ".ppst", ".jpg"); if (File::Exists(image_path)) { PrioritizedWorkQueue *wq = g_gameInfoCache->WorkQueue(); - toprow->Add(new AsyncImageFileView(image_path, IS_DEFAULT, wq, new UI::LayoutParams(500, 500/16*9))); + toprow->Add(new AsyncImageFileView(image_path, IS_DEFAULT, wq, new LinearLayoutParams(480, 272, Margins(10, 0)))); } else { toprow->Add(new TextView(sa->T("No screenshot"), new LinearLayoutParams(Margins(10, 5)))); } @@ -101,6 +101,9 @@ public: root->Add(buttons); } +protected: + virtual UI::Size PopupWidth() const { return 500; } + private: UI::EventReturn OnDeleteButtonClick(UI::EventParams &e); std::string savePath_; diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index ad02a88f00..55a7b36a0f 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -229,7 +229,7 @@ void PopupScreen::CreateViews() { float yres = screenManager()->getUIContext()->GetBounds().h; box_ = new LinearLayout(ORIENT_VERTICAL, - new AnchorLayoutParams(550, FillVertical() ? yres - 30 : WRAP_CONTENT, dc.GetBounds().centerX(), dc.GetBounds().centerY(), NONE, NONE, true)); + new AnchorLayoutParams(PopupWidth(), FillVertical() ? yres - 30 : WRAP_CONTENT, dc.GetBounds().centerX(), dc.GetBounds().centerY(), NONE, NONE, true)); root_->Add(box_); box_->SetBG(UI::Drawable(0xFF303030)); diff --git a/ext/native/ui/ui_screen.h b/ext/native/ui/ui_screen.h index 63397e854e..d408c1cfc5 100644 --- a/ext/native/ui/ui_screen.h +++ b/ext/native/ui/ui_screen.h @@ -65,6 +65,7 @@ public: protected: virtual bool FillVertical() const { return false; } + virtual UI::Size PopupWidth() const { return 550; } virtual bool ShowButtons() const { return true; } virtual void OnCompleted(DialogResult result) {}