mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix flickering when running with Direct2D (#4851)
This commit is contained in:
parent
4d8b62364d
commit
916427a612
|
@ -26,6 +26,7 @@
|
|||
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
|
||||
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
|
||||
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846)
|
||||
- Dev: Fixed flickering when running with Direct2D on Windows. (#4851)
|
||||
|
||||
## 2.4.5
|
||||
|
||||
|
|
|
@ -1117,7 +1117,6 @@ void Notebook::setTabLocation(NotebookTabLocation location)
|
|||
|
||||
void Notebook::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
BaseWidget::paintEvent(event);
|
||||
auto scale = this->scale();
|
||||
|
||||
QPainter painter(this);
|
||||
|
|
|
@ -133,7 +133,11 @@ void Button::setMenu(std::unique_ptr<QMenu> menu)
|
|||
void Button::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter(this);
|
||||
this->paintButton(painter);
|
||||
}
|
||||
|
||||
void Button::paintButton(QPainter &painter)
|
||||
{
|
||||
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||
|
||||
if (!this->pixmap_.isNull())
|
||||
|
|
|
@ -56,7 +56,13 @@ signals:
|
|||
void leftMousePress();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
void paintEvent(QPaintEvent * /*event*/) override;
|
||||
|
||||
/// Paint this button.
|
||||
/// This is intended for child classes that may want to paint the overlay.
|
||||
/// This function should be used after rendering the custom button,
|
||||
/// because the painter's state will be modified by this function.
|
||||
void paintButton(QPainter &painter);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
void enterEvent(QEnterEvent * /*event*/) override;
|
||||
#else
|
||||
|
|
|
@ -138,7 +138,7 @@ void NotebookButton::paintEvent(QPaintEvent *event)
|
|||
default:;
|
||||
}
|
||||
|
||||
Button::paintEvent(event);
|
||||
this->paintButton(painter);
|
||||
}
|
||||
|
||||
void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
|
||||
|
|
|
@ -121,8 +121,7 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||
default:;
|
||||
}
|
||||
|
||||
Button::paintEvent(event);
|
||||
// this->fancyPaint(painter);
|
||||
this->paintButton(painter);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
|
Loading…
Reference in a new issue