This is a first pass at antialiased outline ellipses, currently
this is done by painting two filled AA ellipses, and then
subtracting the inner ellipse from the outer.
This produces a good result, but unfortunately requires allocating
a temporary bitmap in the painter. I did try a simpler method
using the existing line painting functions, and drawing the
ellipse as many line segments, but that produced very poor results.
I think with some work it should be possible to remove the extra
allocation, and I've left a big FIXME for this, but I could not
get this working well.
Previously when setting an action's icon we would only change the bitmap
stored by the action. This patch adds logic to propagate that change to
toolbar buttons as well as window menus.
This fixes an issue in SoundPlayer that would cause the play button not
to reflect the play state.
For example, with this input:
```xml
<C>]]>
```
After seeing `<C>`, the parser will start parsing the content of the
element. The content parser will then parse any character data it sees.
The character parser would see the first two `]]` and consume them.
Then, it would see the `>` and set the state machine to say we have
seen this, but it did _not_ consume it and would instead tell
GenericLexer that it should stop consuming characters. Therefore,
we only consumed 2 characters.
Then, it would see that we are in the state where we've seen the
full `]]>` and try to take off three characters from the end of the
consumed input when we only have 2 characters, causing an assertion
failure as we are asking to take off more characters than there really
is.
The up/down side mouse buttons will now also trigger the back/forward
common actions, as used by the Browser, File Manager etc.
This matches standard behaviour of most apps on other operating systems.
We now check if a mouse_down event matches any action shortcuts,
and if so activate it accordingly, following the same consumption
rules to key_down events.
Instead of having widget/window/application create a shortcut from a
KeyEvent within their find methods, we'll just pass them a Shortcut
so that the "where to search" logic doesn't need to be duplicated
for different Shortcut types.
It also lets us handle invalid Shortcut rejection at a higher level,
with most things letting the caller be responsible for not searching
for actions with an invalid shortcut.
A Shortcut can now be either have a keyboard key, or a mouse button,
along with any modifiers.
Decided to add an extra type field instead of subclassing, which means
callers will have to be a little careful before accessing a particular
input method's "key", but it keeps things simple for now.
It's useful to be able to print mouse button names to the user in other
parts of the system.
Went with a hardcoded switch instead of an enumeration macro like
KeyCode since there were only a handful of cases, and it's unlikely that
many more will ever be added (but can always change it then)
Allows the passing of a Casing enum, Lowercase or Uppercase, and
converts the selected text accordingly. If Lowercase is passed as the
parameter, it converts the selected text to lowercase. If Uppercase is
passed as the parameter, it converts the selected text to uppercase.
On some dark themes, it becomes impossible to dark button icons
against their dark button backgrounds. This change tries to
mitigate that by inverting the icon color if the contrast ratio
(against the button background) is less the 4.5 (the recommended
minimum for text).
This is only done for icons that are a solid color (e.g. all back),
where the desired icon would likely be the same inverted anyway.
Fixes a lot of cases of #13978
This function returns an Optional<Color> and is given an
alpha_threshold. If all pixels above that alpha threshold are the
same color, it returns the color, otherwise it returns an empty
optional.
We turn it on in initialize(), so turn it off in restore().
Not all CLI applications can handle this mode correctly, and there's no
reason to leave it on.
This makes the wrapper more like the rest in LibCore, and also
removes the annoying limitation of not supporting arguments.
There are three overloads one for String, char const *, and StringView
argument lists. As long as there are <= 10 arguments the argv list
will be allocated inline, otherwise on the heap.
This moves all code comprehension-related code to a new library,
LibCodeComprehension.
This also moves some types related to code comprehension tasks (such as
autocomplete, find declaration) out of LibGUI and into
LibCodeComprehension.
Implement futimes() in terms of utimensat(). Now, utimensat() strays
from POSIX compliance because it also accepts a combination of a file
descriptor of a regular file and an empty path. utimensat() then uses
this file descriptor instead of the path to update the last access
and/or modification time of a file. That being said, its prior behavior
remains intact.
With the new behavior of utimensat(), `path` must point to a valid
string; given a null pointer instead of an empty string, utimensat()
sets `errno` to `EFAULT` and returns a failure.