Commit graph

35269 commits

Author SHA1 Message Date
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
kleines Filmröllchen
f209d0491f SoundPlayer: Fix potential never-updated bars visualization
When the bars visualization receives a new buffer, it checks if it needs
a new buffer, which is only the case after it has repainted. However,
after then setting m_is_using_last, which is the flag for this, it
checks the buffer size of the passed buffer and returns if that is too
small. This means that if the visualizer receives a buffer that is too
small, and because of external circumstances the update doesn't run
after the buffer modification routine, the m_is_using_last variable is
stuck at true, which means that the visualization incorrectly believes
that the passed buffer is old and we need not update. This simply fixes
that by resetting m_is_using_last if the buffer we're passed is too
small, because in that case, we're clearly not using the last buffer
anymore.

Note: This bug is not exposed by the current SoundPlayer behavior. It
will become an issue with future changes, so we should fix it
regardless.
2022-03-02 21:41:10 +01:00
Michiel Visser
39409438b2 LibWeb: Send Origin on WebSocket connection
Some services using WebSockets require that the request contains the
Origin header, otherwise these services will return a 403 Forbidden
response. WebSocketServer already supports sending the Origin header,
however LibWeb did not send the origin with the IPC request.
2022-03-02 21:38:17 +01:00
thankyouverycool
21ba9c808e Help: Improve search ergonomics
Up and down arrows now select search results. Matching index now
displays in full before filtering. Searching from the command
line focuses the query, and searches are now case insensitive.
2022-03-02 21:37:58 +01:00
thankyouverycool
f3d672d53d LibGUI: Support hierarchical matches in FilterProxyModel
Fixes crash when searching in Help.
Patch by @eggpi
2022-03-02 21:37:58 +01:00
thankyouverycool
8825abe7ed Help: Convert to GML and propagate more errors
Converts Help's layout to GML, propagates model and icon creation
errors, and switches to the MainWidget-namespace organization
pattern seen in more up-to-date apps like TextEditor to make things
easier to maintain going forward.
2022-03-02 21:37:58 +01:00
Daniel Bertalan
6879465725 Ports: Update vttest to version 20220215
We now download a versioned tarball instead of the latest release to
avoid breaking the port build due to a signature mismatch when a new
version is released.
2022-03-02 21:37:26 +01:00
networkException
698c88ddb2 Base: Add the flag emoji for Hesse (DE-HE) 2022-03-02 21:06:05 +01:00
ForLoveOfCats
a4f9630470 js: Print ArrayBuffer.maxByteLength when present 2022-03-02 20:53:18 +01:00
ForLoveOfCats
f350c153e8 LibJS: Implement and test ArrayBuffer.prototype.resize 2022-03-02 20:53:18 +01:00
ForLoveOfCats
b29e19c52a LibJS: Implement and test getters added by resizable ArrayBuffer 2022-03-02 20:53:18 +01:00
ForLoveOfCats
e01ee4e30b LibJS: Construct ArrayBuffer with max byte length when provided 2022-03-02 20:53:18 +01:00
ForLoveOfCats
e8416b603f LibJS: Accept ArrayBuffer constructor options argument
Test262 seems to test the changes in the "Resizable ArrayBuffer and
growable SharedArrayBuffer" proposal. Begin implementing this proposal
by accepting the new options object argument to the ArrayBuffer
constructor.

https://tc39.es/proposal-resizablearraybuffer
https://github.com/tc39/test262/blob/main/test/built-ins/ArrayBuffer/options-maxbytelength-diminuitive.js
2022-03-02 20:53:18 +01:00
u9g
4eb2c70a03 Spreadsheet: Make Range(s).forEach() return Position objects 2022-03-02 21:49:17 +03:30
u9g
d047f26a74 Spreadsheet: Add Range(s).at(ix) 2022-03-02 21:49:17 +03:30
Liav A
629eed3a4c Meta: Add option to run SerenityOS on a QEMU MicroVM machine
The microvm machine type is a modern tool for kernel and firmware
developers to test their software against features like FDTs, second
IOAPIC, lack of legacy devices by default, the ability of using PCIe
without using PCI x86 IO ports, etc.

We can boot into such machine but we are limited in the functionality we
support currently for this type of virtual machine.
2022-03-02 18:41:54 +01:00
Liav A
2dbbec66e4 Meta: Add option to run SerenityOS on a QEMU ISA-PC machine
The ISA-PC machine type provides no PCI bus support, no IOAPIC support
and other modern PC features of our generation.

This is mainly a good environment for testing abstractions in the kernel
space, and can help with improving on them for the sake of porting the
OS to other chipsets and CPU architectures.
2022-03-02 18:41:54 +01:00
Liav A
30eeba1981 Kernel/Storage: Don't try to enumerate PCI adapters if PCI is disabled
If there's no PCI bus, then it's safe to assume that we run on a x86
machine that has an ISA IDE controller in the system. In such case, we
just instantiate a ISAIDEController object that assumes fixed locations
of IDE IO ports.
2022-03-02 18:41:54 +01:00
Liav A
fafa339264 Kernel/Graphics: Don't try to enumerate PCI adapters if PCI is disabled
If there's no PCI bus, then it's safe to assume that the x86 machine we
run on supports VGA text mode console output with an ISA VGA adapter.
If this is the case, we just instantiate a ISAVGAAdapter object that
assumes this situation and allows us to boot into VGA text mode console.
2022-03-02 18:41:54 +01:00