mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fix: don't attempt to scale windows opted out of scaling (#5400)
This commit is contained in:
parent
614a1c469f
commit
3ed1c0f7a4
4 changed files with 24 additions and 4 deletions
|
@ -8,7 +8,7 @@
|
|||
- Minor: Colored usernames now update on the fly when changing the "Color @usernames" setting. (#5300)
|
||||
- Minor: Added `flags.action` filter variable, allowing you to filter on `/me` messages. (#5397)
|
||||
- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
|
||||
- Dev: Use Qt's high DPI scaling. (#4868)
|
||||
- Dev: Use Qt's high DPI scaling. (#4868, #5400)
|
||||
- Dev: Add doxygen build target. (#5377)
|
||||
- Dev: Make printing of strings in tests easier. (#5379)
|
||||
- Dev: Refactor and document `Scrollbar`. (#5334, #5393)
|
||||
|
|
|
@ -931,9 +931,27 @@ void BaseWindow::updateScale()
|
|||
|
||||
this->setScale(scale);
|
||||
|
||||
for (auto *child : this->findChildren<BaseWidget *>())
|
||||
BaseWindow::applyScaleRecursive(this, scale);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(misc-no-recursion)
|
||||
void BaseWindow::applyScaleRecursive(QObject *root, float scale)
|
||||
{
|
||||
for (QObject *obj : root->children())
|
||||
{
|
||||
child->setScale(scale);
|
||||
auto *base = dynamic_cast<BaseWidget *>(obj);
|
||||
if (base)
|
||||
{
|
||||
auto *window = dynamic_cast<BaseWindow *>(obj);
|
||||
if (window)
|
||||
{
|
||||
// stop here, the window will get the event as well (via uiScale)
|
||||
continue;
|
||||
}
|
||||
base->setScale(scale);
|
||||
}
|
||||
|
||||
applyScaleRecursive(obj, scale);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,8 @@ private:
|
|||
void drawCustomWindowFrame(QPainter &painter);
|
||||
void onFocusLost();
|
||||
|
||||
static void applyScaleRecursive(QObject *root, float scale);
|
||||
|
||||
bool handleSHOWWINDOW(MSG *msg);
|
||||
bool handleSIZE(MSG *msg);
|
||||
bool handleMOVE(MSG *msg);
|
||||
|
|
|
@ -196,7 +196,7 @@ void SettingsDialog::filterElements(const QString &text)
|
|||
auto *item = this->ui_.tabContainer->itemAt(i);
|
||||
if (auto *x = dynamic_cast<QSpacerItem *>(item); x)
|
||||
{
|
||||
x->changeSize(10, shouldShowSpace ? int(16 * this->scale()) : 0);
|
||||
x->changeSize(10, shouldShowSpace ? 16 : 0);
|
||||
shouldShowSpace = false;
|
||||
}
|
||||
else if (item->widget())
|
||||
|
|
Loading…
Reference in a new issue