summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/AbstractTableView.cpp
AgeCommit message (Collapse)Author
2020-11-19LibGUI: Remove AbstractTableView::doubleclick_event()Andreas Kling
This work is already done (and more correctly) by the parent class (AbstractView) if we just let it take care of the event instead. Fixes the root cause of #4096.
2020-10-25LibGUI: Make table view row height+padding font-size-relativeAndreas Kling
This makes tables look a lot nicer with different-sized fonts. :^)
2020-10-23LibGUI: TableView should only scroll to the selected cellTom
Fixes #3825
2020-09-24LibGUI: Move keyboard item activation up to AbstractViewAndreas Kling
All views want the same behavior, so move this to the base class. :^)
2020-09-20LibGUI: Pad row/column headers of AbstractTableViewTibor Nagy
2020-09-20LibGUI: Fix row_rect(int) calculation in AbstractTableViewItamar
Previously, it didn't take into account the visibility of column headers.
2020-09-02LibGUI: Handle cursor keydown events in AbstractViewAndreas Kling
Move the basic movement keys (up/down/left/right/home/end/pgup/pgdn) up to AbstractView::keydown_event() and have it call the virtual move_cursor() which is then implemented by subclasses.
2020-08-28LibGUI: Add optional "tab key navigation" to AbstractViewAndreas Kling
If enabled, the view cursor will move right/left when pressing tab/shift+tab.
2020-08-28LibGUI: Add AbstractView "edit triggers" to improve editing controlAndreas Kling
This API allows the embedder of a view to decide which actions upon the view will begin editing the current item. To maintain the old behavior, we will begin editing when an item is either double-clicked, or when the "edit key" (return) is pressed.
2020-08-27LibGUI: Unbreak PageUp/PageDown in AbstractTableViewAndreas Kling
These key events need to trigger a move_cursor() as well.
2020-08-27LibGUI: Add a cursor to AbstractView, separate from the selectionAndreas Kling
Views now have a cursor index (retrievable via cursor_index()) which is separate from the selection. Until now, we've been using the first entry in the selection as "the cursor", which gets messy whenever you want to select more than one index in the model. When setting the cursor, the selection is implicitly updated as well to maintain the old behavior (for the most part.) Going forward, this will make it much easier to implement things like shift-select (extend selection from cursor) and such. :^)
2020-08-27LibGUI: Remove unused variables in AbstractTableView::mousedown_event()Andreas Kling
2020-08-27LibGUI: Add AbstractView::move_cursor() and share some movement logicAndreas Kling
A view can now be told to move its cursor in one of multiple directions as specified by the CursorMovement enum. View subclasses can override move_cursor(CursorMovement) to implement their own cursor behavior. By default, AbstractView::move_cursor() is a no-op. This patch improves code sharing between TableView and TreeView. :^)
2020-08-26LibGUI: Update AbstractTableView row header sizes on set_row_height()Andreas Kling
2020-08-26LibGUI: Make AbstractTableView row height configurableAndreas Kling
The row height is per-table, not per-row, but this is still nice.
2020-08-26LibGUI: Add a top-left-corner button to table viewsAndreas Kling
If both the row and column headers are visible, we now also show a button in the top left corner. This avoids the headers overlapping each other when you scroll the contents. In the future, this could be hooked up to a "select all" action.
2020-08-26LibGUI: Add (optional) row headers to GUI::TableViewAndreas Kling
You can now get row headers in your TableView by simply calling: table_view.row_header().set_visible(true) Note that rows are not yet resizable.
2020-08-26LibGUI: Rename table view's "cell painting delegate" to "column *"Andreas Kling
What you install with this API is a delegate that manages painting of all the items in a specific column, so let's make the API reflect that.
2020-08-26LibGUI: Move table view headers into their own widgetAndreas Kling
This patch introduces the HeaderView class, which is a widget that implements the column headers of TableView and TreeView. This greatly simplifies event management in the view implementations and also makes it much easier to eventually implement row headers.
2020-08-24LibGUI: Pressing Return in an editable TableView should begin editingAndreas Kling
This matches what happens when you double-click on a cell.
2020-08-24LibGUI: Allow moving the TableView selection horizontally with keyboardAndreas Kling
2020-08-24LibGUI: Add AbstractTableView::scroll_into_view(ModelIndex, bool, bool)Andreas Kling
This API lets you specify whether to scroll horizontally, vertically, or both.
2020-08-24LibGUI: Calculate the text rect correctly in AbstractTableViewAnotherTest
This fixes the misalignments when a header is not left-aligned.
2020-08-24LibGUI: Make AbstractTableView and TableView more customisableAnotherTest
This patchset adds a few getters/setters to AbstractTableView to make its looks more customisable: - Header width & text alignment - Default column width - Ability to disable selected row highlighting
2020-08-16LibGUI+DevTools+Applications: Use ModelIndex::data() in many placesAndreas Kling
This way you don't have to keep track of which model it came from.
2020-08-16LibGUI: Make model sorting imperative and move order to AbstractViewAndreas Kling
Instead of SortingProxyModel having a column+order, we move that state to AbstractView. When you click on a column header, the view tells the model to resort the relevant column with the new order. This is implemented in SortingProxyModel by simply walking all the reified source/proxy mappings and resorting their row indexes.
2020-07-07LibGUI: Use Resize{Column,Row} cursor for Splitter and AbstractTableViewLinus Groh
2020-06-10LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSizeAndreas Kling
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
2020-05-21LibGUI: Fix view column auto-sizing of icon-only columnsAndreas Kling
For icon columns, just use the item height as the auto width for now. This gives us 16x16 icons, which is always what we want anyway.
2020-05-21LibGUI: Get rid of Model::ColumnMetadata and always use auto-sizingAndreas Kling
Auto-sizing of view columns is now enabled by default. This removes the last remaining need for ColumnMetadata, so this patch gets rid of it.
2020-05-21LibGUI: Replace ColumnMetadata::sortable => Model::is_column_sortable()Andreas Kling
Now there's only one thing left in ColumnMetadata: the initial width.
2020-05-21LibGUI: Move AbstractTableView::keydown_event() down to TableViewAndreas Kling
We can't really share this stuff with TreeView anyway, since tables and trees have very different spatial relationships between indexes.
2020-05-20LibGUI: Replace up and down arrows with emojiHüseyin ASLITÜRK
2020-05-13LibGUI: Add AbstractTableView::move_selection(int steps)Andreas Kling
This allows embedders to step the selection up/down and also simplifies AbstractTableView by sharing code between Key_Up and Key_Down. :^)
2020-05-02LibGUI: Display hidden columns as hiddenBen Wiederhake
Until now, hidden columns were displayed as visible in the context menu. An easy way to reproduce this is: - Open the TextEditor - Ctrl-O to open the file selector - Switch to table view - Right-click the header Expected behavior: Hidden columns like 'Owner' and 'Group' should not have a checkmark, because they are hidden. Actual behavior: They did have a checkmark. Clicking on it to 'hide' the already hidden column removed the checkmark, but was a no-op to the table view. This commit fixes this behavior, by correctly initializing the context menu, and properly updating the context menu if external code calls 'set_column_hidden' later.
2020-04-21LibGUI: Make it easier to create checkable GUI::ActionsAndreas Kling
This patch adds GUI::Action::create_checkable() helpers that work just like the existing create() helpers, but the actions become checkable(!) Clients are no longer required to manage the checked state of their actions manually, but instead they will be checked/unchecked as needed by GUI::Action itself before the activation hook is fired.
2020-04-12LibGUI: Add a way for models to update without invalidating indexesAndreas Kling
This is really just a workaround to keep SystemMonitor's process table working right wrt selection retention during resorts (while also doing full index invalidation on things like ProfileViewer inversion.) It's starting to feel like the model abstraction is not super great and we'll need a better approach if we want to actually build some more dynamic functionality into our views.
2020-04-03LibGUI: Clear any hovered index when the cursor leaves an AbstractViewAndreas Kling
2020-02-25LibGUI: Mouse events didn't hit table headers when vertically scrolledAndreas Kling
Only take the horizontal scroll into account when hit testing the table view headers.
2020-02-25LibGUI: Make descendants of AbstractView define their own select_all() (#1201)DAlperin
AbstractView does not know which column it's displaying which makes it impossible to implement the select_all functionality up there. Now descendants override the pure virtual select_all method and implement it themselves.
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-23LibGUI: Remove parent parameter to GUI::Widget constructorAndreas Kling
2020-02-23LibGUI: Make GUI::Frame have the 2px sunken container look by defaultAndreas Kling
The overwhelming majority of GUI::Frame users set the same appearance, so let's just make it the default.
2020-02-22LibGUI: Remove debug spam when resizing table columnsAndreas Kling
2020-02-22LibGUI: Take scroll offset into account when manipulating table headersAndreas Kling
Fixes #1271.
2020-02-16LibGUI: Add forwarding headerAndreas Kling
This patch adds <LibGUI/Forward.h> and uses it a bunch. It also dragged various header dependency reduction changes into it.
2020-02-15LibGUI: Reduce header dependencies of GUI::ActionAndreas Kling
2020-02-12LibGUI: Always unhighlight table view column headers when cursor leavesAndreas Kling
If the cursor left a table view column header while also pressing it, we would keep the header highlighted. This was not consistent with how regular buttons behaved.
2020-02-06LibGUI: Remove leading G from filenamesAndreas Kling