Commit graph

40629 commits

Author SHA1 Message Date
Timothy Slater e43e412fc8 LibGUI: Improve SpinBox usability
Previously the value of the SpinBox is re-evaluated after every change
to the TextBox control. This leads to very unintuitive behavior such as
the user deleting the contents of the box and it having no
visible effect. This happens because the TextBox no longer has a valid
number and so gets reset to the current m_value of the SpinBox.

By defering the update of to the SpinBox value until focus leaves the
control we provide a much more intuitive experience with the text box.
We do still validate when a user types something that it parses to an
int. If it does not we delete the most recent character. This in effect
prevents non-numeric numbers from being entered.

Upon losing focus the value will be checked. If empty we set the SpinBox
value to the minimum allowed value.
2022-09-01 17:47:49 +01:00
Joel Hansen 1183bc5184 Base: Add new emoji
⚔️ - U+2694 Crossed Swords
🧪 - U+1F9EA Test Tube
⚕️ - U+2695 Medical Symbol
🍀 - U+1F340 Four Leaf Clover
2022-09-01 15:21:49 +01:00
Karol Kosek 1282ef5d9e Base: Remove an upscaled version of a Hidden cursor
It was the same as the normal Hidden cursor (a transparent image).
2022-09-01 14:27:07 +01:00
Karol Kosek 5478409025 LibGfx: Fallback to a default scaled bitmap if the upscaled one failed
This makes cursors in a 2x Display Scale without a special upscaled
version (such as a Hand cursor) display the 1x version instead.
2022-09-01 14:27:07 +01:00
NoahR02 406dff16d1 HackStudio: Fix cpp-gui template 2022-09-01 14:25:31 +01:00
Timothy Slater f2da577e77 PixelPaint: Change repeated code into a loop for Wand Select Tool 2022-08-31 18:19:46 +01:00
Karol Kosek a0ef00cab2 LibGUI: Don't accept drag events in AbstractView if it's not editable
With a new DragCopy cursor icon being used on accepted events, this
caused a 'false assumption' that everything can be dropped into
AbstractView.

This will now only happen if the View is editable, which still isn't
perfect, but at least the Settings app will no longer change cursors.
Also note that we won't get "drag move" events as the comment below
says, which disables automatic scrolling when dragging an element.
2022-08-31 17:29:44 +01:00
Karol Kosek 1d9ec8bd56 LibVT: Accept supported drag enter events 2022-08-31 17:29:44 +01:00
Karol Kosek f1aa03b779 WindowServer: Place drag and drop overlay at the cursor position
... instead of in the center of the cursor bitmap.

It doesn't make much of a difference, as the default cursor hotspot is
center. But since now we switch between a normal Drag cursor and
DragCopy one that has set hotspot, this caused the overlay to shake.
2022-08-31 17:29:44 +01:00
Karol Kosek d4aff36875 WindowServer: Include window frames when sending drag events
Previously, the cursor would use a default cursor on window frames such
as the title bar and menu bar, which was not quite correct as drop
events were still handled there.
2022-08-31 17:29:44 +01:00
Karol Kosek 2e244fc85b WindowServer+LibGUI: Change cursor icon if DragEnter event was accepted 2022-08-31 17:29:44 +01:00
Karol Kosek e5674d9666 Base+WindowServer+LibGfx: Add new DragCopy Cursor
The purpose of this cursor is to indicate if a current dragged object
(file, Spreadsheet cell) can be dropped onto a widget.
2022-08-31 17:29:44 +01:00
Karol Kosek 06102ff9af Base: Add 2x version of Drag cursor in Dark theme
Failing to load 2x cursor resulted in using the default arrow cursor
instead of scaling the 1x one.
2022-08-31 17:29:44 +01:00
Timothy Slater 25ac38cac1 PixelPaint: Make erase_selection work for non-rectangular selections
Layer::erase_selection used to erase the entire bounding box of the
selection. With the add/subtract merge modes for the selection tool it
is possible to create selections which are not rectangular. This leads
to deleting pixels that were not selected.

