WX: HiDPI: Dolphin Main UI (CFrame)

This commit is contained in:
EmptyChaos
2016-08-14 19:54:01 +00:00
parent 73a20551df
commit 107d4afb08
10 changed files with 169 additions and 203 deletions

View File

@ -283,19 +283,16 @@ bool GameListItem::ReadPNGBanner(const std::string& path)
wxBitmap GameListItem::ScaleBanner(wxImage* image)
{
const double gui_scale = wxTheApp->GetTopWindow()->GetContentScaleFactor();
wxWindow* window = wxTheApp->GetTopWindow();
const double gui_scale = window->GetContentScaleFactor() * (window->FromDIP(1024) / 1024.0);
const double target_width = DVD_BANNER_WIDTH * gui_scale;
const double target_height = DVD_BANNER_HEIGHT * gui_scale;
const double banner_scale =
std::min(target_width / image->GetWidth(), target_height / image->GetHeight());
image->Rescale(image->GetWidth() * banner_scale, image->GetHeight() * banner_scale,
wxIMAGE_QUALITY_HIGH);
wxIMAGE_QUALITY_BICUBIC);
image->Resize(wxSize(target_width, target_height), wxPoint(), 0xFF, 0xFF, 0xFF);
#ifdef __APPLE__
return wxBitmap(*image, -1, gui_scale);
#else
return wxBitmap(*image, -1);
#endif
return wxBitmap(*image, wxBITMAP_SCREEN_DEPTH, window->GetContentScaleFactor());
}
std::string GameListItem::GetDescription(DiscIO::Language language) const