Commit Graph

35287 Commits

Author SHA1 Message Date
Lenny Maiorani
d5fdc6096c Libraries: Make CharacterBitmap instances at compile-time
`CharacterBitmap` instances are generated at run-time and put on the
heap, but they can be created in a `constexpr` context and stored in
static memory.

Also, remove additional `width` and `height` `static` values in favor
of using the `constexpr` member functions of `CharacterBitmap`.

These changes also include the removal of some initialization code
which tests if the `CharacterBitmap` is created since it is always
created and removes function-local `static` values which cause
run-time branches to ensure it is initialized each time the function
is called.
2022-03-04 17:41:08 +01:00
Lenny Maiorani
dc518404ce LibGfx: Make Size constexpr-capable
There is nothing in the `Size` class which cannot be `constexpr`, but
without it being `constexpr` it prevents other things from being
`constexpr`-capable.
2022-03-04 17:41:08 +01:00
Andreas Kling
219e3b9235 LibWeb: Make stacking context tree dumps more readable
Include the Layout::Node::debug_description() and the z-index.
2022-03-04 15:52:42 +01:00
Andreas Kling
15ed0ebdc6 LibWeb: Implement hit testing a bit closer to spec
We now perform hit testing in reverse paint order as described in CSS2's
section about the z-index property.
2022-03-04 15:52:42 +01:00
Andreas Kling
0401d7da36 LibWeb: Preserve z-index:auto in CSS::ComputedValues
This is still interesting for debugging purposes, so let's not blindly
convert "auto" to 0. Code later down the line handles "auto" anyway.
2022-03-04 15:52:42 +01:00
Lenny Maiorani
d144da3a62 LibGfx: Refactor Vector[2,3,4] to VectorN with specializations
`Gfx::Vector[2,3,4]` are nearly identical implementations. This code
redundancy does not follow the DRY (Don't Repeat Yourself) principle
leading to possible out-of-sync errors between the classes.

Combining these classes into a class template which can be specialized
for each needed size makes the differences obvious through
`constexpr-if` blocks and `requires` clauses.
2022-03-04 12:56:05 +01:00
Andreas Kling
c2a66b77df LibWeb: Measure intrinsic block width *around* children's border edge
When calculating the intrinsic width of a block-level box, we were
previously measuring the content boxes of children. This meant that
shrink-to-fit sized blocks didn't gain enough width to contain children
with horizontal padding and/or border.
2022-03-04 12:34:26 +01:00
Jelle Raaijmakers
4f91616759 Kernel: Report AC'97 vendor and device ID 2022-03-04 11:07:25 +01:00
u9g
9fcd3f7920 Spreadsheet: Prevent infinite loop in Range ctor 2022-03-04 04:29:20 +03:30
u9g
12ef20b869 Spreadsheet: Improve R function to support all of the examples 2022-03-04 04:29:20 +03:30
u9g
93115ee044 Spreadsheet: Add Range(s).toArray() 2022-03-04 04:29:20 +03:30
Wuzado
6302ca0043 reboot: Port to LibMain
First commit to the project! :^)
2022-03-03 15:42:44 -08:00
electrikmilk
58a865f349 Base+Manpages: Add basic GML documentation
First draft of GML documentation, just to get things started.
2022-03-03 14:59:00 -08:00
Jakub Berkop
d01d754b83 Kernel: Fixed behavior of repeated calls to register_string
Previously register_string would return incorrect values when
called multiple times with the same input. This patch makes this
function return the same index, identical strings. This change was
required, as this functionality is now being used with read syscall
profiling, (#12465), which uses 'register_string' to registers file
path on every read syscall.
2022-03-03 14:53:35 -08:00
ForLoveOfCats
697e1810bf Calculator: Add keyboard input for more operations 2022-03-03 22:06:14 +01:00
ForLoveOfCats
19f80f88bf Calculator: Avoid focusing any keypad button other than the equal button
Having the return key sometimes press the equal button when nothing is
focused and press a different button when there is focus felt confusing.

The equal button is still able to be focused for the tab cycle to have
something to go to in order to jump out of the textbox but no other
keypad button can be focused now.
2022-03-03 22:06:14 +01:00
ForLoveOfCats
0d0ba375e2 Calculator: Utilize Button mimic_pressed to show when keys are pressed 2022-03-03 22:06:14 +01:00
ForLoveOfCats
e8f6a650ad LibGUI: Add mimic_pressed to Button to signify being virtually clicked
A button that is "mimic pressed" is drawn like it is being clicked when
it isn't necessarily actually being pressed. This lets programs which
keyboard based input that mirrors a button to show visual feedback when
a key is pressed.
2022-03-03 22:06:14 +01:00
ForLoveOfCats
1fd16232d3 LibGUI: Use logical and instead of bitwise in Button paint call
This appears to have been a typo. While it does work it's probably
better to be more clear here.
2022-03-03 22:06:14 +01:00
Karol Kosek
20dbbdf90c Spreadsheet: Simplify enabling actions on selection
Since the function will *always* be called with some selection, we can
straight up enable actions.
2022-03-03 22:19:50 +03:30
Karol Kosek
f384aff510 Spreadsheet: Move deselection instructions to on_selection_dropped
The previous code never executed, as SpreadsheetView splits selection
events into `on_selection_changed` and `on_selection_dropped` depending
on whether there is any selection.
2022-03-03 22:19:50 +03:30
Karol Kosek
dc65543fa9 Spreadsheet: Show the opened filename in the window title
Prior to this commit, there was a set_filename() function that could set
the window title, but actually it never did that.  It was called only
in one place -- by the 'Save as...' action, but it always failed to
change anything, because there was a check that tried to reassign
the same filename. :/

This patch:
1. removes that check, and therefore
2. renames the function to simply `update_window_title()`,
3. starts calling the function from more places (at startup and after
   loading a file),
4. changes the window title order
   (`{app_name} - {filename}` -> `{filename} - {app_name}`) to match
   the other applications style on the system. :^)
