Commit graph

3935 commits

Author SHA1 Message Date
Mr.UNIX 2440a2f83f TerminalSettings: Port to GML Compiler 2024-01-19 17:05:53 +01:00
Mr.UNIX 3b73064497 TerminalSettings: Split TerminalSettingsWidget into different files 2024-01-19 17:05:53 +01:00
Sanil ca2aaaeac2 KeyboardSettings: Port to GML compiler 2024-01-19 17:03:30 +01:00
kleines Filmröllchen 8ee014a437 CertificateSettings: Use new GML compiler 2024-01-19 10:50:15 +00:00
kleines Filmröllchen 63687c46ff CalendarSettings: Use new GML compiler 2024-01-19 10:50:15 +00:00
kleines Filmröllchen 14a99bb22d Calendar: Use new GML compiler 2024-01-19 10:50:15 +00:00
kleines Filmröllchen 15a539a5b0 Calculator: Use new GML compiler 2024-01-19 10:50:15 +00:00
kleines Filmröllchen 182126dfda BrowserSettings: Use new GML compiler 2024-01-19 10:50:15 +00:00
kleines Filmröllchen 6f554af9c5 Run: Use new GML compiler 2024-01-19 10:50:15 +00:00
Tim Ledbetter 0d8a013ee1 SoundPlayer: Don't drop the unix pledge
Without it, `SoundPlayer` crashes as soon as you try to open a file.
2024-01-19 09:08:37 +01:00
Bastiaan van der Plaat c94fc7d3b0 Ladybird: Change default new tab URL to about:newtab 2024-01-17 17:32:05 +01:00
Sam Atkins 8d80841e9c LibFileSystem+Everywhere: Return ByteString from read_link() 2024-01-16 08:42:34 +00:00
Sam Atkins 56c5ffe398 LibFileSystem+Userland: Return ByteString from real_path() 2024-01-16 08:42:34 +00:00
Sam Atkins cdf17efb9a LibFileSystem+Userland: Return ByteString from absolute_path() 2024-01-16 08:42:34 +00:00
Sam Atkins fb644d08ac LibFileSystem+Everywhere: Return ByteString current_working_directory()
That is, return it *from* current_working_directory(), but I didn't have
room. :^)
2024-01-16 08:42:34 +00:00
Andrew Kaster 162c334508 Revert "Assistant: Check for access before showing results"
This reverts commit 7c88ab2836.

Post-merge review revealed that the checks added in this PR prevent
any and all non-executable files from being displayed in Assistant,
which is a regression from intended functionality.
2024-01-14 15:51:32 -07:00
Hugh Davenport e6d0239c23 Settings: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport 7fa0cf194f Applications: Add fullscreen option to Utilities 2024-01-14 15:18:43 -07:00
Hugh Davenport 8886324cbf Applications: Add fullscreen for Office category 2024-01-14 15:18:43 -07:00
Hugh Davenport 4aca883d51 Mail: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport 4c31049d0c PixelPaint: Add fullscreen option 2024-01-14 15:18:43 -07:00
Hugh Davenport 13c66ebf12 DevTools: Add fullscreen option
All except SQLStudio, as that causes a crash
2024-01-14 15:18:43 -07:00
Jelle Raaijmakers 015622bc22 Kernel: Set correct KeyCode count
The underlying value of the `KeyCode::Key_*` enum values starts at 0,
so we should add 1 to `Key_Menu` to get the correct count.
2024-01-14 15:06:37 -07:00
Lucas CHOLLET cb669675f1 FileManager: Start displaying basic metadata for images
Let's add a new group in the Image tab of the properties window. The
goal is to provide generic metadata, only a few tags are displayed here.
2024-01-14 15:04:43 -07:00
Tim Ledbetter b242fe20cc SystemMonitor: Make the icon column in the Processes tab non-selectable 2024-01-14 15:01:47 -07:00
Sam Atkins e0fd5beb36 LibGUI+Applications: Default the SpinBox min/max to the full int range
By default, a SpinBox's value should be unlimited, (or as close as we
can get to that,) and then the GML or code can impose a limit if
needed. This saves the developer from entering an arbitrary "big" max
value when they want the value to have no maximum.

I've audited the use of SpinBox and added `min: 0`, and removed a `max`,
where appropriate. All existing SpinBoxes constructed in code have a
range set explicitly as far as I can tell.
2024-01-14 13:46:14 +00:00
Sam Atkins cbd28c9110 HexEditor: Add annotations system
Allow the user to highlight sections of the edited document, giving them
arbitrary background colors. These annotations can be created from a
selection, or by manually specifying the start and end offsets.
Annotations can be edited or deleted by right-clicking them.

Any color can be used for the background. Dark colors automatically make
the text white for easier readability. When creating a new annotation,
we use whatever color the user last picked as this is slightly more
likely to be the one they want.

Icons contributed by Cubic Love.

Co-authored-by: Cubic Love <7754483+cubiclove@users.noreply.github.com>
2024-01-14 13:45:02 +00:00
Sam Atkins 1168e46c1d HexEditor: Extract pixel-position-to-byte-offset code 2024-01-14 13:45:02 +00:00
Sam Atkins 84dd0ce1ae HexEditor: Wrap selection and behavior in a struct 2024-01-14 13:45:02 +00:00
Tim Ledbetter 48a3a02238 LibCrypto: Make constructing a BigInteger from string fallible
Previously, constructing a `UnsignedBigInteger::from_base()` could
produce an incorrect result if the input string contained a valid
Base36 digit that was out of range of the given base. The same method
would also crash if the input string contained an invalid Base36 digit.
An error is now returned in both these cases.

