1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:45:08 +00:00
Commit graph

10720 commits

Author SHA1 Message Date
MacDue
8c2a5bbc15 LibGfx: Implement antialiased outline ellipsis
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.
2022-06-01 19:33:45 +02:00
MacDue
8ac5f625e9 LibGfx: Rename draw_ellipse/circle to fill_ellipse/circle
This makes these functions more consistent with the non-aa painter.
2022-06-01 19:33:45 +02:00
Olivier De Cannière
5a3321b899 Taskbar+Desktop: Add super+D keyboard shortcut
This shortcut has the same effect as pressing the "Show Desktop" button
in the taskbar. This shortcut already exists in Windows.
2022-06-01 19:31:34 +02:00
Olivier De Cannière
6c202ee4a9 LibGUI: Fix typo in ConnectionToWindowManagerServer 2022-06-01 19:31:34 +02:00
networkException
524f4be5af LibGUI+WindowServer: Propagate action icon changes to buttons and menus
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.
2022-06-01 12:33:06 +01:00
Luke Wilde
adb5f7e485 LibXML+Tests: Consume > in the character data ending ]]> and test it
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.
2022-05-30 00:16:17 +01:00
Geordie Hall
9a97ffe883 LibGUI: Add side mouse buttons as an alternate shortcut for back/forward
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.
2022-05-30 00:13:27 +01:00
Geordie Hall
4efcf3cc8e LibGUI: Activate mouse shortcuts from within WindowServerConnection
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.
2022-05-30 00:13:27 +01:00
Geordie Hall
737c1c86dc LibGUI: Search for actions with a Shortcut instead of for KeyEvent
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.
2022-05-30 00:13:27 +01:00
Geordie Hall
a252c3e058 LibGUI: Allow Shortcuts to have a mouse button associated with them
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.
2022-05-30 00:13:27 +01:00
Geordie Hall
8b9b836a0e LibGUI: Add a to_string helper for GUI::MouseButton
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)
2022-05-30 00:13:27 +01:00
DexesTTP
bf6c4835e6 LibWeb: Allow configuring the default error page path 2022-05-29 23:00:04 +01:00
DexesTTP
26bb95425d LibWeb: Allow configuring the default favicon path
This is useful when using LibWeb in environments that aren't Serenity
2022-05-29 23:00:04 +01:00
Linus Groh
de90faa4c4 LibGfx: Change one instance of 'colour' to 'color'
The system's official language is American English.
2022-05-29 15:22:00 +02:00
Linus Groh
173dcfb7cb Everywhere: Fix a bunch of typos 2022-05-29 15:22:00 +02:00
Rafał Babiarz
b162b7eec6 Browser+LibWeb+WebContent: Add ability to inspect session storage 2022-05-28 23:54:06 +01:00
huttongrabiel
2cfbb9a0e8 LibGUI: Implement case inversion in Vim emulation
When in visual mode with text selected, on Key_Tilde press, uppercase
characters convert to lowercase and lowercase ones to uppercase.
2022-05-26 21:51:23 +01:00
kleines Filmröllchen
62c1ce4073 LibDSP: Fix keyboard glitch in Classic
This is quite elusive.
2022-05-26 10:24:43 +01:00
kleines Filmröllchen
37b340a698 LibDSP: Introduce the Keyboard
This is a class for handling user MIDI input, which is combined by the
Track with roll note data if applicable.
2022-05-26 10:24:43 +01:00
huttongrabiel
a54b681149 LibGUI: Allow to lowercase conversion in Vim emulation
If Key_U is pressed while in visual mode, the currently selected text
will be converted to lowercase.
2022-05-26 00:33:01 +01:00
huttongrabiel
e3bef71d05 LibGUI: Allow to uppercase conversion in Vim emulation
If Shift+Key_U is pressed while in visual mode, the currently selected
text will be converted to uppercase.
2022-05-26 00:33:01 +01:00
huttongrabiel
45c5f68d8a LibGUI: Add casefold_selection function to choose case conversion
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.
2022-05-26 00:33:01 +01:00
MacDue
3b0785a636 LibGUI: Invert button icons with low contrast ratios
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
2022-05-26 00:07:24 +01:00
MacDue
73b05364e8 LibGfx: Add Color::contrast_ratio() 2022-05-26 00:07:24 +01:00
MacDue
8e441d402b LibGfx: Add Bitmap::solid_color()
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.
2022-05-26 00:07:24 +01:00
MacDue
48d3db3c3d LibGfx: Add Bitmap::invert()
Helper function to invert a bitmap in-place
2022-05-26 00:07:24 +01:00
Ali Mohammad Pur
78dc77f7e4 LibLine: Add support for user-controlled masking 2022-05-25 23:17:15 +01:00
Ali Mohammad Pur
c257d27f0b LibLine: Turn bracketed paste mode off in Editor::restore()
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.
2022-05-25 23:17:15 +01:00
MacDue
2f2671f2d3 LibGUI: Add GUI::Process::spawn_or_show_error()
This is a wrapper around Core::Process::spawn() for GUI applications,
that shows an error if the call to spawn() failed.
2022-05-25 23:14:22 +01:00
MacDue
3fc0350caf LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawn
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.
2022-05-25 23:14:22 +01:00
MacDue
0295d79339 LibCore: Add posix_spawn() wrapper to Core::System 2022-05-25 23:14:22 +01:00
Linus Groh
9400b76d79 LibJS: Remove assertions replaced with structured headers
This is an editorial change in the Temporal spec.