2022-03-03 22:17:54 +03:30
Luke Wilde
b59773de17 LibWeb: Include cookies in form submission
Services expect cookies to be submitted with forms, especially login
screens.

Allows us to sign in to GitHub (including two factor authentication)
and start using it!
2022-03-03 15:08:35 +01:00
Jelle Raaijmakers
6e1333cc71 LibWeb: Prevent crashes with progress element's value and max attributes
If either of these attributes are missing, do not crash in `strtod()`
but return a default value instead.
2022-03-03 14:14:33 +01:00
Andreas Kling
51d3c8bbf7 LibWeb: Forward-declare FormattingState as a struct 2022-03-03 13:56:37 +01:00
Andreas Kling
205208db11 LibWeb: Reduce HashMap thrashing during custom property cascade
Build the final custom property map right away instead of first making
a temporary pointer-only map. We also precompute the final needed
capacity for the map to avoid incremental rehashing.
2022-03-03 13:56:37 +01:00
Andreas Kling
e4fdb40158 LibWeb: Use FlyString for CSS custom property names 2022-03-03 13:56:37 +01:00
Stephan Unverwerth
7a19d0b4f9 LibSoftGPU: Add mipmap selection to sampler class 2022-03-03 13:50:25 +01:00
Stephan Unverwerth
dd900570fd LibSoftGPU: Add log2_approximate() 2022-03-03 13:50:25 +01:00
Stephan Unverwerth
be15cf5457 LibSoftGPU: Add ddx() and ddy() to calculate partial derivatives 2022-03-03 13:50:25 +01:00
Stephan Unverwerth
869393c7a0 LibGL: Fix interpretation of mipmap filtering modes
GL_LINEAR_MIPMAP_NEAREST means choose nearest mipmap level, interpolate
texels linearly.

GL_NEAREST_MIPMAP_LINEAR means choose the two closest mipmap levels,
sample the texels unfiltered and linearly interpolate based on the
fractional value of the mipmap level.

Previously we had this backwards.
2022-03-03 13:50:25 +01:00
Andreas Kling
88aa356606 LibWeb: Update element style when focus state changes
To ensure that :focus rules get included (or excluded), we have to
update style whenever focus moves.
2022-03-03 13:24:03 +01:00
Andreas Kling
ef33a40b99 LibWeb: Remove bogus line box width adjustment
This basically reverts 95715f0c8f, as it
was totally wrong for text-align:center and text-align:right.
2022-03-03 12:57:53 +01:00
Andreas Kling
7dae895704 LibWeb: Align actual baselines, not just bottoms
Until now, we've been treating the bottom of every line box fragment as
its baseline, and just aligning all the bottoms to the bottom of the
line box. That gave decent results in many cases, but was not correct.

