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>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#define DEFAULT_FONT_FAMILY "Segoe UI"
|
#define DEFAULT_FONT_FAMILY "Segoe UI"
|
||||||
#define DEFAULT_FONT_SIZE 10
|
#define DEFAULT_FONT_SIZE 10
|
||||||
#elif Q_OS_MACOS
|
|
||||||
#define DEFAULT_FONT_FAMILY "Helvetica Neue"
|
|
||||||
#define DEFAULT_FONT_SIZE 12
|
|
||||||
#else
|
#else
|
||||||
#define DEFAULT_FONT_FAMILY "Arial"
|
#ifdef Q_OS_MACOS
|
||||||
#define DEFAULT_FONT_SIZE 11
|
#define DEFAULT_FONT_FAMILY "Helvetica Neue"
|
||||||
|
#define DEFAULT_FONT_SIZE 12
|
||||||
|
#else
|
||||||
|
#define DEFAULT_FONT_FAMILY "Arial"
|
||||||
|
#define DEFAULT_FONT_SIZE 11
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
|
@ -516,7 +516,7 @@ void ChannelView::paintEvent(QPaintEvent * /*event*/)
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|
||||||
// only update gif emotes
|
// only update gif emotes
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MACOS
|
||||||
// if (this->onlyUpdateEmotes) {
|
// if (this->onlyUpdateEmotes) {
|
||||||
// this->onlyUpdateEmotes = false;
|
// this->onlyUpdateEmotes = false;
|
||||||
|
|
||||||
|
@ -583,8 +583,18 @@ void ChannelView::drawMessages(QPainter &painter, bool overlays)
|
||||||
bool updateBuffer = false;
|
bool updateBuffer = false;
|
||||||
|
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
buffer =
|
QPixmap *pixmap;
|
||||||
std::shared_ptr<QPixmap>(new QPixmap(this->width(), messageRef->getHeight()));
|
|
||||||
|
#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;
|
updateBuffer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,7 +627,16 @@ void ChannelView::drawMessages(QPainter &painter, bool overlays)
|
||||||
messageRef->buffer = buffer;
|
messageRef->buffer = buffer;
|
||||||
|
|
||||||
if (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