Age | Commit message (Collapse) | Author |
|
Previously, holding Control while using the left/right arrow keys
to navigate through a TextEditor would only be helpful if the document
had spans. Now, if there are no spans, it will navigate to the
next "word break", defined to be the threshold where text changes
from alphanumeric to non-alphanumeric, or vice versa.
|
|
TextDocument now has utilities to locate a word break both before
and after any TextPosition.
|
|
Previously, double clicking would select the range around your click up
until it found a space, and in the browser's location bar this behavior
didn't suffice. Now, it will select the range around your click until
there is a "word break". A word break is considered to be when your
selection changes from being alphanumeric to being non alphanumeric, or
vice versa.
|
|
|
|
|
|
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.
|
|
|
|
If a model doesn't specify a text alignment for a given field, we now
fall back to CenterLeft. This will look better than Center in the vast
majority of cases.
|
|
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.
|
|
|
|
This gets rid of one field in ColumnData. The goal is to get rid of all
fields and lose ColumnData entirely.
|
|
If the cursor happened to be blinking in the invisible state, it would
take 500ms before we actually see the cursor in a newly focused editor
widget. This patch makes it show up right away.
|
|
It feels really awkward if nothing is focused when opening a window.
|
|
We can't really share this stuff with TreeView anyway, since tables
and trees have very different spatial relationships between indexes.
|
|
This makes TreeView a lot more keyboard friendly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We should always stay on the only line when selecting in a single-line
editor, instead of requiring the user to keep the cursor inside the
text when selecting.
This broke with the variable-width font changes.
|
|
This adds a little bit of needed air around the text.
|
|
Previously we would sometimes leave some pixels from an old selection
rect on screen after clearing the selection. It was because the line
content rect was smaller than the visual selection rect, and we were
using the line content rect for invalidations.
|
|
This makes things like the Browser location bar look way nicer. :^)
|
|
This patch reworks metric and coordinate computation to iterate over
text content instead of making assumptions about fixed glyph widths.
|
|
|
|
|
|
Oops, we can't be appending substrings of a string we just deleted!
Fix this by building up the new line instead of trying to clear and
append in place. This works out nicely as we now do fewer document view
updates when removing a range. :^)
|
|
|
|
Widgets can now opt in to emoji input via set_accepts_emoji_input().
If the focused widget accepts emoji input, we'll pop up a simple dialog
with all the available emojis as clickable buttons.
You can press escape if you change your mind and don't want an emoji.
This UI layout definitely will not scale as we add more emojis, but it
works for the moment, and we can adapt it as we go. Pretty cool! :^)
|
|
A TextDocumentLine is now backed by a non-null-terminated sequence of
Unicode codepoints encoded as UTF-32 (one u32 per codepoint.)
This makes it possible to view and edit arbitrary Unicode text without
strange cursor and selection behavior. You can freely copy and paste
emojis between TextEditor and Terminal now. :^)
Storing UTF-32 is quite space-inefficient, but we should be able to
use the same optimization techniques as LibVT does to reduce it in
the typical case where most text is ASCII.
There are a lot of things that can be cleaned up around this code,
but this works well enough that I'm pretty happy with it.
|
|
This will allow e.g PaintBrush to use custom cursors for each tool.
|
|
We will now actually use MIME types for clipboard. The default type is now
"text/plain" (instead of just "text").
This also fixes some issues in copy(1) and paste(1).
|
|
|
|
This commit moves the clipboard from WindowServer into a new Clipboard
service program. Clipboard runs as the unprivileged "clipboard" user
and with a much tighter pledge than WindowServer.
To keep things working as before, all GUI::Application users now make
a connection to Clipboard after making the connection to WindowServer.
It could be interesting to connect to Clipboard on demand, but right
now that would necessitate expanding every GUI app's pledge to include
"unix" and also unveiling the clipboard portal, which I prefer not to.
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|
|
This allows embedders to step the selection up/down and also simplifies
AbstractTableView by sharing code between Key_Up and Key_Down. :^)
|
|
This is just a wrapper around show() that puts up a standard-looking
error message.
|
|
|
|
|
|
This will allow you us to implement special behavior when Ctrl+clicking
a button.
|
|
We were iterating the ancestor chain of the focused widget when looking
for a matching keyboard shortcut, but we didn't actually look at the
ancestors at each step.
With this fix, we now correctly activate actions found in the ancestor
chain of the focused widgets. :^)
|
|
This makes it way easier to debug key events.
|
|
|
|
You can now pass --gui-focus-debug to any GUI::Application and it will
draw a cyan rectangle around the currently focused widget.
|
|
|
|
Before notifying our window that a child was removed, we should first
check that we actually have a window! :^)
|