mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed scaling issue on mac and compilation issue
This commit is contained in:
parent
57974508d3
commit
92cc1f354b
2 changed files with 32 additions and 11 deletions
|
@ -4,14 +4,16 @@
|
|||
#include <QtGlobal>
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
#define DEFAULT_FONT_FAMILY "Segoe UI"
|
||||
#define DEFAULT_FONT_SIZE 10
|
||||
#elif Q_OS_MACOS
|
||||
#define DEFAULT_FONT_FAMILY "Helvetica Neue"
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
#define DEFAULT_FONT_FAMILY "Segoe UI"
|
||||
#define DEFAULT_FONT_SIZE 10
|
||||
#else
|
||||
#define DEFAULT_FONT_FAMILY "Arial"
|
||||
#define DEFAULT_FONT_SIZE 11
|
||||
#ifdef Q_OS_MACOS
|
||||
#define DEFAULT_FONT_FAMILY "Helvetica Neue"
|
||||
#define DEFAULT_FONT_SIZE 12
|
||||
#else
|
||||
#define DEFAULT_FONT_FAMILY "Arial"
|
||||
#define DEFAULT_FONT_SIZE 11
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace chatterino {
|
||||
|
|
|
@ -516,7 +516,7 @@ void ChannelView::paintEvent(QPaintEvent * /*event*/)
|
|||
QPainter painter(this);
|
||||
|
||||
// only update gif emotes
|
||||
#ifndef Q_OS_MAC
|
||||
#ifndef Q_OS_MACOS
|
||||
// if (this->onlyUpdateEmotes) {
|
||||
// this->onlyUpdateEmotes = false;
|
||||
|
||||
|
@ -583,8 +583,18 @@ void ChannelView::drawMessages(QPainter &painter, bool overlays)
|
|||
bool updateBuffer = false;
|
||||
|
||||
if (!buffer) {
|
||||
buffer =
|
||||
std::shared_ptr<QPixmap>(new QPixmap(this->width(), messageRef->getHeight()));
|
||||
QPixmap *pixmap;
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
|
||||
pixmap = new QPixmap(
|
||||
(int)(this->width() * painter.device()->devicePixelRatioF()),
|
||||
(int)(messageRef->getHeight() * painter.device()->devicePixelRatioF()));
|
||||
pixmap->setDevicePixelRatio(painter.device()->devicePixelRatioF());
|
||||
#else
|
||||
pixmap = new QPixmap(this->width(), messageRef->getHeight());
|
||||
#endif
|
||||
buffer = std::shared_ptr<QPixmap>(pixmap);
|
||||
updateBuffer = true;
|
||||
}
|
||||
|
||||
|
@ -617,7 +627,16 @@ void ChannelView::drawMessages(QPainter &painter, bool overlays)
|
|||
messageRef->buffer = buffer;
|
||||
|
||||
if (buffer) {
|
||||
painter.drawPixmap(0, y, *buffer.get());
|
||||
//#ifdef Q_OS_MACOS
|
||||
// painter.setRenderHint(QPainter::SmoothPixmapTransform, false);
|
||||
// painter.drawPixmap(0, y,
|
||||
|
||||
// (int)(buffer->width() / painter.device()->devicePixelRatioF()),
|
||||
// (int)(buffer->height() / painter.device()->devicePixelRatioF()),
|
||||
// *buffer.get());
|
||||
//#else
|
||||
painter.drawPixmap(0, y, *buffer.get());
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue