Age | Commit message (Collapse) | Author |
|
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.
|
|
This makes tables look a lot nicer with different-sized fonts. :^)
|
|
Fixes #3825
|
|
All views want the same behavior, so move this to the base class. :^)
|
|
|
|
Previously, it didn't take into account the visibility of
column headers.
|
|
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.
|
|
If enabled, the view cursor will move right/left when pressing
tab/shift+tab.
|
|
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.
|
|
These key events need to trigger a move_cursor() as well.
|
|
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. :^)
|
|
|
|
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. :^)
|
|
|
|
The row height is per-table, not per-row, but this is still nice.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This matches what happens when you double-click on a cell.
|
|
|
|
This API lets you specify whether to scroll horizontally, vertically,
or both.
|
|
This fixes the misalignments when a header is not left-aligned.
|
|
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
|
|
This way you don't have to keep track of which model it came from.
|
|
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.
|
|
|
|
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much
better visual clue about what type of metric is being used.
|
|
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.
|
|
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.
|
|
Now there's only one thing left in ColumnMetadata: the initial width.
|
|
We can't really share this stuff with TreeView anyway, since tables
and trees have very different spatial relationships between indexes.
|
|
|
|
This allows embedders to step the selection up/down and also simplifies
AbstractTableView by sharing code between Key_Up and Key_Down. :^)
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Only take the horizontal scroll into account when hit testing the
table view headers.
|
|
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.
|
|
|
|
|
|
The overwhelming majority of GUI::Frame users set the same appearance,
so let's just make it the default.
|
|
|
|
Fixes #1271.
|
|
This patch adds <LibGUI/Forward.h> and uses it a bunch.
It also dragged various header dependency reduction changes into it.
|
|
|
|
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.
|
|
|