Constructing a BigFraction from string is now also fallible, so that we
can handle the case where we are given an input string with invalid
digits.
2024-01-13 19:01:35 -07:00
Bastiaan van der Plaat c0acb2918b Ladybird: Rename new-tab.html file to newtab.html 2024-01-13 13:41:09 -05:00
Dan Klishch ccd701809f Everywhere: Add deprecated_ prefix to JsonValue::to_byte_string
`JsonValue::to_byte_string` has peculiar type-erasure semantics which is
not usually intended. Unfortunately, it also has a very stereotypical
name which does not warn about unexpected behavior. So let's prefix it
with `deprecated_` to make new code use `as_string` if it just wants to
get string value or `serialized<StringBuilder>` if it needs to do proper
serialization.
2024-01-12 17:41:34 -07:00
ronak69 4aa04cdf65 Calendar: Add feature to view/edit duration of events in AddEventDialog 2024-01-12 17:13:46 -07:00
ronak69 5b72711beb Calendar: Set the end time relative to the start time in AddEventDialog 2024-01-12 17:13:46 -07:00
ronak69 5875fae9e9 Calendar: Set minimum hour to 0 and maximum hour to 23 in AddEventDialog 2024-01-12 17:13:46 -07:00
kleines Filmröllchen eada4f2ee8 AK: Remove ByteString from GenericLexer
A bunch of users used consume_specific with a constant ByteString
literal, which can be replaced by an allocation-free StringView literal.

The generic consume_while overload gains a requires clause so that
consume_specific("abc") causes a more understandable and actionable
error.
2024-01-12 17:03:53 -07:00
Hugh Davenport 7c88ab2836 Assistant: Check for access before showing results 2024-01-12 16:51:12 -07:00
Hugh Davenport 87e00565f1 Browser: Add help menu item
Contributes towards: #21091
2024-01-12 16:27:40 -07:00
ronak69 75183402fd Calculator: Finish operation-in-progress only on new binary operations
Because of this the unary operations got applied to the result of the
operation-in-progress instead of the current argument as shown here:

    `16 + 9 <sqrt> =`
        Previous output: `sqrt(16 + 9)` = `5`
        Expected output: `16 + sqrt(9)` = `19`
2024-01-12 16:03:09 -07:00
Andrew Kaster 02edd240ae LibWeb+WebContent: Spawn Worker processes from the chrome
Instead of spawning these processes from the WebContent process, we now
create them in the Browser chrome.

Part 1/N of "all processes are owned by the chrome".
2024-01-12 15:53:11 -07:00
Tim Ledbetter 3cd455e554 Calculator: Make the equals button non-focusable
This is not necessary, as pressing Enter will activate the button
whether it is in focus or not. This makes the equals button behave the
same as all other buttons.
2024-01-12 12:53:12 +00:00
Tim Ledbetter 043d5d5c27 Calculator: Make calculator display non-interactive
Previously, it was possible for the user to input text into the
calculator display. With this change, the calculator display is made
read-only.
2024-01-12 12:53:12 +00:00
Tim Ledbetter 7772637d03 SystemMonitor: Condense process statistics displayed in processes tab
Previously, some non-default process statistics were displayed in a
long human readable format in the processes tab, which could negatively
affect readability. A shorter format is now used in the processes tab,
while the process properties window retains the longer format.
2024-01-12 09:07:51 +01:00
Hugh Davenport c566ef2a9d PartitionEditor: Show better error when can't find partition table 2024-01-11 20:57:40 +00:00
Hugh Davenport 91cdda7763 Calculator: Allow system shortcuts
Before the key events for shortcuts such as ALT-F4 did not work as the
widget was swallowing up the shortcut. This changes ignores the event
if nothing else matched
2024-01-11 19:00:46 +00:00
Tim Ledbetter 800cb4eceb SystemMonitor: Don't include the Idle Task in process statistics
The Idle Task is no longer displayed in the Processes tab and is not
included in the process count in the status bar.
2024-01-10 23:28:10 +01:00
Tim Ledbetter 1c1fc67f75 SystemMonitor: Prefer range-based for loop when updating ProcessModel 2024-01-10 23:28:10 +01:00
Sam Atkins 5f0230a57e LibGUI: Make NumericInput work well in GML
- Register the widget
- Register property getters and setters
- Rename getters and setters to match the property names, as required by
  the GML compiler. The names min/max/value are chosen to match SpinBox.
- Prevent a crash when the minimum is less than the maximum (which can
  happen while editing the GML).