This patch starts moving towards actual baseline calculations as
specified by CSS2.

Note that once layout is finished with a line box, we also store the
baseline of the line box in LineBox::m_baseline. This allows us to align
the real baseline of display:inline-block elements with other inline
content on the same line.
2022-03-03 12:57:53 +01:00
Andreas Kling
1d6cf3a43f LibWeb: Consider all children when doing height:auto for normal blocks
Only measuring from the top to the last in-flow block was not giving us
enough height in many cases.
2022-03-03 12:57:53 +01:00
Andreas Kling
ed44f9e290 LibWeb: Small improvements to layout tree dumps
- Say "content-size" instead of just "size" to clarify which size it is
- Show box model metrics by default
2022-03-03 12:57:53 +01:00
Jelle Raaijmakers
ae2591657d Meta: Add "SerenityOS" to the QEMU window title
Just a small quality of life improvement :^)
2022-03-03 11:47:18 +01:00
Kasper Karlsson
0b91a46a0c Base: Fix typo in FlappyBug documentation 2022-03-02 22:21:25 -08:00
Nícolas F. R. A. Prado
cb2e187be1 SoundPlayer: Sort CMake sources alphabetically 2022-03-02 22:10:05 -08:00
Nícolas F. R. A. Prado
5bafb80255 SoundPlayer: Draw album cover with correct aspect ratio
Instead of drawing the album cover scaled to cover the whole
visualization area, draw it resized to fit the area without altering the
aspect ratio.
2022-03-02 22:10:05 -08:00
Nícolas F. R. A. Prado
2470997fc9 SoundPlayer: Rename NoVisualization to AlbumCoverVisualization
Since the NoVisualization widget now shows the album cover, it should be
called AlbumCoverVisualization instead.
2022-03-02 22:10:05 -08:00
Nícolas F. R. A. Prado
2b1ac91764 SoundPlayer: Display album cover in the NoVisualizationWidget
Display the album cover for the current playing song in the
visualization area for the "None" Visualization.

For now only "cover.png" and "cover.jpg" are looked for in the same
directory for the album cover image.

When no cover image is found the serenity background is shown instead as
a fallback.
2022-03-02 22:10:05 -08:00
Nícolas F. R. A. Prado
2e1c017bce SoundPlayer: Add start_new_file() to VisualizationWidget's API
This adds a new start_new_file() function to VisualizationWidget which
is called when the player starts a new file, passing the filename of the
file. This allows VisualizationWidget subclasses to do any setup needed
when a new file is started.
2022-03-02 22:10:05 -08:00
Lenny Maiorani
064cfd6cb7 Applications: Fix undefined behavior capturing non-static constexpr 2022-03-02 22:01:58 -08:00
MacDue
7a538c1e39 Base: Correctly set border thickness in Cupertino theme
This has the same look as before, but the extra thickness is needed as
the border radius no longer changes the thickness the window frame is
painted.
2022-03-02 21:56:57 +01:00
MacDue
6ff041dcfc WindowServer: Treat window frames with a border radius as transparent
Without this, there are repainting artefacts when the window is moved.
2022-03-02 21:56:57 +01:00
MacDue
c2fcc3a621 WindowServer: Disable shadow rendering for themes with a border-radius
The current shadow renderer only works for purely rectangular windows,
when enabled with border radiuses the corners are wrong.
2022-03-02 21:56:57 +01:00
MacDue
6c48fd84ad LibGfx: Don't paint the window frame larger for the border-radius
Previously with a border radius you would get a "ghost" window frame
which was not really there, and would not respond to clicks/attempts
to resize.
2022-03-02 21:56:57 +01:00
cocateh
dd8fdf7077 Utilities: Lint CMakefiles.txt
Fixed an unalphabetical order of one of the entries.
2022-03-02 21:55:32 +01:00
cocateh
91fa10a0ab Utilities: Port tar to LibMain
Ported tar to LibMain and changed it to use Core::System syscalls.
2022-03-02 21:55:32 +01:00