Commit Graph

21 Commits

Author SHA1 Message Date
Sam Atkins
4c349165f2 LibGUI: Add a callback when the visible columns of a TableView change 2023-06-14 17:53:59 +02:00
Sam Atkins
8eff3b1910 LibGUI: Add functions to get/set all a TableView's visible columns
Specifically, this is to make it easier to save and restore this state
to a config file. I had hoped to use the column names instead of their
IDs, but some columns have an empty string as their name so we wouldn't
be able to distinguish between those.
2023-06-14 17:53:59 +02:00
Andreas Kling
b71c7a6e44 Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()
The only remaining clients of this API are specific to bitmap fonts and
editing thereof.
2023-03-04 00:29:38 +01:00
MacDue
7be0b27dd3 Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
2022-12-07 11:48:27 +01:00
networkException
802cf9bc69 Everywhere: Use my very shiny serenityos.org email :^) 2022-09-12 15:13:12 +01:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
martinfalisse
11dffbd96f Spreadsheet+LibGUI: Calculate cell position given scroll position
Take into account the current scroll position when calculating the
position of cells. This way when the user scrolls either horizontally
or vertically, the calculations done to find the cell position
will be correct.
2022-03-19 09:31:29 +03:30
Lenny Maiorani
fe3b846ac8 Libraries: Use default constructors/destructors in LibGUI
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-12 14:44:43 -08:00
networkException
b67d4ab52f LibGUI: Allow falling back to default paint behavior in delegate
This patch adds a method that can optionally be implemented to allow
a TableCellPaintingDelegate to fall back to the default painting in a
View.
2022-01-29 11:22:02 +01:00
martinfalisse
8eb8949d9c LibGUI: Calculate row position for scroll into view
When a user is navigating a table view with arrow keys and a row is
outside of the current view, then scroll_into_view is called, and the
position of the rectangle passed to this should take into account the
column headers.

This can be seen making more pleasant the navigation in the System
Monitor in the Processes view, for example.
2022-01-06 17:48:04 +01:00
martinfalisse
452150c632 LibGUI: Bring entire cell into view after auto scroll into view
On account of row and column headers, when a user navigates to
a cell (for example in the spreadsheet application) that is
outside of the view, the cell is not properly aligned and so
is partially cut-off. This fix takes into account the row and
column headers when calculating the Rect to pass to the
scroll_into_view function.
2022-01-03 15:49:07 +01:00
Marcus Nilsson
d660e86d13 LibGUI: Implement automatic scrolling in AbstractView
This adds automatic scrolling when dragging items in TreeViews and other
widgets that inherit from AbstractView when the overloaded
accepts_drag() returns true. This is implemented in FileSystemModel to
allow directories and files to be dragged.
2021-09-29 23:58:55 +02:00
sin-ack
ab2719fd53 LibGUI: Let the table view tell HeaderView about the min. section size
Previously HeaderView would just assume that each column or row could
have a minimum size of 2. This makes it so that AbstractTableView
subclasses can provide a new minimum value for a specific column.
2021-08-08 14:12:45 +02:00
Andreas Kling
df96380121 LibGUI: Tighten paint invalidation rects in item views :^)
AbstractView now has a paint_invalidation_rect(index) function that
subclasses can override to provide a tighter invalidation rect for
an index.
2021-07-10 18:30:46 +02:00
Max Trussell
b4da228ea5
LibGUI: Make "Return" after tab return to original column in TableView 2021-06-13 19:46:08 +01:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
52de9b1753 LibGUI: Do AbstractView::set_column_hidden() => set_column_visible()
This API felt backwards, so let's change it.
2021-04-05 11:57:47 +02:00
thankyouverycool
3cc7862487 LibGUI: Support double-click resizing column headers
Columns can now be best-fit resized by double-clicking their
grabbable edges. When a default width is set and all data is empty,
double-clicking will restore the column to its original state.
2021-03-18 07:49:55 +01:00
thankyouverycool
0fc81d23f4 LibGUI: Add variable padding and center bitmaps in TableViews
This lets us make nicer looking bitmap tables and fixes a content
rect issue in TreeView. Also makes key column highlighting optional
2021-03-12 09:59:03 +01:00
thankyouverycool
af581cbd91 LibGUI: Increase row height in Table/ColumnViews and center icons
16x16 icons are now guaranteed at least 1px margins between rows
2021-03-04 16:28:12 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00