summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-26 14:14:35 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-26 17:00:40 +0200
commitc241ab75cda2c3de0bb16de09faf1f87c185131c (patch)
treedfa15e72740d7d7b7becf7793bbaf5b8a44b6a19 /Libraries
parent3f4df7c6da28de52027a266f5cf754d1ff8d1428 (diff)
downloadserenity-c241ab75cda2c3de0bb16de09faf1f87c185131c.zip
LibGUI: Simplify HeaderView::mouseup_event() slightly
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/HeaderView.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Libraries/LibGUI/HeaderView.cpp b/Libraries/LibGUI/HeaderView.cpp
index 271cc6a312..98abf2fa8e 100644
--- a/Libraries/LibGUI/HeaderView.cpp
+++ b/Libraries/LibGUI/HeaderView.cpp
@@ -192,17 +192,15 @@ void HeaderView::mousemove_event(MouseEvent& event)
void HeaderView::mouseup_event(MouseEvent& event)
{
- Gfx::IntPoint horizontally_adjusted_position(event.x(), event.y());
if (event.button() == MouseButton::Left) {
if (m_in_section_resize) {
- if (!section_resize_grabbable_rect(m_resizing_section).contains(horizontally_adjusted_position))
+ if (!section_resize_grabbable_rect(m_resizing_section).contains(event.position()))
window()->set_override_cursor(StandardCursor::None);
m_in_section_resize = false;
return;
}
if (m_pressed_section != -1) {
- auto header_rect = this->section_rect(m_pressed_section);
- if (header_rect.contains(horizontally_adjusted_position)) {
+ if (section_rect(m_pressed_section).contains(event.position())) {
auto new_sort_order = SortOrder::Ascending;
if (m_table_view.key_column() == m_pressed_section)
new_sort_order = m_table_view.sort_order() == SortOrder::Ascending