2024-01-10 13:13:27 +00:00
Sam Atkins 4b96136803 LibGUI: Store NumericInput value as an i64
Moar range = moar better. I'm hoping to use this for a size_t value
later, so this almost covers that.
2024-01-10 13:13:27 +00:00
Sam Atkins ea31c11aff LibGUI+PDFViewer: Move NumericInput into LibGUI
A text box that is restricted to numbers within a range, is generally
useful. Let's make it available for use!
2024-01-10 13:13:27 +00:00
Nico Weber c997ee7b9d LibGfx+ImageViewer: Replace ImageDecoder::is_vector() with an enum
That makes it easier to extend to other special frame formats.
2024-01-10 09:39:00 +01:00
Mr.UNIX 9507157f04 Escalator: Port Escalator to GML Compiler 2024-01-10 00:03:27 +01:00
Lucas CHOLLET e56eb11dee ImageDecoder: Add plumbing to allow a client to request an ideal size
This is only used for vector graphics format where requesting the true
displayed size leads to visual enhancement.
2024-01-07 20:10:22 +01:00
Timothy Flynn 3a06d5a9a1 Browser: Show an informational dialog after taking a screenshot
The dialog displays where the screenshot is saved and presents an option
to open its containing folder.
2024-01-06 20:11:12 +00:00
david072 a84778f6ee Calendar/AddEventDialog: Prevent inputting invalid date ranges
The calendar now verifies that the user can't input invalid date ranges,
i.e. date ranges where the end is before the start. The UI elements do
this implicitly, by adjusting the values when changing the dates in an
illegal way (e.g. when picking an end date that is before the start
date, the end date will change to the start date).
2024-01-06 10:37:53 -07:00
david072 b657fa6f95 Calendar: Ask about unsaved changes when closing the window :^)
The Calendar now asks about unsaved changes in the calendar when
attempting to close the window.
2024-01-06 10:37:53 -07:00
david072 75faa9239a Calendar/EventManager: Set m_dirty directly 2024-01-06 10:37:53 -07:00
david072 887f040d0e Calendar/EventManager: Store events as structs
Previously, the EventManager stored the calendar events as a raw
JsonArray of objects. Now, we parse the JSON into a Vector<Event>
structure and store that in the EventManager. This makes it easier to
access the events from the outside, as you now don't have to know the
JSON structure anymore.
2024-01-06 10:37:53 -07:00
david072 7df936b660 Calendar/AddEventDialog: Add a cancel button 2024-01-06 10:37:53 -07:00
david072 d0a4f6678c Calendar/AddEventDialog: Change SpinBoxes to accept 24-hour values
Since the meridiem selection was removed in the previous commit and
there currently doesn't seem to be a way to change the system time
format, I'm changing the SpinBoxes here to accept 24-hour format values
for now.
2024-01-06 10:37:53 -07:00
david072 60174cc9aa Calendar/AddEventDialog: Remove meridiem selection
This removes the meridiem selection in the AddEventDialog of the
calendar because it thus far didn't do anything.
2024-01-06 10:37:53 -07:00
david072 18b1f856e5 Calendar/AddEventDialog: Convert pointers to references
This removes some warnings ;^).
2024-01-06 10:37:53 -07:00
david072 2c68554629 Calendar/AddEventDialog: Use the DatePicker to pick dates 2024-01-06 10:37:53 -07:00
david072 039114b728 Calendar: Move MonthListModel into Calendar.h
Previously, we had two versions of MonthListModel for the AddEventDialog
and the DatePickerDialog. Now, a unified version is in the Calendar.h
file, which can be used easily by anyone. Since that model and the
MeridiemListModel weren't used anymore in the AddEventDialog, I have
also removed them from there.
2024-01-06 10:37:53 -07:00
Bastiaan van der Plaat 0dd5aa40a8 LibWeb: Allow input color to give continuous updates 2024-01-06 10:02:15 -07:00
Sam Atkins fb6a9dd2f5 HexEditor: Clarify code for selecting byte colors
Instead of assigning, then sometimes reassigning these colors, set them
once. This makes it easier to see how we prioritize the different
factors that affect the styling.

`highlight_flag` is now `selected` since it represents if the byte is
within the current selection.
2024-01-06 16:08:49 +00:00
Sam Atkins 8ae4464fa5 HexEditor: Propagate HexDocumentFile creation errors in save_as() 2024-01-06 16:08:49 +00:00
Sam Atkins 034ec62cee HexEditor: Get document cells once per paint, not twice
HexDocument::get() involves a hash lookup, so let's store the returned
Cell instead of calling it twice for its two fields.
2024-01-06 16:08:49 +00:00
Sam Atkins da52c5e82a HexEditor: Make edited bytes bold
This will help them still stand out once we introduce annotations, which
also modify the colors.
2024-01-06 16:08:49 +00:00
Sam Atkins 27adbd1792 HexEditor: Stop allocating a String for every character printed
When we have a single char, we can directly construct a StringView for
it instead, which doesn't require a String allocation.
2024-01-06 16:08:49 +00:00
Cubic Love 30ea7b27d4 PixelPaint: Add link to manpage
Add a link to the manpage in the Help menu.
2024-01-04 12:08:37 -07:00
Torstennator 82e85172e5 PixelPaint: Fix crash when started with path
This change fixes the initial tool selection when pixelpaint is started
with a path. Previously an already existing editor was expected when
the default tool was initially propagated - which was not the case if
pixelpaint was launched to directly load an existing image.
2024-01-02 17:14:38 +01:00
Timothy Flynn d8fa226a8f Ladybird+LibWebView+WebContent: Make the screenshot IPCs async
These IPCs are different than other IPCs in that we can't just set up a
callback function to be invoked when WebContent sends us the screenshot
data. There are multiple places that would set that callback, and they
would step on each other's toes.

Instead, the screenshot APIs on ViewImplementation now return a Promise
which callers can interact with to receive the screenshot (or an error).
2024-01-01 10:11:45 +01:00
Andreas Kling b6d4eea7ac LibJS: Never give back virtual memory once it belongs to a cell type
Instead of returning HeapBlock memory to the kernel (or a non-type
specific shared cache), we now keep a BlockAllocator per CellAllocator
and implement "deallocation" by basically informing the kernel that we
don't need the physical memory right now.

This is done with MADV_FREE or MADV_DONTNEED if available, but for other
platforms (including SerenityOS) we munmap and then re-mmap the memory
to achieve the same effect. It's definitely clunky, so I've added a
FIXME about implementing the madvise options on SerenityOS too.

