fix: hide scrollbar highlights in overlay window (#5769)

This commit is contained in:
nerix
2024-12-21 11:25:21 +01:00
committed by GitHub
parent 13d871fc81
commit a540770ce2
4 changed files with 20 additions and 1 deletions
+2
View File
@@ -2,6 +2,8 @@
## Unversioned
- Bugfix: Fixed scrollbar highlights being visible in overlay windows. (#5769)
## 2.5.2-beta.1
- Major: Add option to show pronouns in user card. (#5442, #5583)
+1
View File
@@ -127,6 +127,7 @@ OverlayWindow::OverlayWindow(IndirectChannel channel,
this->channelView_.setChannel(this->channel_.get());
});
this->channelView_.scrollbar()->setHideThumb(true);
this->channelView_.scrollbar()->setHideHighlights(true);
this->setAutoFillBackground(false);
this->resize(300, 500);
+12 -1
View File
@@ -495,9 +495,20 @@ bool Scrollbar::shouldShowThumb() const
return !(this->hideThumb || this->settingHideThumb);
}
void Scrollbar::setHideHighlights(bool hideHighlights)
{
if (this->hideHighlights == hideHighlights)
{
return;
}
this->hideHighlights = hideHighlights;
this->update();
}
bool Scrollbar::shouldShowHighlights() const
{
return !this->settingHideHighlights;
return !(this->hideHighlights || this->settingHideHighlights);
}
bool Scrollbar::shouldHandleMouseEvents() const
+5
View File
@@ -133,6 +133,8 @@ public:
/// Returns true if we should show the thumb (the handle you can drag)
bool shouldShowThumb() const;
void setHideHighlights(bool hideHighlights);
/// Returns true if we should show the highlights
bool shouldShowHighlights() const;
@@ -180,10 +182,13 @@ private:
boost::circular_buffer<ScrollbarHighlight> highlights_;
bool atBottom_{true};
/// This takes precedence over `settingHideThumb`
bool hideThumb{false};
/// Controlled by the "Hide scrollbar thumb" setting
bool settingHideThumb{false};
/// This takes precedence over `settingHideHighlights`
bool hideHighlights = false;
/// Controlled by the "Hide scrollbar highlights" setting
bool settingHideHighlights{false};