Commit Graph

49343 Commits

Author SHA1 Message Date
thankyouverycool
bc8b409a3c FontEditor: Use compact InputBox for Go to Glyph action 2023-04-18 10:05:21 +02:00
thankyouverycool
8d86f2e69f Calculator: Use numeric InputBox for digit rounding and shrinking
Calc was using a bespoke SpinBox dialog which is no longer necessary.
2023-04-18 10:05:21 +02:00
thankyouverycool
a55d2be147 MasterWord: Use numeric InputBox for settings
And use proper ellipses and capitalization in related action text.
2023-04-18 10:05:21 +02:00
thankyouverycool
14072ce8f0 FileManager: Use InputBox icons for file and directory creation
And set a window icon in desktop mode.
2023-04-18 10:05:21 +02:00
thankyouverycool
ca8918f310 LibGUI: Add a numeric input type to InputBox
This should be a more convenient API and a better UX for apps that
want simple integer input from the user.
2023-04-18 10:05:21 +02:00
thankyouverycool
33ccbc9415 LibGUI: Implement calculated_min_size() for SpinBox 2023-04-18 10:05:21 +02:00
thankyouverycool
b66a76f73b LibGUI: Allow SpinBox to set its value with return key
Previously SpinBox did not update on return or changes to the editor.
The widget had to lose focus or be manually incremented. This lets
the editor update on return and now always displays the most recent
clamped value. set_value_from_current_text() will also be useful to
programmatically set SpinBox within layouts whose default buttons
consume return key presses.
2023-04-18 10:05:21 +02:00
thankyouverycool
7c314f3855 LibGUI: Let InputBox display an ImageWidget
InputBox can now be given a bitmap to display alongside its
prompt and editor. Prompts are now optional to allow for
compact dialogs.
2023-04-18 10:05:21 +02:00
thankyouverycool
02a9e5d3f6 LibGUI+Userland: Improve error and font handling for InputBox
Adds fallible factories, ports DeprecatedString, and rebuilds the
layout to accomodate system font changes.
2023-04-18 10:05:21 +02:00
thankyouverycool
9c2bcffe83 LibGUI: Improve calculated_min_size() for single-line TextEditor
TextBox now shrinks to fit the current font based on preferred line
height, maintaining its historical minimum size of 40x22
2023-04-18 10:05:21 +02:00
thankyouverycool
7304556ff2 LibGUI: Add Window::on_font_change() hook 2023-04-18 10:05:21 +02:00
thankyouverycool
b7cac829ae WindowServer: Show complete title when Window is not resizable
Saves Dialogs the trouble of accounting for variable width titles and
makes all unresizable windows more responsive to font changes.
2023-04-18 10:05:21 +02:00
Romain Chardiny
eef07d2f57 ldd: Pledge map_fixed 2023-04-17 19:29:20 -04:00
thankyouverycool
5bb9af8297 Minesweeper: Simplify resizing game window
Instead of propagating field size changes to main and manually
calculating window size, use auto shrink to automatically
resize the window after changes to the board.
2023-04-17 20:31:12 +02:00
thankyouverycool
76d17e6a8e MasterWord: Rectify resizing game window
Previously resizing the window did not take into account the
height of the status bar. The board now fixes its size on reset
and allows the Window to auto shrink to the perfect dimensions.
2023-04-17 20:31:12 +02:00
thankyouverycool
b8d88f33cf MasterWord: Set icon before showing window 2023-04-17 20:31:12 +02:00
thankyouverycool
7b05bf1c20 LibGUI: Always paint Statusbar's vertical lines when not maximized
Fixes MasterWord's single Statusbar::Segment not painting vertical
lines despite its window being unmaximized. This was only an issue
for non-resizable windows as the Statusbar resizing corner otherwise
negates spans_entire_window_horizontally() when not maximized.
2023-04-17 20:31:12 +02:00
Tim Schumacher
aefd6e9ee1 Kernel: Don't get rbp from internal context switch structures
This has been broken on x86_64 since its introduction, as it features
more registers to be saved, and we never held up the "rbp has to be the
last pushed register" there.

