From a836edd5a78c7a5018bd58dfb74e9cfbc5cf89a1 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 6 May 2023 20:45:32 +0100 Subject: [PATCH] Codechange: Scrollbar::UpdatePosition() will tell if the position changed. (#10777) So we don't need to check this manually. --- src/widgets/dropdown.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 73bc203c83..1c7a7492e7 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -280,14 +280,9 @@ struct DropdownWindow : Window { IntervalTimer scroll_interval = {std::chrono::milliseconds(30), [this](auto) { if (this->scrolling == 0) return; - int pos = this->vscroll->GetPosition(); + if (this->vscroll->UpdatePosition(this->scrolling)) this->SetDirty(); - this->vscroll->UpdatePosition(this->scrolling); this->scrolling = 0; - - if (pos != this->vscroll->GetPosition()) { - this->SetDirty(); - } }}; void OnMouseLoop() override