1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 05:57:35 +00:00

LibGUI: Make the GTableView column headers behave like proper buttons

Previously they would resort based on the column immediately when you
mousedown on them. Now we track the click event and show the header
in a pressed state, etc. The usual button stuff :^)
This commit is contained in:
Andreas Kling 2019-11-20 22:09:29 +01:00
parent 0b0017bbbd
commit 191535d626
2 changed files with 49 additions and 9 deletions

View file

@ -72,6 +72,7 @@ protected:
void update_content_size();
void update_column_sizes();
static const Font& header_font();
void update_headers();
struct ColumnData {
int width { 0 };
@ -91,6 +92,8 @@ protected:
Point m_column_resize_origin;
int m_column_resize_original_width { 0 };
int m_resizing_column { -1 };
int m_pressed_column_header_index { -1 };
bool m_pressed_column_header_is_pressed { false };
GMenu& ensure_header_context_menu();
OwnPtr<GMenu> m_header_context_menu;