Add transparent overlay window (#4746)

This commit is contained in:
nerix
2024-10-06 12:54:24 +02:00
committed by GitHub
parent 9ba7ef324d
commit afa8067a20
40 changed files with 1464 additions and 190 deletions
+25 -11
View File
@@ -285,18 +285,21 @@ void Scrollbar::paintEvent(QPaintEvent * /*event*/)
bool enableElevatedMessageHighlights =
getSettings()->enableElevatedMessageHighlight;
this->thumbRect_.setX(xOffset);
if (this->showThumb_)
{
this->thumbRect_.setX(xOffset);
// mouse over thumb
if (this->mouseDownLocation_ == MouseLocation::InsideThumb)
{
painter.fillRect(this->thumbRect_,
this->theme->scrollbars.thumbSelected);
}
// mouse not over thumb
else
{
painter.fillRect(this->thumbRect_, this->theme->scrollbars.thumb);
// mouse over thumb
if (this->mouseDownLocation_ == MouseLocation::InsideThumb)
{
painter.fillRect(this->thumbRect_,
this->theme->scrollbars.thumbSelected);
}
// mouse not over thumb
else
{
painter.fillRect(this->thumbRect_, this->theme->scrollbars.thumb);
}
}
// draw highlights
@@ -449,6 +452,17 @@ void Scrollbar::updateScroll()
this->update();
}
void Scrollbar::setShowThumb(bool showThumb)
{
if (this->showThumb_ == showThumb)
{
return;
}
this->showThumb_ = showThumb;
this->update();
}
Scrollbar::MouseLocation Scrollbar::locationOfMouseEvent(
QMouseEvent *event) const
{