mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixes #491, font size in notebooktab too big
This commit is contained in:
parent
68ddd1e7c9
commit
22167f33f2
2 changed files with 7 additions and 6 deletions
|
@ -33,9 +33,10 @@ void installCustomPalette();
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// QApplication::setAttribute(Qt::AA_Use96Dpi, false);
|
||||
QApplication::setAttribute(Qt::AA_Use96Dpi, true);
|
||||
#ifdef Q_OS_WIN32
|
||||
// QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
|
||||
// QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
#endif
|
||||
// QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL, true);
|
||||
QApplication a(argc, argv);
|
||||
|
|
|
@ -415,12 +415,12 @@ bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message, long *r
|
|||
case WM_DPICHANGED: {
|
||||
int dpi = HIWORD(msg->wParam);
|
||||
|
||||
float oldScale = this->scale;
|
||||
float _scale = dpi / 96.f;
|
||||
float resizeScale = _scale / oldScale;
|
||||
|
||||
this->resize(static_cast<int>(this->width() * resizeScale),
|
||||
static_cast<int>(this->height() * resizeScale));
|
||||
auto *prcNewWindow = reinterpret_cast<RECT *>(msg->lParam);
|
||||
SetWindowPos(msg->hwnd, nullptr, prcNewWindow->left, prcNewWindow->top,
|
||||
prcNewWindow->right - prcNewWindow->left,
|
||||
prcNewWindow->bottom - prcNewWindow->top, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
this->nativeScale_ = _scale;
|
||||
this->updateScale();
|
||||
|
|
Loading…
Reference in a new issue