mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibGUI: Simplify HeaderView::mouseup_event() slightly
This commit is contained in:
parent
3f4df7c6da
commit
c241ab75cd
Notes:
sideshowbarker
2024-07-19 03:07:55 +09:00
Author: https://github.com/awesomekling
Commit: c241ab75cd
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue