Commit graph

50127 commits

Author SHA1 Message Date
MacDue
bd0bf8250e PixelPaint: Use ValueSlider for radial gradient hardness
This makes this input consistent with the hardness properties of other
tools.
2023-05-06 08:03:02 +02:00
Nico Weber
5c002c13c9 LibGfx/WebP: Some steps towards supporting animated webp files
No observable behavior change, but when building with WEBP_DEBUG 1,
this now prints frame data.
2023-05-06 08:01:13 +02:00
Nico Weber
812763e5b9 LibGfx/WebP: Stop dropping ANIM chunk decoding errors
decode_webp_chunks() was already called 5 lines up, no need to do that
again.
2023-05-06 08:01:13 +02:00
Nico Weber
835d328a6c LibGfx/WebP: Check presence of ANMF chunks correctly
Previously, we looked at the wrong variable here.
2023-05-06 08:01:13 +02:00
Pankaj Raghav
ac9d60bb13 Kernel: Promote the entry to the front during a cache hit
Whenever an entry is added to the cache, the last element is removed to
make space for the new entry(if the cache is full). To make this an LRU
cache, the entry needs to be moved to the front of the list when there
is a cache hit so that the least recently used entry moves to the end
to be evicted first.
2023-05-06 08:00:55 +02:00
Aliaksandr Kalenik
d6ee4e7fdc LibWeb: Remove resolve_size method in GFC
Duplicate of CSS::Size::resolved().
2023-05-06 07:01:27 +02:00
Aliaksandr Kalenik
3d05ed6b53 LibWeb: Use grid_container() to access root grid box in GFC
There is grid_container() method that can be used to access root box
in GFC without passing it through methods arguments.
2023-05-06 07:01:27 +02:00
Aliaksandr Kalenik
ced862e16f LibWeb: Consolidate track sizing code for rows and columns in GFC
Although the algorithm for sizing tracks (rows or columns) is defined
once for both dimensions in the specification
(https://www.w3.org/TR/css-grid-2/#algo-track-sizing), we have
implemented it twice separately for sizing rows and columns.

In addition to code duplication, another issue is that these
implementations of the same algorithm have already diverged in some
places, and this divergence is likely to become even worse as our
implementation evolves.

This change unifies code for both dimension into one method that runs
track sizing.

While this change brings a bit of collateral damange (border.html and
minmax.html got changes in layout snaphots) it ultimately brings more
benefits because now we can evolve layout for both rows and colums
without duplicating the code :)
2023-05-06 07:01:27 +02:00
Kenneth Myhra
4c17f22735 Ports: Unbreak SDL2 by using GUI::Application::create()
Commit 1a97382 introduced the fallible GUI::Application::create() and
removed GUI::Application::construct() breaking the SDL2 port, let's
update it to use the fallible version.
2023-05-06 00:08:59 +02:00
Maciej
cf52542fcf LibMarkdown+LibSyntax: Add a Markdown syntax highlighter
It currently supports only headers and code blocks.
2023-05-05 17:08:40 +01:00
Maciej
416d6ab6c8 LibMarkdown: Make LineIterator::operator- take a const reference 2023-05-05 17:08:40 +01:00
Tim Ledbetter
ccab25e54e LibChess+Chess: Ensure no pawns have moved when invoking 50 move rule
The 50 and 75 move rules are no longer invoked if a pawn has advanced
in the last 50 or 75 moves respectively.
2023-05-05 16:56:18 +01:00
Xuekun Li
4fb200a546 LibGUI: Fix crash on deleting word forward
<Ctrl-Del> will crash when deleting at the end of line
where the next line contains only punctuation and seperator characters,
because TextDocument::first_word_break_after will return a wrong index
of the next word break (+1 bigger than the correct index),
thus RemoveTextCommand will try to remove a out-of-bound text range
causing a crash.
2023-05-05 16:48:36 +01:00
Xuekun Li
60805546bf LibGUI: Fix stuck on deleting word backward
<Ctrl-Backspace> will stuck when deleting at the end of line
which contains only one single character. When finding the
previous word break position starting at column 0 in
TextDocument::first_word_break_before, the code enters an
infinite while loop. The early return should simply fix this.
2023-05-05 16:48:36 +01:00
Lucas CHOLLET
5c29b45d1d LibGUI: Make Clipboard::initialize propagate errors 2023-05-05 16:41:21 +01:00
Lucas CHOLLET
1a97382305 LibGUI: Make Application's construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.

This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.

From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
2023-05-05 16:41:21 +01:00
Tim Ledbetter
f132751fae PixelPaint: Ensure the selection is always within image bounds 2023-05-05 16:35:42 +01:00
Tim Ledbetter
fc137a7827 LibGfx: Correct off by one error in Point::constrain()
Previously, the y value would be clamped to a value one less than
necessary.
2023-05-05 16:35:42 +01:00
Tim Ledbetter
ea0b527675 PixelPaint: Allow lasso tool to select outside the active layer
This makes the lasso tool behavior consistent with other selection
tools.
2023-05-05 16:35:42 +01:00
Tim Ledbetter
971a5467bf PixelPaint: Use the crosshair cursor with the lasso tool
This matches the behavior of other selection tools.
2023-05-05 16:35:42 +01:00
Caoimhe
5e4d835caf FontEditor: Use LibFileSystemAccessClient 2023-05-05 16:25:55 +01:00
Caoimhe
f663e2dbd1 FontEditor: Don't paint in GlyphEditorWidget if m_font is null
The font isn't set in the constructor, there may be a case where the
font hasn't loaded before the first paint event. Therefore, we should
not paint if the font is null. All other methods should be fine.
2023-05-05 16:25:55 +01:00
Caoimhe
08668e8084 LibGUI: Fix crash when not using a custom font in GlyphMapWidget
`m_original_font` is only set if `GlyphMapWidget::set_font` is called.
But, if the user of `GlyphMapWidget` decides not to set a font,
there will be no value for `m_original_font`.

This commit fixes that issue by checking if `m_original_font` is not
null before attempting to use it.
2023-05-05 16:25:55 +01:00
Caoimhe
c43295b668 LibGfx: Add Core::File variant of BitmapFont::write_to_file 2023-05-05 16:25:55 +01:00
Caoimhe
0d2ca125b3 LibGfx: Add a MappedFile variant of BitmapFont::try_load_from_file
Let's make it possible to create a BitmapFont directly from a MappedFile
instead of a file path.
2023-05-05 16:25:55 +01:00
Andreas Kling
74d34134ff Documentation: Add Qt6 SVG module to Ladybird build deps on Ubuntu 2023-05-05 17:12:43 +02:00
Andreas Kling
4b5cbe7931 Ladybird: Use vector icons in the browser toolbar
We now load SVG icons (via the Qt resource system) and render them into
a QIcon (with normal and disabled variants) using system colors.
We also re-render them if the system color theme changes.

This instantly makes Ladybird look less foreign on my Linux box.

I drew the icons myself, and they could definitely be more optimized,
but this was my first time using Inkscape. :^)
2023-05-05 16:58:08 +02:00
Andreas Kling
60312f2c83 Ladybird: Remove the "home" icon from the toolbar (and the concept)
This feature isn't really that useful in practice, so let's remove it.
(Other browsers haven't had this action for years either.)
2023-05-05 16:58:08 +02:00
Tom
f0f82c6391 LibGfx/PNG: Add support for animated PNG images 2023-05-05 15:20:44 +01:00
Tom
e7921cfe14 LibGfx: Add first_animated_frame_index method to ImageDecoder
Some image formats such as APNG may not use the first frame for
animations.
2023-05-05 15:20:44 +01:00
Lucas CHOLLET
5a4c61838f FileSystemAccessServer: Use ECANCELED instead of -1
-1 was used when the user cancel the dialog, `ECANCELED` is a bit more
explicit about what it is.
2023-05-05 15:12:24 +01:00
0GreenClover0
8bb2663a22 LibWeb: Zero out margins if width is not 'auto' in BFC's compute_width
Reverse the condition to satisfy the spec comment. Probably a typo.
A 3 year old typo! :^)
2023-05-05 13:26:41 +02:00
Cubic Love
0d808f6dcb Base+Minesweeper: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
2023-05-05 11:52:33 +01:00
Cubic Love
9c8385c605 Base+FlappyBug: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
2023-05-05 11:52:33 +01:00
Cubic Love
c6454d37c0 Base+ColorLines: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
2023-05-05 11:52:33 +01:00
Cubic Love
248542535d Base+LibChess: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
2023-05-05 11:52:33 +01:00
Cubic Love
240a56d9ce Base+CatDog: Move assets from /icons/ to /graphics/
The graphics directory is a more suitable home for demo assets.
Also, update the example presenter file which uses a CatDog sprite.
2023-05-05 11:52:33 +01:00
Cubic Love
1d6f2e5608 Base+LibCards: Move card backs from /icons/ to /graphics/
The graphics directory is a more suitable home for game assets.
Also, move card backs into their own subfolder in preparation for a
themes subfolder for card fronts.
2023-05-05 11:52:33 +01:00
Aliaksandr Kalenik
34b1186272 LibWeb: Remove early resolve to auto while calculating border-box width
`Length::resolved(Node&)` transforms infinite values to "auto".

Following transformations:
Infinite (Length) -> "auto" -> 0 (px)
cause border-box width to be resolved in zero when it should be inf px.

Removing `Length::resolved(Node&)` makes it work right:
Infinite (Length) -> Infinite (px)

Fixes #18649
2023-05-05 10:01:28 +02:00
stelar7
2d2d2539b4 LibTLS: Use the TBS ASN.1 data when verifying certificates 2023-05-05 09:36:43 +03:30
stelar7
0b70314379 LibCrypto: Store the TBS ASN.1 data on the certificate
This way we dont need to guess the offsets in LibTLS when using it.
2023-05-05 09:36:43 +03:30
Ali Mohammad Pur
24c7995743 Shell: Rename the verb {lookup => look_up} 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
4d00b372c8 Shell: Make the builtins' POSIX mode requirement more explicit
Instead of checking in each individual function, add the mode to
ENUMERATE_SHELL_BUILTINS() and let has_builtin() handle it.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
367da548ff Shell: Make null_or_alternative actually look up the given variable 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
1403e56535 Shell: Place all variables in the closest nonlocal frame in POSIX mode 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
0d8b90aec6 Shell: Allow newlines before do in POSIX for loops 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
fca5a34ad3 Shell: Allow assignment-prefixed commands to run builtins
`env` is not capable of running shell builtins, so make a simple
builtin in its place.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
e2336d9de5 Shell: Add support for unset -v in POSIX mode 2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
71441ea932 Shell: Allow lossy conversion from list -> string in POSIX mode
Similar to bash, this operation returns only the first element because
reasons.
2023-05-05 09:35:24 +03:30
Ali Mohammad Pur
8a042cd9cb Shell: Allow non-exhaustive 'case' statements in POSIX 2023-05-05 09:35:24 +03:30