The important outcome of this change is that GC types that use a
type-specific allocator become immune to use-after-free type confusion
attacks, since their virtual addresses will only ever be re-used for
the same exact type again and again.

Fixes #22274
2023-12-31 15:35:56 +01:00
Liav A 60a96b3786 Userland: Actually use the correct character map index from KeyEvent
Instead of using a scan code, which for scan code set 2 will not
represent the expected character mapping index, we could just use
another variable in the KeyEvent structure that correctly points to the
character index.

This change is mostly relevant to the KeyboardMapper application, and
also to the WindowServer code, as both handle KeyEvents and need to
use the character mapping index in various situations.
2023-12-29 16:40:59 +01:00
Lucas CHOLLET 97ded2dc61 FileManager: Conditionally display the "ICC profile:" line
If the "ICC Profile" group is shown, no need to include the related line
in the "Image" group.
2023-12-29 07:57:12 +00:00
Mr.UNIX 44d623d588 CrashReporter: Port CrashReporter to GML Compiler 2023-12-27 15:29:50 +01:00
tetektoza 2751f32a18 HexEditor: Move drawing cursor under a lambda and reuse it
This is a cleanup patch dones for paint event for HexEditor, moving
repeated chunks of code under a common lambda.
2023-12-27 09:22:09 +01:00
tetektoza 017dea2993 HexEditor: Don't initialize background/text colors twice
This is a cleanup patch, moves a chunk of repeated code to one place
instead of assigning variables with the same values twice in two
different places of code.
2023-12-27 09:22:09 +01:00
tetektoza bd1d384cf6 HexEditor: Remove moving cursor outside bounds if selecting with mouse
Currently if users select last bytes in HexEditor with mouse in either
Hex or Text mode, they will be able to move cursor on the byte outside
bounds. If then they try to write something in either of those modes,
app will crash.

This patch moves the recently added "replace" cursor to always be on the
last byte of the selection instead of being on the byte after the last
selected byte.
2023-12-27 09:22:09 +01:00
tetektoza c4c9971ed0 HexEditor: Change cursor type from caret to black box
This patch changes cursor type from caret to black box for both Hex and
Text modes, because right now the way how blinking caret looks like is
more closer to "insert" mode in similar editors, whereas the real
behavior of this cursor is more of a "replace" mode seen in similar
editors like GHex.
2023-12-27 09:22:09 +01:00
tetektoza 1ea675a9ec HexEditor: Remove blinking of the cursor 2023-12-27 09:22:09 +01:00
Mr.UNIX 467faee1b8 Calendar: Add a link to the Manual in Help Menu 2023-12-26 18:37:35 +01:00
Timothy Flynn bacf3cede4 Ladybird+BrowserSettings: Load the NTP/home resource files with LibWeb 2023-12-24 14:09:23 +01:00
Shannon Booth e2e7c4d574 Everywhere: Use to_number<T> instead of to_{int,uint,float,double}
In a bunch of cases, this actually ends up simplifying the code as
to_number will handle something such as:

```
Optional<I> opt;
if constexpr (IsSigned<I>)
    opt = view.to_int<I>();
else
    opt = view.to_uint<I>();
```

For us.

The main goal here however is to have a single generic number conversion
API between all of the String classes.
2023-12-23 20:41:07 +01:00
Ali Mohammad Pur 5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Torstennator b61e4e7cd9 PixelPaint: Repaint histogram data when the widget gets resized
This patch enables the histogram to redraw itself when it gets resized
without calculating the data again through the image.
2023-12-14 09:07:20 -07:00
Torstennator c85c61571c PixelPaint: Make use of DynamicWidgetContainer
This patch adds the new DynamicWidgetContainer for the right panel
elements. This allows the user to collapse, expand or even detach
widgets to a separate window. The collapsed or expanded state is
persisted so that they are restored after application startup.
With this change it is possible to shrink the size of widgets to a
minimum in order to give more space to other currently important
widgets.
2023-12-14 09:07:20 -07:00
Torstennator c74e2d04d1 PixelPaint: Fix crash on mouse moves
This pr fixes a problem where the application would crash if the mouse
was moved while the editor was still loading the image. With this
change tool related mouse move events are discarded as long as there is
no active tool.
2023-12-14 09:04:31 -07:00
Torstennator d462d6280a PixelPaint: Fix initial tool selection
This changes how the initial tool is beeing set on application startup.
With this change the initial tool is set the same way as when the tool
is changed via the frontend. Thus it also updates the tool properties
window which wasn't done before leaving the properties empty as long
the tool was changed for the first time.
2023-12-14 09:04:31 -07:00
Timothy Flynn 451df70275 Ladybird+LibWebView: Ensure existing Inspector widgets inspect the page
If the Inspector widget already exists, be sure to inspect the page when
it is re-opened. However, this should be a no-op if the page was already
inspected (as any existing Inspector will be reset if a new page load
began).