See: 74fd5e8
2022-05-25 00:25:23 +01:00
Linus Groh
c3f1d8f5ba LibJS: Correct section IDs of Temporal .prototype property clauses
This is an editorial change in the Temporal spec.

See: e4eb181
2022-05-25 00:25:23 +01:00
Linus Groh
ae1fdf299d LibJS: Use the rounding abstract operations from Intl.NumberFormat V3
This is an editorial change in the Temporal spec.

See: 75279e5

Co-Authored-By: Idan Horowitz <idan.horowitz@gmail.com>
2022-05-25 00:25:23 +01:00
Linus Groh
93a20b3bfb LibJS: Use default argument of CalendarDateFromFields
This is an editorial change in the Temporal spec.

See: 7a4a518
2022-05-25 00:25:23 +01:00
Linus Groh
cf1ea18b7f LibJS: Align DifferenceTemporalPlainTime with other Difference* AOs
This is an editorial change in the Temporal spec.

See: 70f739d
2022-05-25 00:25:23 +01:00
Linus Groh
89d4094709 LibJS: Mark concrete method calls of Environment Records with ?/!
This is an editorial change in the ECMA-262 spec.

See: 7ae3ecf
2022-05-25 00:25:23 +01:00
Peter Elliott
3f0be4e9ea LibC: Add barebones <complex.h> 2022-05-23 00:13:26 +02:00
Andrew Smith
abaecb878b LibGUI: Add on_return_pressed function to SpinBox 2022-05-23 00:12:19 +02:00
Karol Kosek
f47bcddb5b LibCore: Set mime type for .sheets files to application/x-sheets+json
This is our own format, used by Spreadsheet.
2022-05-22 03:08:53 +04:30
Michiel Visser
7278ad761e LibHTTP+LibWeb: Accept Brotli encoded responses 2022-05-21 22:41:40 +02:00
Michiel Visser
d6a5b11f04 LibCompress: Implement Brotli decompressor
This implements the BrotliDecompressionStream, which is a Core::Stream
that can decompress another Core::Stream.
2022-05-21 22:41:40 +02:00
Michiel Visser
68772463cb LibCore: Add Stream::read_all() 2022-05-21 22:41:40 +02:00
Michiel Visser
af50b0363b LibCore: Add LittleEndianInputBitStream
As a complement to BigEndianInputStream, this will read the bits from
the lowest bits in a byte first.
2022-05-21 22:41:40 +02:00
Sam Atkins
aadb35ff46 LibGUI: Add ability to position checkboxes to the right of their text
This uses the new `checkbox_position` property, which can be "Left"
or "Right".
2022-05-21 22:25:33 +02:00
Cameron Youell
5b82bd719e LibGUI: TabWidget add vertical tabs
Add vertical tabs to TabWidget, this can be set using
the ```TabWidget::set_tab_position``` function or in the GML
2022-05-21 22:25:16 +02:00
Itamar
b35293d945 LibCodeComprehension: Re-organize code comprehension related code
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.
2022-05-21 18:15:58 +02:00
Ariel Don
244357472a LibCore: Add Core::Stream::File::exists() 2022-05-21 18:15:00 +02:00
Ariel Don
8a854ba309 Kernel+LibC: Implement futimens(3)
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.
2022-05-21 18:15:00 +02:00
Ariel Don
9a6bd85924 Kernel+LibC+VFS: Implement utimensat(3)
Create POSIX utimensat() library call and corresponding system call to
update file access and modification times.
2022-05-21 18:15:00 +02:00