Only draw outline for overlay when hovered over (#6140)
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
||||||
- Minor: Make paused chat indicator more visible, and fix its zoom behavior. (#6123)
|
- Minor: Make paused chat indicator more visible, and fix its zoom behavior. (#6123)
|
||||||
- Minor: Added WebSocket API for plugins. (#6076)
|
- Minor: Added WebSocket API for plugins. (#6076)
|
||||||
|
- Minor: Popup overlay now only draws an outline when being interacted with. (#6140)
|
||||||
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
|
- Bugfix: Don't create native messaging manifest file if browser directory doesn't exist. (#6116)
|
||||||
- Bugfix: Fixed scrolling now working on inputs in the settings. (#6128)
|
- Bugfix: Fixed scrolling now working on inputs in the settings. (#6128)
|
||||||
- Bugfix: Make reply-cancel button less coarse-grained. (#6106)
|
- Bugfix: Make reply-cancel button less coarse-grained. (#6106)
|
||||||
|
|||||||
@@ -974,14 +974,17 @@ void BaseWindow::scaleChangedEvent(float scale)
|
|||||||
void BaseWindow::paintEvent(QPaintEvent *)
|
void BaseWindow::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
|
this->drawOutline(painter);
|
||||||
|
this->drawCustomWindowFrame(painter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseWindow::drawOutline(QPainter &painter)
|
||||||
|
{
|
||||||
if (this->frameless_)
|
if (this->frameless_)
|
||||||
{
|
{
|
||||||
painter.setPen(QColor("#999"));
|
painter.setPen(QColor("#999"));
|
||||||
painter.drawRect(0, 0, this->width() - 1, this->height() - 1);
|
painter.drawRect(0, 0, this->width() - 1, this->height() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->drawCustomWindowFrame(painter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float BaseWindow::desiredScale() const
|
float BaseWindow::desiredScale() const
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ protected:
|
|||||||
void scaleChangedEvent(float) override;
|
void scaleChangedEvent(float) override;
|
||||||
|
|
||||||
void paintEvent(QPaintEvent *) override;
|
void paintEvent(QPaintEvent *) override;
|
||||||
|
virtual void drawOutline(QPainter &);
|
||||||
|
|
||||||
void changeEvent(QEvent *) override;
|
void changeEvent(QEvent *) override;
|
||||||
void leaveEvent(QEvent *) override;
|
void leaveEvent(QEvent *) override;
|
||||||
|
|||||||
@@ -611,4 +611,8 @@ void OverlayWindow::setInert(bool inert)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OverlayWindow::drawOutline(QPainter & /* painter */)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public:
|
|||||||
bool isInert() const;
|
bool isInert() const;
|
||||||
void setInert(bool inert);
|
void setInert(bool inert);
|
||||||
void toggleInertia();
|
void toggleInertia();
|
||||||
|
void drawOutline(QPainter &painter) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ bool OverlayInteraction::isInteracting() const
|
|||||||
|
|
||||||
void OverlayInteraction::paintEvent(QPaintEvent * /*event*/)
|
void OverlayInteraction::paintEvent(QPaintEvent * /*event*/)
|
||||||
{
|
{
|
||||||
|
if (this->interactionProgress() <= 0.0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
QColor highlightColor(
|
QColor highlightColor(
|
||||||
255, 255, 255, std::max(int(255.0 * this->interactionProgress()), 50));
|
255, 255, 255, std::max(int(255.0 * this->interactionProgress()), 50));
|
||||||
@@ -94,11 +99,6 @@ void OverlayInteraction::paintEvent(QPaintEvent * /*event*/)
|
|||||||
auto bounds = this->rect();
|
auto bounds = this->rect();
|
||||||
painter.drawRect(bounds);
|
painter.drawRect(bounds);
|
||||||
|
|
||||||
if (this->interactionProgress() <= 0.0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
highlightColor.setAlpha(highlightColor.alpha() / 4);
|
highlightColor.setAlpha(highlightColor.alpha() / 4);
|
||||||
painter.setBrush(highlightColor);
|
painter.setBrush(highlightColor);
|
||||||
painter.setPen(Qt::transparent);
|
painter.setPen(Qt::transparent);
|
||||||
|
|||||||
Reference in New Issue
Block a user