Note this is not an issue in the AppKit chrome.
2023-12-10 16:45:08 +01:00
Kyle Pereira 8191f2b47a LibPDF: Add parameter for background color of render 2023-12-10 16:44:24 +01:00
Bastiaan van der Plaat 466153e680 Ladybird+LibWeb: Add basic select element support 2023-12-09 22:06:20 +01:00
tetektoza 8118ea764f NetworkSettings: Port NetworkSettings to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza 1e11116d65 VideoPlayer: Port VideoPlayer to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza e26548989a GamesSettings: Port GamesSettings to GML compilation
Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
2023-12-08 01:06:09 +01:00
tetektoza 935aaab757 HexEditor: Port HexEditor to GML compilation 2023-12-08 01:06:09 +01:00
tetektoza 9deaa74ad6 LibGUI: Split HorizontalSlider to separate header
This patch splits HorizontalSlider to separate header so it can be used
as a component in .gml files with new GML compiler.
2023-12-08 01:06:09 +01:00
Timothy Flynn 7e974f530d Ladybird+LibWebView: Add an Inspector action to clone a DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn d5d6ff8bf1 Ladybird+LibWebView: Add an Inspector action to insert a child DOM node 2023-12-07 23:16:34 +01:00
Timothy Flynn 71fdf0860e Ladybird+LibWebView: Add an Inspector action to screenshot a DOM node 2023-12-07 10:53:12 +01:00
Timothy Flynn e3df035c5d Ladybird+LibWebView: Add an Inspector action to copy a node's HTML/text 2023-12-07 10:53:12 +01:00
Timothy Flynn 51a0673b5c Ladybird+LibWebView: Add an Inspector action to copy an attribute value 2023-12-07 10:53:12 +01:00
Timothy Flynn 8162dc5ee6 LibWeb+LibWebView+WebContent: Separate tag/attribute in Inspector menu
It was a bit short-sighted to combine the tag and attribute names into
one string when the Inspector requests a context menu. We will want both
values for some context menu actions. Send both names, as well as the
attribute value, when requesting the context menu.
2023-12-07 10:53:12 +01:00
Timothy Flynn 5006330bc6 Browser: Add an Inspector context menu to edit the DOM 2023-12-06 13:04:50 +01:00
Sam Atkins 53f9be4ea8 Browser: Implement "Copy Email/Phone" menu item for links 2023-12-05 11:36:22 -05:00
Sam Atkins 8d987aa9d6 Browser: Make "Copy URL" action's shortcut more consistent
"Copy &URL" matches what we do in LadybirdQt, and "Copy Image &URL".
2023-12-05 11:36:22 -05:00
Sam Atkins db9a507f7f TextEditor: Give the --preview-mode argument a short version 2023-12-05 09:20:32 -05:00
Timothy Flynn 05c8d5ba57 Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to
Ladybird, but are scattered across a couple of subfolders in Base. This
moves them all to Base/res/ladybird.
2023-12-04 19:46:35 -05:00
Andreas Kling 8b7d27b349 LibJS+LibWeb: More bringing module loading closer to spec
In particular, this patch removes three host hooks on JS::VM in favor
of the new JS-side module loading stuff.
2023-12-03 20:46:55 +01:00
Timothy Flynn 582f19ba24 Ladybird: Allow opening the Inspector with both ctrl+shift+I and F12
Ladybird on Serenity currently only uses F12, and on other platforms
only uses ctrl+shift+I. Most browsers support both hotkeys, so let's do
the same for consistency.

Note that the AppKit chrome cannot support both shortcuts. macOS does
not allow setting multiple "key equivalent" strings on an action. There
are some questionable hacks we could do to support this eventually, but
for now, just ctrl+shift+I is supported on macOS.
2023-12-02 22:54:06 +01:00
Timothy Flynn b385a44f6f Browser: Remove the standalone JavaScript console 2023-12-02 10:34:22 +01:00
Timothy Flynn 0037fdaf11 Browser: Port the Inspector to the WebView property tables 2023-11-29 13:56:35 +01:00
Andreas Kling 3dc5f467a8 LibJS: Always allocate ExecutionContext objects on the malloc heap
Instead of allocating these in a mixture of ways, we now always put
them on the malloc heap, and keep an intrusive linked list of them
that we can iterate for GC marking purposes.
2023-11-29 09:48:18 +01:00
Shannon Booth d1ed04a6cb FontEditor: Use String.to_uppercase
Remove the last user of Unicode::to_unicode_uppercase_full
2023-11-28 17:15:27 -05:00
Dan Klishch 80d1c93edf AK+Applications: Return value from JsonObject::get_double more often
Previously, we were returning an empty optional if key contained a
numerical value which was not stored as double. Stop doing that and
rename the method to signify the change in the behavior.

Apparently, this fixes bug in an InspectorWidget in Ladybird on
Serenity: it showed 0 for element's boxes with integer sizes.
2023-11-25 11:02:17 +01:00
Timothy Flynn c03b69e664 LibWebView+Ladybird: Remove now-unused WebView TreeModel
This was used to provided base functionality for model-based chromes for
viewing the DOM and accessibility trees. All chromes now use the WebView
inspector model for those trees, thus this class is unused.
2023-11-24 08:37:19 +01:00
Timothy Flynn 39e32e80cd Browser: Port the Inspector to the WebView InspectorClient 2023-11-24 08:37:19 +01:00
Timothy Flynn 30e96749de LibWebView+WebContent: Remove unused did_get_dom_node_properties IPC
This is never invoked. The functionality it provides is implemented by
the return value of the `inspect_dom_node` IPC.
2023-11-24 08:37:19 +01:00
Lachlan Jowett 4f5824cbd0 DisplaySettings: Desktop crash when non-image file type is used
If the user selects an non-image file
as their background, then at next
startup the desktop crashes.
2023-11-18 11:21:32 +00:00
sSt3lla 6b72fc0924 Calculator: Convert DeprecatedString to String 2023-11-17 17:17:00 +00:00
Kemal Zebari 6b5a0100d9 Browser: Move BookmarksBarWidget::PerformEditOn to anon namespace
Since none of `BookmarksBarWidget`'s methods use this enum class any
longer, let's just move it to the anonymous namespace so that
`BookmarkEditor` can still make use of it.
2023-11-14 15:38:09 -07:00
Timothy Flynn 9421ffd4ec Browser: Implement pasting Web data to the clipboard 2023-11-11 08:54:37 +01:00
Sönke Holz 6824d2a788 Userland+Tests: Add initial riscv64 support 2023-11-10 10:30:08 -07:00
Shane Murphy d2fbc15f5d Terminal: Fix zoom when font size is missing
If Terminal was configured with a typeface that does not have a font
for any given size, the zoom in and out button in the menu bar would
not work because font lookup was exact.

