diff options
author | Luke <luke.wilde@live.co.uk> | 2021-07-28 00:24:18 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-28 01:43:51 +0200 |
commit | b9d51b86015e8410a2082c42f95651c0599ec7ae (patch) | |
tree | 83c2e090c36be17d3e869f364e14aec357fbfe6a /Userland/Libraries/LibGUI | |
parent | b3d27c2340a030a737515942fd7b0b860e111fcc (diff) | |
download | serenity-b9d51b86015e8410a2082c42f95651c0599ec7ae.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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; } } |