Instead, just copy rbp from the thread structure, which is now properly
updated since the last commit.
2023-04-17 20:30:17 +02:00
Tim Schumacher
0ee476948b Kernel: Properly update the stored thread rbp when switching contexts 2023-04-17 20:30:17 +02:00
Tim Schumacher
50b7183bd1 Kernel: Mark the idle thread as active before switching it in
Otherwise, our code for dumping all thread stacks gets confused if it
finds a thread that is in a 'running' state, but that isn't marked
active.
2023-04-17 20:30:17 +02:00
Linus Groh
20f2389e2a Meta: Remove my CODEOWNERS entries 2023-04-17 19:22:10 +01:00
Andreas Kling
c710575f88 LibWeb: Honor box-sizing in flex item "specified size suggestion"
Although the spec doesn't mention it, if a flex item has box-sizing:
border-box, and the specified size suggestion is a definite size, we
have to subtract the borders and padding from the size before using it.

This fixes an issue seen in "This Week in Ladybird #4" where the
screenshots ended up in one long vertical stack instead of paired up
2 by 2.
2023-04-17 18:22:53 +02:00
Andreas Kling
7f79208759 LibWeb: Support implicit lineto commands after moveto in SVG paths
Per SVG2, any coordinate pairs following a moveto command should be
treated as implicit lineto commands with the same absoluteness as the
moveto command.
2023-04-17 14:18:45 +02:00
Brendan Kelly
8d0985ef01 SoundPlayer: Pledge "FileManager" config domain
This stops SoundPlayer from crashing when attempting to open a sound
file from inside the GUI
2023-04-17 10:34:40 +02:00
Tom
e758545b91 FileManager+LibGUI: Cache the FileSystem::can_delete_or_move value
Add the function FileSystemModel::Node::can_delete_or_move which will
cache the result of FileSystem::can_delete_or_move for a node. This
prevents having to make system calls repeatedly to obtain this
information.

Fixes #18399
2023-04-17 10:34:20 +02:00
Matthew Olsson
d824d07784 LibWeb: Fix inverted condition in WritableStream's constructor 2023-04-17 10:27:40 +02:00
Matthew Olsson
bb9d51fd84 LibWeb: Make StartAlgorithm return a Value instead of a Promise 2023-04-17 10:27:40 +02:00
Matthew Olsson
bad541a0d4 LibWeb: Remove outdated FIXMEs around WebIDL::invoke_callback usages 2023-04-17 10:27:40 +02:00
Matthew Olsson
c40109628d LibWeb: Properly reject abrupt completion in clean_up_on_return 2023-04-17 10:27:40 +02:00
Kenneth Myhra
4ed71d5b40 Ports: Add depends 'libslirp' and configopt '--enable-slirp' to QEMU
This adds the dependency 'libslirp' and forces QEMU to pick up the
dependency or fail compilation by adding the config option
'enable-slirp'.
2023-04-17 10:19:28 +02:00
Kenneth Myhra
ae075b3dff Ports: Reformat QEMU's package.sh script
Use single quotes for non-interpolated strings in the 'configopts' and
'depends' sections.
Let each dependency of the 'depends' section be on a separate line.
2023-04-17 10:19:28 +02:00
Kenneth Myhra
4e661a400b Ports: Add libslirp version 4.7.0
The slirp submodule was removed from QEMU in version 7.2, running
Serenity in QEMU on a Serenity host could fail without this one if
running with network enabled.

For more information on the removal of the slirp submodule see the
following link: https://wiki.qemu.org/ChangeLog/7.2#Removal_of_the_%22slirp%22_submodule_(affects_%22-netdev_user%22)
2023-04-17 10:19:28 +02:00
MacDue
f0dde6236d Tests: Add layout test for SVG preserveAspectRatio
This is a cut down version of the example, but it's nice to add a
test to ensure this keeps working.
2023-04-17 07:32:31 +02:00
MacDue
71ed1e3e50 Base: Add SVG preserveAspectRatio demo page 2023-04-17 07:32:31 +02:00
MacDue
5df4e64eb7 LibWeb: Implement SVG preserveAspectRatio attribute
This attribute is used to define how the viewBox should be scaled.
Previously the behaviour implemented was that of "xMidYMid meet", now
all of them work (expect none :P).