Use Font::AllowInexactMatch::Larger when zooming in and
Font::AllowInexactMatch::Smaller when zooming out to allow finding the
closest font size in the requested direction.
2023-11-09 16:09:18 +01:00
Tim Schumacher a2f60911fe AK: Rename GenericTraits to DefaultTraits
This feels like a more fitting name for something that provides the
default values for Traits.
2023-11-09 10:05:51 -05:00
Andreas Kling b1b2ca1485 LibJS: Add basic monomorphic caching for PutById property access
This patch makes it possible for JS::Object::internal_set() to populate
a CacheablePropertyMetadata, and uses this to implement a basic
monomorphic cache for the most common form of property write access.
2023-11-09 16:02:14 +01:00
Strawby df6668ff5b Calculator: Add Manual link to the help-context-menu 2023-11-08 16:26:23 +00:00
Strawby 056070ff85 3DFileViewer: Add Manual link to the help-context-menu 2023-11-08 16:26:23 +00:00
Tim Ledbetter e510d81567 Assistant: Prioritize results which exactly match a query 2023-11-08 09:52:24 +01:00
Sam Atkins 39579436c1 GamesSettings: Make chess preview widget resilient to missing images
Previously we would give up on loading the piece images if one fails.
That was awkward because 2 out of 3 places where `set_piece_set_name()`
is called can't propagate errors, so we'd just crash.

Instead, let's skip any images that fail to load, and then when painting
the preview, skip any missing bitmaps and show a warning message that
some are missing.
2023-11-07 19:44:11 +01:00
Sam Atkins 4f99f1750e GamesSettings: Pass a String to ChessGamePreview::set_piece_set_name() 2023-11-07 19:44:11 +01:00
Timothy Flynn 818471b7a7 BrowserSettings+Ladybird: Convert home / new tab page to resource URIs 2023-11-06 09:39:59 +01:00
Timothy Flynn 30fac0abb9 Browser: Convert the inspector widget to the WebView model class
This creates a LibGUI-specific wrapper around the WebView model classes
and uses it for the inspector widget tree / table view models.
2023-11-05 09:11:23 +01:00
Timothy Flynn 0aa375441a Browser: Mark the DOM tree as loaded before selecting any DOM node
The first thing that `set_selection` does is return early if the DOM-
loaded flag is false. Set it to true so it can actually do something.
This fixes inspecting a DOM node from the context menu.
2023-11-05 09:11:23 +01:00
Simon Wanner 93908fcbcb LibJS+Embedders: Unify stack trace format for uncaught errors
Previously these handlers duplicated code and used formats that
were different from the one Error.prototype.stack uses.

Now they use the same Error::stack_string function, which accepts
a new parameter for compacting stack traces with repeating frames.
2023-11-02 07:37:41 +01:00
Timothy Flynn 99216b2a87 ClockSettings: Use a Vector as the time zone model's container type
The time zones were stored as a static Span until commit 0bc401a1d6, and
are now stored in a Vector. By continuing to tell the ItemListModel that
the container is a Span, we create a temporary Span in its constructor,
which the model tries to hold a constant reference to. Use the default
Vector container type now instead to prevent creating such temporaries.
2023-10-31 15:21:34 +01:00
Andrew Kaster 1567332e34 Userland+Tests: Remove uses of direct file loading for BitmapFont
Route them through Core::Resource APIs instead.
2023-10-29 13:12:28 -06:00
Andrew Kaster d8ab9ed87c LibGfx+Userland: Remove dependency on GUI::TabWidget from StylePainter
Move TabPosition into its own file, and using it into the global
namespace the same way we do for Gfx::Orientation. This unbreaks the gn
build, and out of tree builds.
2023-10-27 16:51:03 -06:00
Bastiaan van der Plaat 5a7f43ad38 Maps: Add favorites panel with favorite places management 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat f35791343e Maps: Use name + coordinates in search marker tooltip 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat 54ec744398 Maps: Add custom context menu actions option to MapWidget 2023-10-26 17:23:54 -06:00
Bastiaan van der Plaat f18c6eb0ea Maps: Make Maps a recommended CMake component instead of required 2023-10-26 17:23:54 -06:00
lanmonster e5c9d7ce26 Calendar: Add inputs to change event end date/time 2023-10-26 11:10:23 +02:00
lanmonster a7c3d39bab Calendar: Add end date/time to events 2023-10-26 11:10:23 +02:00
lanmonster 4984faa108 Calendar: Rename m_date_time to m_start_date_time
This is in preparation to add m_end_date_time
2023-10-26 11:10:23 +02:00
lanmonster a4fcec6815 Calendar: Rename input variables
These were named foo_combo, when in reality there more spinboxes than
comboboxes. Change to foo_input to accomodate whatever type of input
they may be.
2023-10-26 11:10:23 +02:00
lanmonster edee914093 Calendar: Update day range when the month changes
Previously it was possible to create an event on Feb 31(!)
2023-10-26 11:10:23 +02:00
lanmonster 97cc5b2da4 Calendar: Use GML for AddEventDialog 2023-10-26 11:10:23 +02:00
Timothy Flynn ae6e2e682e Browser: Add a context menu item to search for the selected text 2023-10-24 07:28:30 +02:00
Timothy Flynn 00826b2512 BrowserSettings: Use index column when casting to a search engine field
Regressed in e8d921820a.