This change adjusts the erase behavior to walk the selection rect and
check if a pixel is selected or not before deleting.
2022-08-31 16:59:22 +01:00
Jelle Raaijmakers a373542f4c Profiler: Display correctly rounded percentages as '#.##%' 2022-08-31 16:57:40 +01:00
Timothy Slater fcf86b07a5 PixelPaint: Add Wand Select Tool
Wand Selection tool uses similar logic to the Bucket Tool. Flood filling
and threshold calculations to determine the affected area just in this
case we do not set the pixels of the selected area, instead we use
those pixels to alter the selection mask.

In the future we can probably abstract out the shared flood logic so
both tools can share the code.
2022-08-31 16:30:23 +02:00
Tim Schumacher 5e11a512d6 Kernel: Buffer an entire region when generating coredumps
This allows us to unlock the region tree lock early, to avoid keeping
the lock while we are doing IO.
2022-08-31 16:28:47 +02:00
Tim Schumacher 32a03cffeb Kernel: Work using copies of specific region data during a coredump
This limits our interaction with the "real" region tree (and therefore
its lock) to the time where we actually read from the user address
space.
2022-08-31 16:28:47 +02:00
Timothy Slater 066c5acee1 PixelPaint: Change BucketTool flood fill algorithm
This resolves some cases where the existing filling algorithm could get
stuck in a recursion loop and evenutally overflow the stack.
2022-08-31 16:26:09 +02:00
Timothy Slater 0506f4eef8 PixelPaint: Account for alpha in color distance calculation
This fixes an issue where BucketTool would consider "black"
and "transparent" the same color.
2022-08-31 16:26:09 +02:00
Hendiadyoin1 21ae882cfd LibJS: Implement SuperCall for the Bytecode-VM 2022-08-31 15:22:36 +01:00
Hendiadyoin1 25be67299e LibJS: Use builder.join in to_string_impl()s where applicable 2022-08-31 15:22:36 +01:00
Skye Sprung 4370e8f80a HackStudio: Warn of unsaved changes before making a new project
Before, the warning dialog would be opened after the NewProjectDialog,
leading to focus-fighting by the two windows. This fixes that and makes
the action more consistent with the standard serenity way of handling
unsaved changes by asking before the NewProjectDialog is brought up.
The way this is achieved avoids having to rewrite open_project as well.
2022-08-31 15:21:03 +01:00
Skye Sprung a7b7003376 HackStudio: Fix crash when opening or creating with open empty file
This commit fixes a crash that would occur due to an unnamed file being
automatically saved via EditorWrapper::save(). Now, we throw up a
FilePicker::get_save_filepath.
2022-08-31 15:21:03 +01:00
Jelle Raaijmakers fa2ece1183 Ports: Tidy up Quake2 platform patch
There were a lot of unrelated formatting changes in the patch, which is
now shrunk by roughly 60%.
2022-08-31 14:25:15 +01:00
Jelle Raaijmakers b057a2d82b Ports: Fix Quake2 dynamic loading issues
Our DynamicLoader would choke on a couple of missing symbols. I'm not
certain how this could have worked before, but there we go. :^)
2022-08-31 14:25:15 +01:00
Jelle Raaijmakers 45b9fc2bad Ports: Move Quake2 port in-tree
All commits have been combined into one platform support patch.
2022-08-31 14:25:15 +01:00
Jelle Raaijmakers 14ece2ac90 Ports: Support "restarts" in SDL2
SDL2 applications are prone to reinitializing the SDL components when,
for example, changing the display resolution. This would lead to
crashes since we were doing things in the wrong order.

* We now decouple `GLContext` from `SDL_Window` a bit more, allowing
  the window to be destroyed before the GLContext.
* Do not quit the `GUI::Application`, let our event loop handle exiting

