Fix flickering when running with Direct2D (#4851)
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
|
- Dev: Add `WindowManager::getLastSelectedWindow()` to replace `getMainWindow()`. (#4816)
|
||||||
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
|
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
|
||||||
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846)
|
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846)
|
||||||
|
- Dev: Fixed flickering when running with Direct2D on Windows. (#4851)
|
||||||
|
|
||||||
## 2.4.5
|
## 2.4.5
|
||||||
|
|
||||||
|
|||||||
@@ -1117,7 +1117,6 @@ void Notebook::setTabLocation(NotebookTabLocation location)
|
|||||||
|
|
||||||
void Notebook::paintEvent(QPaintEvent *event)
|
void Notebook::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
BaseWidget::paintEvent(event);
|
|
||||||
auto scale = this->scale();
|
auto scale = this->scale();
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
|||||||
@@ -133,7 +133,11 @@ void Button::setMenu(std::unique_ptr<QMenu> menu)
|
|||||||
void Button::paintEvent(QPaintEvent *)
|
void Button::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
this->paintButton(painter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Button::paintButton(QPainter &painter)
|
||||||
|
{
|
||||||
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
if (!this->pixmap_.isNull())
|
if (!this->pixmap_.isNull())
|
||||||
|
|||||||
@@ -56,7 +56,13 @@ signals:
|
|||||||
void leftMousePress();
|
void leftMousePress();
|
||||||
|
|
||||||
protected:
|
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)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
void enterEvent(QEnterEvent * /*event*/) override;
|
void enterEvent(QEnterEvent * /*event*/) override;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ void NotebookButton::paintEvent(QPaintEvent *event)
|
|||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
Button::paintEvent(event);
|
this->paintButton(painter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
|
void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ void TitleBarButton::paintEvent(QPaintEvent *event)
|
|||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
|
|
||||||
Button::paintEvent(event);
|
this->paintButton(painter);
|
||||||
// this->fancyPaint(painter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
Reference in New Issue
Block a user