I must've run an old version of the Serenity image when I tested this
after a fixup.
2023-10-23 13:36:48 -04:00
Timothy Flynn e8d921820a Browser+BrowserSettings: Migrate to LibWebView for search engines 2023-10-23 12:12:36 -04:00
Bastiaan van der Plaat 5870a1a9a1 AK: Remove rarely used ExtraMathConstants.h 2023-10-23 12:04:51 +01:00
Timothy Flynn 192aa0838a Browser: Use LibWebView to decide what parts of a URL to highlight 2023-10-20 07:18:54 +02:00
Timothy Flynn 55092dd164 LibGUI+Browser: Move GUI::UrlBox to the Browser application
Browser is the only user of this component. Move it to allow making use
of LibWebView for URL highlighting.
2023-10-20 07:18:54 +02:00
Jelle Raaijmakers 126adfc392 3DFileViewer: Set timer to 15ms instead of 20ms
This approaches 60FPS and feels a bit smoother.
2023-10-15 12:14:07 +02:00
Jelle Raaijmakers 77c16d2ae7 3DFileViewer: Show correct framerate
We were confusing the time spent rendering with the time spent rendering
_and_ waiting for the next frame, which is important since we render
frames on a timer.
2023-10-15 12:14:07 +02:00
Cubic Love f2b7224d93 GamesSettings+LibCards: Make 'Red' the default card back
The red back is a more suitable default as it's a traditional vanilla
design and red is one of Serenity's brand colors.
2023-10-15 07:25:20 +02:00
Timothy Flynn d2c7e1ea7d Browser: Sanitize user-provided URLs with LibWebView 2023-10-13 13:37:11 -04:00
Tim Ledbetter 54a28afc13 LibIMAP: Stop parsing immediately on error
This makes the parser more resilient to invalid IMAP messages.

Usages of `Optional` have also been removed where the empty case is
equivalent to an empty object.
2023-10-13 11:12:18 -06:00
Ali Mohammad Pur aeee98b3a1 AK+Everywhere: Remove the null state of DeprecatedString
This commit removes DeprecatedString's "null" state, and replaces all
its users with one of the following:
- A normal, empty DeprecatedString
- Optional<DeprecatedString>

Note that null states of DeprecatedFlyString/StringView/etc are *not*
affected by this commit. However, DeprecatedString::empty() is now
considered equal to a null StringView.
2023-10-13 18:33:21 +03:30
Sam Atkins ff8969bd5f GamesSettings: Center cards vertically after recent size change 2023-10-11 10:56:43 +01:00
Sam Atkins eff25f9116 LibCards: Stop calling the card back image a "background" image
It's not a background, past me!
2023-10-11 10:56:43 +01:00
Sam Atkins d8e8b300c8 GamesSettings+LibCards: Add setting for card-front image sets 2023-10-11 10:56:43 +01:00
Sam Atkins 18dfc61280 LibGfx: Expose BitmapFont glyph data as Spans instead of raw pointers 2023-10-10 14:36:25 +02:00
Sam Atkins a1c24ef3ad LibGfx: Remove infallible BitmapFont::create() factory function
This was only used in TestFontHandling. So, let's remove it, and use
the "create" name for the fallible one.
2023-10-10 14:36:25 +02:00
Andreas Kling 65717e3b75 LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive}
These functions all have a very common case that can be dealt with a
very simple inline check, often avoiding the need to call an out-of-line
function. This patch moves the common case to inline functions in a new
ValueInlines.h header (necessary due to header dependency issues..)

8% speed-up on the entire Kraken benchmark :^)
2023-10-07 07:13:52 +02:00
Karol Kosek 03a54a519a Userland: Port remaining calls to Widget::set_tooltip_deprecated()
Replaces `set_tooltip_deprecated(string);` with
`set_tooltip(MUST(String::from_deprecated_string(string)));`
purely to get rid of the deprecated function in the following commit.
2023-10-06 08:20:11 +02:00
Karol Kosek ed3e729d4e Userland: Use nondeprecated set_tooltip for static and formatted strings 2023-10-06 08:20:11 +02:00
Karol Kosek 46a97844c7 Applications: Stop calling set_tooltip_deprecated when we do have String 2023-10-06 08:20:11 +02:00
Karol Kosek 9c923f20f4 Spreadsheet: Make cell metadata hint return String 2023-10-06 08:20:11 +02:00
Karol Kosek 4836d33ae4 Assistant: Port tooltips to String 2023-10-06 08:20:11 +02:00
Karol Kosek 3944c39b3a LibGUI: Port tooltip in Breadcrumbbar to String 2023-10-06 08:20:11 +02:00
Karol Kosek a3ddba4191 Userland: Port GUI::Application::show_tooltip() to String
This most importantly gets rid of a chain of "String to DeprecatedString
to String" transformations when setting a tooltip from GUI::Widget's
set_tooltip function.
2023-10-06 08:20:11 +02:00
Gurkirat Singh f51e8e785c Browser: Treat absolute path as local file 2023-10-06 08:12:41 +02:00
Timothy Flynn 0bc401a1d6 LibTimeZone+Userland: Include Link entries when returning all time zones
We currently only return primary time zones, i.e. time zones that are
not a Link. LibJS will require knowledge of Link entries, and whether
each entry is or is not a Link.
2023-10-05 17:01:02 +02:00
Jelle Raaijmakers 3c02e3ba09 Maps: Pad grid size to prevent missing tiles
Previously, we would divide the widget width and height by the tile size
and round up, which did not result in enough tiles to cover the entire
widget. Although this calculation is correct if you starting drawing
tiles in the top left corner, we have an additional offset to account
for.