These changes allow changing the display resolution in the Quake3 port.
2022-08-31 12:42:55 +01:00
Crax97 7d544344ca PixelPaint: Add point_position_to_preferred_cell to RectangleSelectTool
Specializing point_position_to_preferred_cell for the
RectangleSelectTool as it selects a new cells with a rounding
behavior instead of a flooring behavior
2022-08-31 12:20:55 +02:00
Crax97 3d756e89c8 PixelPaint: Ask the current tool for the preferred pixel location
When handling mouse events, different tools may want to interact
with a different pixel in the image for the same input position.
2022-08-31 12:20:55 +02:00
Crax97 c9fb380490 PixelPaint: Execute mousemove_event early return check before
This is done to allow querying the current active tool inside the
event_with_pan_and_scale_applied and event_adjusted_for_layer
functions without risking a null pointer dereference
2022-08-31 12:20:55 +02:00
Crax97 3037f5b183 PixelPaint: Add point_position_to_preferred_cell method to Tool
This method is used to point a position at the preferred pixel of
the image. Certain tools may want to specify a different preferred
pixel for the same input position.
2022-08-31 12:20:55 +02:00
Crax97 059a9c71a0 LibGfx: Add Point::to_ceiled method for getting a ceiled Point 2022-08-31 12:20:55 +02:00
Adam Jakubek aa466723eb FileManager: Navigate to parent dir when current location is removed
When the location currently displayed in FileManager is removed, find
the nearest existing parent path and open it in the window.
Without the fix, the FileManager window remained in the deleted
directory.

Changing the path in 'DirectoryView' object will automatically update
other components in the FileManager (breadcrumb bar, directory tree
view).
2022-08-31 10:32:41 +01:00
Adam Jakubek f7e6593910 LibGUI: Fix assertion when handling removal of FileSystemModel's root
This commit fixes FileSystemModel behaviour when the root path of the
model has been deleted.
In this case, the model index resolved for the root path is invalid and
passing it to 'begin_delete_rows' would trigger assertion failure.

