Showing the selection in non-focused text editors was not really useful,
since refocusing the widget would clear or change the selection
immediately anyway.
Note that TextEditors in inactive windows can still be the focused
widget within that window, and will still be painted with an "inactive"
looking selection.
The FilePicker has implemented its common locations tray as a composite
widget built from a GUI::Frame with a bunch of GUI::Button inside it.
The problem with that is that it creates a long and annoying chain of
keyboard-focusable widgets.
This patch adds GUI::Tray, which is a dedicated single widget that
implements the same UI element, but without child widgets.
Toolbar buttons are meant for quick mouse access to common actions,
while quick keyboard access is normally achieved via keyboard shortcuts
and underlined menu items.
This makes interfaces with many toolbar buttons (e.g GUI::FilePicker)
a lot nicer to navigate via keyboard.
Storing assigning a string literal to a String object just to pass it to
a function expecting a StringView is wasteful. Let's just not do that.
For consistency's sake, this commit changes all of the other invocations
to use StringView literals, too.
Creating a String object from the formatted data is unnecessary, as it
immediately gets turned into a StringView anyways.
With this change, we will no longer allocate on the heap when printing
`VirtualAddress`, `VirtualRange` and `InodeIdentifier` objects, which is
a step towards stronger OOM hardening.
Forcing the formatting to go through `Formatter<FormatString>` is
completely unnecessary, increases code size, performs a String
allocation and prevents us from using the formatting options available
on that type.
This commit also removes explicit formatters from
`BlockBasedFileSystem::BlockIndex` and `Kernel::InodeIndex`, as those
are already covered by the blanket implementation for all
`DistinctNumeric` types.
Previously, only `manual` installs would register dependencies of an
installed port package. Since in the future we might want to check all
dependents, not only those for manually installed packages, we should
take care to register dependencies for `auto` installs as well.
Additionally, this surpresses some unnecessary verbose output from the
package management and fixes warnings when the package DB directory did
not yet exist.
GNU statement expressions fit the definition of IfAbruptRejectPromise
rather nicely, where we need to reject the failed promise (and return
the failed promise itself) on failure, and otherwise store a value on
success.
This is a bit ugly because, rather than simply wrapping the invocation
to GetPromiseResolve with TRY(), we have to invoke the promise's reject
method with any error. But this will be a bit cleaner in a subsequent
commit to change how IfAbruptRejectPromise is invoked.
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
TL;DR: Instead of this:
return { TRY(my_object()) };
we can now do:
return TRY(my_object());
just like we mostly did for Value return types before ThrowCompletionOr.
This one is a bit unusual, so to clarify:
Previously, callers of get_iterator_values() would supply a callback
that would return an IterationDecision, and an enum to indicate whether
iterator_close() should be invoked upon IterationDecision::Break.
Now, use of both those enums is removed, and callers must return an
Optional<Completion>. If a Completion is provided, the iterator will be
closed, and that completion will be returned from get_iterator_values.
Otherwise, once the iterator is exhausted, a default-initialized
Completion will be returned.