Nico Weber
01ff17d374
LibGUI: Do not paint scrollbar button highlight for scrollbars without scrubber
...
If a scrollbar doesn't have a scrubber (because the view it scrolls is
large enough to display all its contents without scrolling), then
it ignores all clicks. We shouldn't draw a hover highlight that suggests
clickability in that case.
2020-09-09 21:04:15 +02:00
asynts
70dd97c46e
AK: Remove FixedArray class.
2020-09-08 14:01:21 +02:00
AnotherTest
02f251bb4a
LibGUI: Fix OOB read in Clipboard::set_data()
2020-09-06 22:22:17 +02:00
Andreas Kling
158f3b9362
LibGUI: Add a Clipboard API for retrieving a copied Gfx::Bitmap
...
The returned bitmap is always going to be a 32-bit RGBA bitmap for now.
In the future we may want to support copy-pasting other formats.
2020-09-05 16:52:35 +02:00
Andreas Kling
2e6d59b7b2
Clipboard: Add a key-value map alongside the clipboard storage
...
A clipping now consists of three things:
- The raw clip data
- A MIME type
- A key-value map (String, String) for anything you like
2020-09-05 16:52:24 +02:00
Andreas Kling
51146e3075
LibGUI: Make the Clipboard API deal in raw byte buffers a bit more
...
To open up for putting not just text/plain content on the clipboard,
let's make the GUI::Clipboard API a bit more raw-data-friendly. :^)
2020-09-05 16:16:01 +02:00
Andreas Kling
27687b1c6e
LibGUI: Handle cursor keydown events in AbstractView
...
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-09-02 21:29:31 +02:00
Andreas Kling
4ba12e9c23
LibGUI: Simplify ListView hover highlighting
...
Instead of tracking the last valid hovered index, just hook the
mousemove event and make the cursor follow the hover when it changes.
2020-09-02 21:29:31 +02:00
Andreas Kling
274a09246b
LibGUI: Move ListView to using AbstractView::move_cursor()
2020-09-02 21:29:31 +02:00
Andreas Kling
dec3998b3c
LibGUI: Disable whitespace visualization in single-line text editors
...
You can enable it manually if you really want it, of course. :^)
2020-09-01 23:57:30 +02:00
Andreas Kling
aa70d8c217
LibGUI: Implement trailing whitespace visualization in TextEditor
...
This patch adds an optional mode where TextEditor highlights trailing
whitespace characters on each line with a nice reddish dither pattern.
We should probably make this themable and I'm sure it could be nicer
somehow, but this is just a first cut and I do kinda like it. :^)
2020-09-01 23:55:35 +02:00
Andreas Kling
a56360f787
LibGUI: Implement the virtual ListView::scroll_into_view()
...
Instead of shadowing the one from AbstractView.
2020-09-01 17:45:28 +02:00
Andreas Kling
04507e288f
LibGUI: Remove ListView::doubleclick_event()
...
We can just let AbstractView take care of this. :^)
2020-09-01 17:45:28 +02:00
Andreas Kling
daeb2bdc60
LibGUI: Don't return early from AbstractView::set_cursor()
...
Calling set_cursor() with the same cursor index is not necessarily
a no-op! For example, we may want to toggle the selection.
2020-09-01 16:33:31 +02:00
Andreas Kling
37df36dbed
LibGUI: Implement move_cursor() in ColumnsView
2020-09-01 16:26:32 +02:00
Andreas Kling
27e86c03da
LibGUI: Implement the virtual IconView::scroll_into_view()
...
This is virtual in AbstractView so let's not shadow it with an IconView
specific variant.
2020-09-01 16:17:17 +02:00
Andreas Kling
72443bd1ab
LibGUI: Teach IconView to use AbstractView::move_cursor()
...
This makes it possible to manipulate the cursor programmatically via
the AbstractView interface.
2020-09-01 16:17:17 +02:00
thankyouverycool
199c1da31c
LibGUI: Hide ResizeCorner in StatusBar when window is maximized
...
Fully expands status bars when maximized and prevents maximized
windows from being erroneously resized.
2020-08-31 09:08:26 +02:00
AnotherTest
e75247a75b
DisplaySettings+LibGUI: Move ItemListModel into LibGUI
...
Without this model, comboboxes are abysmal to work with, so let's not
redefine it every time.
2020-08-29 17:42:03 +02:00
thankyouverycool
2f9a071072
Base+LibGUI: Refresh filetype icons for consistency
...
Improves ini icon depth and adds complementary 16x16/32x32 icons
for music and sound filetypes.
2020-08-29 16:19:02 +02:00
Andreas Kling
b084411258
LibGUI: Make Del/Backspace clear cell w/ "any key pressed" edit trigger
...
This doesn't feel 100% right but it's better than inserting some goofy
whitespace when pressing these keys.
2020-08-29 01:04:22 +02:00
Andreas Kling
c3b3a078f3
LibGUI: Make SortingProxyModel update all view cursors on resort
...
Otherwise they will be stale indexes, which is no good. :^)
2020-08-29 00:18:35 +02:00
Andreas Kling
fed53e19c7
LibGUI: Make AbstractView::set_cursor() scrolling into view optional
...
Sometimes you just want to set the cursor programmatically without
scrolling the view to make the cursor visible.
2020-08-29 00:17:42 +02:00
Andreas Kling
734035857e
LibGUI: Allow AbstractView::set_cursor(ModelIndex(), ...)
...
This should be a valid way to clear the cursor.
2020-08-29 00:16:58 +02:00
Andreas Kling
6316525d50
LibGUI: Add optional "tab key navigation" to AbstractView
...
If enabled, the view cursor will move right/left when pressing
tab/shift+tab.
2020-08-28 21:09:38 +02:00
Andreas Kling
70d3dd5b87
LibGUI: Make TableView::move_cursor() public
...
It was already public in the base class, so hiding it here was just
a mistake.
2020-08-28 21:02:46 +02:00
Andreas Kling
1847219cbf
LibGUI: Let's make F2 the standard "edit key"
...
This matches what other systems do, and allows Return to become
the unambiguous "activation key" instead. :^)
2020-08-28 20:55:25 +02:00
Andreas Kling
12dfeb9845
LibGUI: Allow rollback of model editing delegate input
...
In the StringModelEditingDelegate convenience class, we simply hook up
the escape key to editor rollback. This means you can cancel an ongoing
cell edit by pressing escape. :^)
2020-08-28 20:50:12 +02:00
Andreas Kling
5daa19fdab
LibGUI: Implement a basic "any key pressed" edit trigger for TableView
...
This trigger allows you to initiate cell editing by simply starting to
type something into the cell. :^)
2020-08-28 20:47:02 +02:00
Andreas Kling
f3e4b62be9
LibGUI: Add AbstractView "edit triggers" to improve editing control
...
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-28 20:40:12 +02:00
Andreas Kling
2222fc5e08
LibGUI: Add optional grid and cursor styles to TableView
2020-08-28 17:09:30 +02:00
Ben Wiederhake
6020a4f274
LibGUI: Remove unused String member
2020-08-28 09:15:47 +02:00
Andreas Kling
d2d2361152
LibGUI: Unbreak PageUp/PageDown in AbstractTableView
...
These key events need to trigger a move_cursor() as well.
2020-08-27 19:29:50 +02:00
Andreas Kling
9947262eaa
LibGUI: Ctrl+clicking on an AbstractView should move cursor
...
Don't just toggle the selection of the index, also move the cursor to
where the user is clicking.
2020-08-27 18:41:54 +02:00
Andreas Kling
9cf37901cd
LibGUI: Add a cursor to AbstractView, separate from the selection
...
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-27 18:36:31 +02:00
Andreas Kling
cd2c82a380
LibGUI: Remove unused variables in AbstractTableView::mousedown_event()
2020-08-27 18:13:47 +02:00
Andreas Kling
0b9d765f6b
LibGUI: Add AbstractView::move_cursor() and share some movement logic
...
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-27 17:47:19 +02:00
thankyouverycool
ebba297b42
Base: Move 16x16 common icons to /res/icons/16x16/
...
Drops the '16' suffix from filenames. Resizes inconsistent
audio-volume icons to intended size.
2020-08-27 15:38:02 +02:00
thankyouverycool
0bb2025b69
Base: Create /res/icons/serenity for misc. sized system icons
2020-08-27 15:38:02 +02:00
thankyouverycool
61ba39dfa0
Base: Create /res/graphics/ and relocate system art assets
2020-08-27 15:38:02 +02:00
Tom
4463fed398
LibGUI: Splitter should only override cursor if within grabbable area
...
Fixes #3284
2020-08-27 10:42:15 +02:00
Andreas Kling
55f7ddfb8c
LibGUI: Don't make views sort by column 0 by default
...
If you want to sort by some column, you can tell the view which one.
2020-08-27 10:37:31 +02:00
AnotherTest
7465c51ef2
Base+LibGUI+Spreadsheet: Add icons for Spreadsheet
...
Also adds a Spreadsheet.af.
2020-08-27 10:27:20 +02:00
Ben Wiederhake
9f7ec33180
Meta: Force semi-colon after MAKE_AK_NONXXXABLE()
...
Before, we had about these occurrence counts:
COPY: 13 without, 33 with
MOVE: 12 without, 28 with
Clearly, 'with' was the preferred way. However, this introduced double-semicolons
all over the place, and caused some warnings to trigger.
This patch *forces* the usage of a semi-colon when calling the macro,
by removing the semi-colon within the macro. (And thus also gets rid
of the double-semicolon.)
2020-08-27 10:12:04 +02:00
Andreas Kling
8cc2a55cff
LibGUI: Update AbstractTableView row header sizes on set_row_height()
2020-08-26 20:50:54 +02:00
Andreas Kling
c4347a16cf
LibGUI: Make AbstractTableView row height configurable
...
The row height is per-table, not per-row, but this is still nice.
2020-08-26 20:34:07 +02:00
Andreas Kling
9a0f40d4b5
LibGUI: Add a top-left-corner button to table views
...
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-26 17:00:40 +02:00
Andreas Kling
447b65bf7b
LibGUI: Add (optional) row headers to GUI::TableView
...
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-26 17:00:40 +02:00
Andreas Kling
49a5038a1a
LibGUI: Avoid implementing vertical HeaderView section resize for now
...
Resizable rows will require a bunch of changes in the table view layout
code, so let's not make the normal resizing areas grabbable for now.
2020-08-26 17:00:40 +02:00
Andreas Kling
e418bdf95b
LibGUI: Don't update key column when clicking vertical headers
...
Vertical headers are only concerned with rows, after all.
2020-08-26 17:00:40 +02:00