Instead of deleting all children rows one by one, we simply invalidate
the whole model.
2022-08-31 10:32:41 +01:00
Xexxa 265b035dd5 Base: Add more emoji 🌾 🌿 🍸 🏠 🏡 🥏 🏑 🏒 🏓 🕹️ 🎧
🌾 - U+1F33E SHEAF OF RICE
🌿 - U+1F33F HERB
🍸 - U+1F378 COCKTAIL GLASS
🏠 - U+1F3E0 HOUSE
🏡 - U+1F3E1 HOUSE WITH GARDEN
🥏 - U+1F94F FLYING DISC
🏑 - U+1F3D1 FIELD HOCKEY
🏒 - U+1F3D2 ICE HOCKEY
🏓 - U+1F3D3 PING PONG
🕹️ - U+1F579 JOYSTICK
🎧 - U+1F3A7 HEADPHONE
2022-08-31 09:53:11 +01:00
electrikmilk 70d56acb86 Base: Add 24 new emojis
💢 - U+1F4A2 ANGER SYMBOL
💬 - U+1F4AC SPEECH BALLOON
🦴 - U+1F9B4 BONE
🥥 - U+1F965 COCONUT
🥞 - U+1F95E PANCAKES
🍙 - U+1F359 RICE BALL
🎂 - U+1F382 BIRTHDAY CAKE
🥤 - U+1F964 CUP WITH STRAW
🏛 - U+1F3DB CLASSICAL BUILDING
♨️ - U+2668 U+FE0F HOT SPRINGS
🎃 - U+1F383 JACK-O-LANTERN
🀄 - U+1F004 MAHJONG RED DRAGON
🔋 - U+1F50B BATTERY
🔌 - U+1F50C ELECTRIC PLUG
🖥️ - U+1F5A5 U+FE0F DESKTOP COMPUTER
🖥 - U+1F5A5 DESKTOP COMPUTER
🖱 - U+1F5B1 COMPUTER MOUSE
📋 - U+1F4CB CLIPBOARD
🔒 - U+1F512 LOCKED
🔓 - U+1F513 UNLOCKED
🔞 - U+1F51E NO ONE UNDER EIGHTEEN
♀️ - U+2640 FEMALE SIGN
♂️ - U+2642 MALE SIGN
🟰 - U+1F7F0 HEAVY EQUALS SIGN
♾️ - U+267E INFINITY
2022-08-31 09:52:50 +01:00
Timothy Flynn c477425b9b LibJS: Create DurationFormat's ListFormat object with type and style
This is a normative change in the Intl.DurationFormat spec. See:
https://github.com/tc39/proposal-intl-duration-format/commit/1304e4b
2022-08-30 14:26:11 -04:00
Timothy Flynn 127b28c940 LibJS: Use numeric style if the previous style was numeric or 2-digit
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/3a46ee3
2022-08-30 14:26:11 -04:00
Timothy Flynn cab1cce522 LibJS: Update DurationFormat AO text to align with ECMA-402 and Temporal
These are editorial changes in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/71b291b
https://github.com/tc39/proposal-intl-duration-format/commit/d0cc6fa
https://github.com/tc39/proposal-intl-duration-format/commit/d4b35bb
2022-08-30 14:26:11 -04:00
Timothy Flynn a86b840c64 LibJS: Rename DurationFormat's DurationSign to DurationRecordSign
This is an editorial change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/f947239
2022-08-30 14:26:11 -04:00
Timothy Flynn f8c51fec1d LibJS: Align ToDurationRecord with ToTemporalDurationRecord
This is an editorial change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/527ea58
2022-08-30 14:26:11 -04:00
Timothy Flynn a28ff92106 LibJS: Mark PartitionDurationFormatPattern as infallible
This is an editorial change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/cea3b68
2022-08-30 14:26:11 -04:00
Timothy Flynn aabd06722f LibJS: Change GetDurationUnitOptions to require a string for prevStyle
This is an editoral change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/62ee645
2022-08-30 14:26:11 -04:00
Timothy Flynn 1778462d97 LibJS: Resolve FIXMEs in DurationFormat's PartitionDurationFormatPattern
These are normative changes in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/e2e18d1
https://github.com/tc39/proposal-intl-duration-format/commit/f1e8ed3
https://github.com/tc39/proposal-intl-duration-format/commit/2ed31b8
https://github.com/tc39/proposal-intl-duration-format/commit/2d51d64
https://github.com/tc39/proposal-intl-duration-format/commit/64cc5db
https://github.com/tc39/proposal-intl-duration-format/commit/a1d7876
https://github.com/tc39/proposal-intl-duration-format/commit/47a3a69
https://github.com/tc39/proposal-intl-duration-format/commit/3e9358e
https://github.com/tc39/proposal-intl-duration-format/commit/f4ecb46
https://github.com/tc39/proposal-intl-duration-format/commit/b454c8c
2022-08-30 14:26:11 -04:00
Timothy Flynn d57b92da09 LibJS: Default to "short" for DurationFormat's style option
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/b289494
2022-08-30 14:26:11 -04:00
Timothy Flynn 765d016670 LibJS: Default to 0 for DurationFormat's fractionalDigits option
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/ac7e184
2022-08-30 14:26:11 -04:00
Timothy Flynn 2fb332da7b LibJS: Update spec steps to validate DurationFormat's numberingSystem
This is a normative change in the Intl.DurationFormat proposal. See:
https://github.com/tc39/proposal-intl-duration-format/commit/63a9202
2022-08-30 14:26:11 -04:00
thankyouverycool cce9172cd4 Applications+DevTools: Remove fixed sizes from Splitters
And adjust some GML properties. Since a808cfa, splitters grow
opportunistically. Setting them to fixed sizes now quite literally
fixes them in place. Fixes immovable splitters missed in the
aforementioned commit.
2022-08-30 16:28:44 +01:00
Linus Groh 6cedb1b9d9 LibJS: Implement $262.evalScript() according to the given algorithm
test262's INTERPRETING.md specifies the exact steps for this function,
so let's shuffle some things around and add "spec" comments.

Most importantly this now returns the result of the evaluated script,
which at least one test relies on:
https://github.com/tc39/test262/blob/main/test/built-ins/Proxy/revocable/tco-fn-realm.js
2022-08-30 12:00:04 +01:00