Now, we take the number of tiles that fit in the widget completely and
pad it with 2 tiles to account for the partial left/right and top/bottom
sides. An additional tile is added to account for the iterator
translating by width / 2, which rounds down again.

The resulting tile rects are always intersected with the widget
dimensions, so even if we're generating more tile coordinates than
strictly necessary, we're not performing the actual download or draw
operations.
2023-10-03 20:25:09 +02:00
Jelle Raaijmakers eb4dd7f896 Maps: Fix spiraling tile iterator end
The `operator++` of the spiraling tile iterator was repeating the first
coordinates (`0, 0`) instead of moving to the next tile on the first
iteration. Swapping the move and check ensures we get to the end of the
iterator, fixing gray tiles that would sometimes pop up in the lower
right.

Since we never return from `operator++` without setting a valid
position, we can drop `current_x` and `current_y` and just use the
`Gfx::Point<T>` directly.
2023-10-03 20:25:09 +02:00
Jelle Raaijmakers 092bb76cd6 Maps: Use bilinear blending for downscaled tiles
Since we divide the width and height of the downscaled tiles by 2,
bilinear blending is identical to box sampling and should be preferred
since it's the simpler one of the two algorithms.
2023-10-03 20:25:09 +02:00
Tim Ledbetter eaa6304aab Userland: Return empty if ImageDecoder client receives an invalid frame
This simplifies error checking for all the users of the ImageDecoder
client.
2023-10-03 08:33:53 +02:00
Kemal Zebari 18124a5611 SpaceAnalyzer: Port to GML compiler 2023-10-02 21:28:40 +02:00
Tim Ledbetter c087ba24b9 Assistant: Avoid an unnecessary copy of the results list 2023-10-01 14:34:28 +02:00
Tim Ledbetter 55f4d468ad Assistant: Remember currently selected result when updating results
This fixes an issue where the selected result index would be reset to
0 when the file cache finished building and the results list updated.
2023-10-01 14:34:28 +02:00
kleines Filmröllchen 614ff9c46e Maps: Load tiles starting from center
The information the user is most interested in is usually in the center,
so we should start loading tiles from the center and move outwards.
Since tiles are loaded in draw order, simply drawing them in this order
achieves the desired effect. The current center-outwards loading
algorithm is a basic spiral algorithm, but others may be evaluated
later.
2023-09-30 11:11:05 +02:00
Karol Kosek e75d694974 Userland: Compare event MIME type list with a StringView
The following commit will port MIME types to String. Traits<String>
- used in Vector::contains_slow - can't compare String type with char*,
so we need to use StringView instead.
2023-09-29 14:40:21 +01:00
Karol Kosek 2f35348104 Userland: Store MIME keys as String in Core::MimeData 2023-09-29 14:40:21 +01:00
Karol Kosek 4f638d3af2 Userland: Take StringView in MimeData::data() and has_{format,text,urls} 2023-09-29 14:40:21 +01:00
circl 3e1a154440 Browser: Add support for color pickers 2023-09-27 12:16:41 +01:00
kleines Filmröllchen 062e0db46c LibCore: Make MappedFile OwnPtr-based
Since it will become a stream in a little bit, it should behave like all
non-trivial stream classes, who are not primarily intended to have
shared ownership to make closing behavior more predictable. Across all
uses of MappedFile, there is only one use case of shared mapped files in
LibVideo, which now uses the thin SharedMappedFile wrapper.
2023-09-27 03:22:56 +02:00
Cubic Love 4c64c0b61e Base+Maps: Add manpage for Maps
Also, list Maps in Applications.md and add a link to the manpage in
Map's Help menu.
2023-09-25 16:20:20 +01:00
Tim Ledbetter f34b1c7a7e PixelPaint: Make tool properties widget construction non-fallible
`Tool::get_properties_widget()` now also returns a NNRP to a widget
rather than a raw pointer.
2023-09-25 10:58:31 +02:00
Tim Ledbetter 5df88dab07 FileManager: Make PropertiesWindow::make_button() non-fallible 2023-09-25 10:58:31 +02:00
Tim Ledbetter b4e134cb52 Userland: Use non-fallible EventReceiver::add() where possible 2023-09-25 10:58:31 +02:00
Bastiaan van der Plaat deb7ecfbe9 Maps: Add search panel 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat 2c2a1da306 Maps: Fix map rendering clipping issue when not full window size 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat 2bdd39f198 Maps: Add LatLngBounds struct 2023-09-24 20:05:33 -06:00
Bastiaan van der Plaat 5d37e1c220 Userland: Remember window state of productivity / editor applications 2023-09-24 20:00:00 -06:00
Tim Ledbetter 3aa49f268c Userland: Make Window::set_main_widget() non-fallible 2023-09-21 10:20:23 +02:00
Bastiaan van der Plaat aed25991e6 Maps: Add MapsSettings with multiple tile providers options 2023-09-18 12:46:41 -06:00
Bastiaan van der Plaat 264782557e Maps: Fix bug when opening attribution url by adding launch unveil 2023-09-18 12:46:41 -06:00