Commit Graph

3850 Commits

Author SHA1 Message Date
Sam Atkins
44ca55aaf8 LibFileSystemAccessClient+Userland: Return file paths as ByteStrings
Where it was straightforward to do so, I've updated the users to also
use ByteStrings for their file paths, but most of them have a temporary
String::from_byte_string() call instead.
2024-01-29 23:14:39 +00:00
Bastiaan van der Plaat
350affe406 LibGUI+WindowServer: Add menu minimum width support 2024-01-29 05:29:41 -07:00
kleines Filmröllchen
adc845e0cb Userland: Port to automatic GML initializer where possible 2024-01-29 05:21:48 -07:00
Timothy Flynn
dcd9962d7b Browser: Remove some needless indirection from Cookie-related IPCs
We don't need to forward Cookie-related IPCs from the WebView through
the Tab to the BrowserWindow. We can skip the Tab like we do in other
chromes.

This is primarily to reduce overhead when changing Cookie IPCs in future
patches.
2024-01-26 20:22:39 +01:00
Sam Atkins
388856dc7e AK+Userland: Return String from human_readable_size() functions 2024-01-25 09:07:32 +01:00
Sam Atkins
7e8cfb60eb AK+Userland: Return String from human_readable_[digital_]time() 2024-01-25 09:07:32 +01:00
Sam Atkins
9657f4cabb LibGUI+Userland: Take ByteString in set_most_recently_open_file() 2024-01-24 11:07:03 +00:00
Mr.UNIX
69ffdd5738 Welcome: Port to GML Compiler 2024-01-23 21:14:12 +01:00
Dan Klishch
b5f1a48a7c AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
Nico Weber
475cef8afd PDFViewer: Remove an unneeded indirection
No behavior change.
2024-01-21 09:32:22 -05:00
Nico Weber
d9267a388d PDFViewer: Add Debug menu entries for disabling clipping 2024-01-21 09:32:22 -05:00
Sam Atkins
3df3a85235 LibGfx+Userland: Move FontWeight enum into its own file
FontDatabase.h with its includes add up to quite a lot of code. In the
next commit, compiled GML files are going to need to access the
FontWeight enum, so let's allow them to do that without pulling in lots
of other things.

Also, change users to include FontWeight.h instead of FontDatabase.h
where appropriate.
2024-01-21 09:32:10 -05:00
Tim Ledbetter
d06f1cbb9c DisplaySettings: Disable custom color scheme combobox by default
Previously, the GML property declaration that does this was being
ignored, as the value was in quotes.
2024-01-21 08:38:18 -05:00
Tim Ledbetter
fd8e8e7f31 DisplaySettings: Remove redundant text_alignment property from GML
Previously, this was causing an error to be shown on the debug console,
as `CenterMiddle` is not a valid value for this property.
2024-01-21 08:38:18 -05:00
Nico Weber
176e9db6cd PDFViewer: Move debug actions from toolbar into a menu
This makes it easier to add more entries. Also, debug toggles
don't need to be quite as visible as they were on the toolbar :^)
2024-01-21 08:22:27 -05:00
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