With this the Discord login backend is now correctly scaled/positioned.

This also brings our SVG code a little closer to the spec! With spec
comments and all :^)

(Minor non-visible update to layout tests)
2023-04-17 07:32:31 +02:00
MacDue
5a12e9f222 LibWeb: Clip SVG content to parent <svg> element bounding box 2023-04-17 07:32:31 +02:00
Tim Schumacher
d4e114a31e Kernel: Remove unused functions related to reading full inodes 2023-04-17 01:20:23 +02:00
Tim Schumacher
f5010f7263 Kernel: Use purpose-sized buffers for holding readlink results 2023-04-17 01:20:23 +02:00
Tim Schumacher
6f524e35a7 Kernel: Use purpose-sized buffers when resolving inodes as links 2023-04-17 01:20:23 +02:00
Tim Schumacher
acd8c8dba4 Kernel: Add Inode::read_until_filled_or_end
The existing `read_entire` is quite slow due to allocating and copying
multiple times, but it is simultaneously quite hard to get rid of in a
single step. As a replacement, add a new function that reads as much as
possible directly into a user-provided buffer.
2023-04-17 01:20:23 +02:00
Timothy Flynn
c403f8e92c LibWeb: Update the media playback time for clicks on the media timeline
When clicking on the media timeline, compute the percentage along the
timeline's width the user clicked, and set the playback time to the same
percentage of the video's duration.
2023-04-17 01:16:04 +02:00
Timothy Flynn
ad3c63684c LibWeb: Restrict toggling video playback to certain areas in a video
When the control bar is shown, do not toggle playback when clicking on
the control bar, unless the click target is the playback button. This
will let us implement clicking on the timeline to seek.

Note that this requires caching some layout rects on the video element.
We need to remember where the corresponding layout boxes are, and we
can't cache them on the layout box, as that may be destroyed any time.
2023-04-17 01:16:04 +02:00
Timothy Flynn
c4e3ba2dfb LibWeb: Implement converting a DevicePixelRect to a CSSPixelRect
Which also requires converting a DevicePixelSize to a CSSPixelSize.
2023-04-17 01:16:04 +02:00
Timothy Flynn
5a98a5529f LibWeb: Begin implementing media resource seeking 2023-04-17 01:16:04 +02:00
Timothy Flynn
f8f35fdaad LibVideo: Remove hook to notify clients upon reaching end of the stream
This reverts commit 33047b38ec.

This use case is now satisfied with on_playback_state_change and getting
the playback state from the PlaybackManager.
2023-04-17 01:16:04 +02:00
Timothy Flynn
6cd50d1910 LibWeb: Change the callback used to detect the end of a video stream
The on_end_of_stream callback was added to notify clients that video
playback has stopped when we didn't have a way to retrieve the playback
state from Video::PlaybackManager. Now that we do, we should consolidate
on using the on_playback_state_change callback to detect such changes.
2023-04-17 01:16:04 +02:00
Timothy Flynn
c08755836d LibWeb: Fix a couple of HTMLMediaElement spec links 2023-04-17 01:16:04 +02:00
Nico Weber
4aaefeb1d5 Meta: Move some flags to common_compile_options.cmake
No behavior change.
2023-04-17 00:52:21 +02:00
Andreas Kling
e7f5b5a2f3 LibWeb: Fix multi-line flex column layouts with auto height on container
When sizing a flex container with flex-direction:column under a
max-content height constraint, we were incorrectly truncating the
infinite available height to 0 when collecting flex items into lines.

This caused us to put every flex item in its own flex line, which is the
complete opposite of what we want during max-content intrinsic sizing,
as the layout would grow wide but not tall.
2023-04-16 21:45:15 +02:00
Andreas Kling
b9b6037d2b LibWeb: Honor gap between flex lines when using align-content: stretch
We have to take the cross gap into account when calculating the "sum of
flex line cross sizes" in "Handle 'align-content: stretch'".
2023-04-16 20:52:32 +02:00