From b9d51b86015e8410a2082c42f95651c0599ec7ae Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 28 Jul 2021 00:24:18 +0100 Subject: [PATCH] LibGUI: Always reset pressed close button index on mouse up in TabWidget Previously it would only do this if the mouse was over the close button. If you released the mouse outside the close button, the close button would appear permanently depressed afterwards. --- Userland/Libraries/LibGUI/TabWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index 1f73b87bfe..31bab33988 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -362,6 +362,7 @@ void TabWidget::mouseup_event(MouseEvent& event) return; auto close_button_rect = this->close_button_rect(m_pressed_close_button_index); + m_pressed_close_button_index = -1; if (close_button_rect.contains(event.position())) { auto* widget = m_tabs[m_pressed_close_button_index].widget; @@ -369,7 +370,6 @@ void TabWidget::mouseup_event(MouseEvent& event) if (on_tab_close_click && widget) on_tab_close_click(*widget); }); - m_pressed_close_button_index = -1; return; } }