Enable hidpi (retina) support under osx

* add to the application bundle a custom info.plist
 * fix a graphic glitch on the life counter
This commit is contained in:
Fabio Bas 2015-04-26 22:50:59 +02:00
parent 54f0706b4a
commit e88bad786f
3 changed files with 40 additions and 2 deletions

View file

@ -242,6 +242,7 @@ if(UNIX)
set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
set_target_properties(cockatrice PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/Info.plist)
INSTALL(TARGETS cockatrice BUNDLE DESTINATION ./)
INSTALL(FILES ${cockatrice_QM} DESTINATION ./cockatrice.app/Contents/Resources/translations)

View file

@ -38,9 +38,8 @@ void PlayerCounter::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*
painter->drawPath(path);
QRectF translatedRect = painter->combinedTransform().mapRect(boundingRect());
QRectF translatedRect = path.controlPointRect();
QSize translatedSize = translatedRect.size().toSize();
painter->resetTransform();
QFont font("Serif");
font.setWeight(QFont::Bold);
font.setPixelSize(qMax((int) round(translatedSize.height() / 1.3), 9));