Commit graph

1945 commits

Author SHA1 Message Date
circl eeeaf410fb WindowServer+LibGUI: Expose raw scroll wheel values to applications
This is useful, for instance, in games in which you can switch held
items using the scroll wheel. In order to implement this, they
previously would have to either add a hard-coded division by 4, or look
up your mouse settings to adjust correctly.

This commit adds an MouseEvent.wheel_raw_delta_x() and
MouseEvent.wheel_raw_delta_y().
2022-03-27 01:11:27 +01:00
Andreas Kling 80f1749196 Browser: Make the main browser window a little bit bigger by default 2022-03-26 20:49:42 +01:00
Simon Danner 1888e60015 Spreadsheet: Update Undo / Redo button state 2022-03-26 18:29:21 +00:00
kleines Filmröllchen faf7331999 SoundPlayer: Don't crash when the reported buffer is unexpected
It seems like this happens in quite some valid situations, so my
initially sensible failsafe doesn't make sense. As the buffer system is
hopefully gone soon, it won't be an issue in the future either way.
2022-03-25 18:34:30 -07:00
kleines Filmröllchen 9cca9f5204 SoundPlayer: Fix jump to slider behavior for playback slider
This was regressed at some point though I never saw it working.
Basically, while jump to slider works correctly it doesn't even get
actioned. While the user is clicking the slider it's very likely that a
buffer finishes playing and the callback for that changes the slider
value. This means that the user click just gets lost. There's some
additional weird behavior where values are lost in even more cases, so
an additional fix that is needed is to store the slider value in the
AutoSlider while we're dragging and apply it on mouse up.
2022-03-25 18:34:30 -07:00
Sahan Fernando 05f9146af8 3DFileViewer: Enable smooth shading in viewer + teapot model 2022-03-24 19:22:27 +01:00
Kenneth Myhra 4a57be824c Userland+Tests: Convert File::read_link() from String to ErrorOr<String>
This converts the return value of File::read_link() from String to
ErrorOr<String>.

The rest of the change is to support the potential of an Error being
returned and subsequent release of the value when no Error is returned.
Unfortunately at this stage none of the places affected can utililize
our TRY() macro.
2022-03-24 11:57:51 +01:00
GeekFiftyFive ff8a6d8e59 PixelPaint: Call set_modified on window
Call set_modified on window in order to reflect unsaved
changed in the titlebar's close button
2022-03-24 03:03:50 +01:00
Jelle Raaijmakers b8a53e4a17 Applications: Round layer rect before drawing outline in PixelPaint
This fixes differences in drawing the layer and image outlines.
2022-03-23 11:53:34 +01:00
Nícolas F. R. A. Prado 2c44c7fc89 KeyboardSettings: Allow changing and applying active keymap
Previously only the list of allowed keymaps could be modified and
applied to the system.

Add a new button to activate the selected keymap from the list. When
applying the changes to the system, also apply the active keymap.
2022-03-22 12:21:21 +01:00
Nícolas F. R. A. Prado a48d7d6adc KeyboardSettings: Rename m_current_applied_keymap
Rename it to m_initial_active_keymap to denote that it's the keymap that
was active when the application started up.
2022-03-22 12:21:21 +01:00
int16 3f391d80c4 SystemMonitor: Recognise wxallowed mount flag 2022-03-22 12:20:19 +01:00
Rok Povsic 5bb5967259 Browser: Append .com when pressing CTRL+Enter in the URL text editor
This is the behavior in Firefox / Chrome.
2022-03-22 12:17:48 +01:00
Jelle Raaijmakers d195972ec2 Applications: Do not crash if decoded bitmap is null
ImageViewer and PixelPaint would crash when the ImageDecoderClient
returns a frame without a bitmap. This can happen with `.ico` files
with an unsupported BPP, for example.
2022-03-22 12:14:09 +01:00
thankyouverycool b8cc18896f LibGUI+FontEditor: Add context menu for editor actions
GlyphMapWidget now reports context menu requests when secondary
clicking the map. This also adds a new Select All action and updates
the Copy Character action to work on multi-glyph selections. Glyph
navigation actions have been moved to a separate Go menu, as is
common in other apps.
2022-03-20 20:00:25 +01:00
thankyouverycool 42284a1550 FontEditor: Change flip action shortcuts to Ctrl+Shift+{Q,W}
To not interfere with the command palette.
2022-03-20 20:00:25 +01:00
thankyouverycool cdd1bc64f6 FontEditor: Set width on copy only if source glyph is present
Fixes empty glyphs copying as present in fixed-width fonts.
2022-03-20 20:00:25 +01:00
thankyouverycool 212817ea20 FontEditor: Restore selections on undo/redo actions
This makes navigating undo history a lot easier to follow.
Individual glyph alterations now reset selection size if necessary
to save space.
2022-03-20 20:00:25 +01:00
Simon Wanner dc8ac83f77 Browser: Size the content box in "Box Model" based on its text 2022-03-20 19:57:09 +01:00
Ali Mohammad Pur 5dc0855489 Spreadsheet: Use the correct top-center alignment when set to Top+Center 2022-03-20 13:20:33 +00:00
Ali Mohammad Pur 292e459901 Spreadsheet: Allow the user to format Identity cells via JS expressions
Also add some hints as to what the format field expects as it would be
very confusing otherwise.
2022-03-20 13:20:33 +00:00
Ali Mohammad Pur 8919e4b2b6 Spreadsheet: Only update the selection on primary mousedown
Otherwise we'd end up clearing the selected rect before doing anything
with it if the user right-clicks on it.
2022-03-20 13:20:33 +00:00
Ali Mohammad Pur 0d302516d5 Spreadsheet: Skip over "invalid" saved cell values
These can be generated by saving something that's not serialisable (e.g.
functions), skip over them and let the load logic reevaluate them when
needed.
2022-03-20 13:20:33 +00:00
Andreas Kling 166cd8e881 Browser: Turn on content filtering by default :^) 2022-03-20 01:01:14 +01:00
martinfalisse 11dffbd96f Spreadsheet+LibGUI: Calculate cell position given scroll position
Take into account the current scroll position when calculating the
position of cells. This way when the user scrolls either horizontally
or vertically, the calculations done to find the cell position
will be correct.
2022-03-19 09:31:29 +03:30
martinfalisse 5759b25ca8 Spreadsheet: Handle case when drag-and-drop location is out of bounds
When the drop location of a drag-and-drop operation is not valid, then
don't continue with the drop_event. For example, if the ending location
is the header row or header column, or is outside of the table, then
should not continue.
2022-03-19 09:31:29 +03:30
martinfalisse 9e54815799 Spreadsheet: Implement extend functionality
Implements ability to extend a cell's contents by clicking the bottom
right of the cell and dragging in a linear direction. For now, the
content that is extended is simply a copy of the target cell's
values.
2022-03-19 09:31:29 +03:30
martinfalisse f6ad98b1a1 Spreadsheet: Take into account cell order when copying and cutting
Since copying and cutting uses the cell values in the origin to decide
which values to paste in the destination, it is necessary to do it
in an ordered manner when the origin and destination ranges overlap.
Otherwise you may overwrite values in the origin unintentionally
before having successfully transferred them to the destination.
2022-03-19 09:31:29 +03:30
martinfalisse 2f2a705a8e Spreadsheet: Cut instead of copy when dragging a cell's items
Use cut instead of copy when dragging one or many cells' contents.
This is more intuitive as most other spreadsheet applications
handle the drag in this manner instead of as a copy operation.
2022-03-19 09:31:29 +03:30
martinfalisse 8a7d2c3336 Spreadsheet: Rename variables to better describe their function
Rename some variables relating to the drag-and-cut operations as
well as the select operation so that they are more clear.
2022-03-19 09:31:29 +03:30
martinfalisse e98d0dafa0 Spreadsheet: On cut end select same cells in target location
When finished dragging and cutting, select the cells in the
destination. E.g. if you select 5 cells and drag and paste
them in a new location, select the 5 pasted cells in the
destination.
2022-03-19 09:31:29 +03:30
martinfalisse 10bbb01ed8 Spreadsheet: Set cursor manually so that correct cells are outlined
Due to the fact that in the AbstractView, when multiple cells are
selected, and then another cell is selected within this selection,
the cursor is not updated as the user may be beginning to drag, have
to override this functionality for the Spreadsheet application.

This is because in spreadsheets when multiple cells are selected,
and then you click on one of the cells within the selection,
the selection should be cleared and the targetted cell highlighted.
2022-03-19 09:31:29 +03:30
martinfalisse 1287238430 Spreadsheet: Select the correct cell on click
Due to the margin that is given to be able to select cells for
cutting or extending, have to override the mouse click function
so that the targetted cell is chosen and not the one that may be
beneath the cursor.
2022-03-19 09:31:29 +03:30
martinfalisse 4f0a123b2f Spreadsheet: Display different cursors depending on action
Depending on the cursor location with respect to a selected cell,
display different icons pertaining to the distinct possible actions,
for example dragging and cutting, extending the cell's contents, or
doing a simple selection.
2022-03-19 09:31:29 +03:30
martinfalisse a378e3ccbf Spreadsheet: Add states for cursor hovering
Add states for the cutting and extending icons that are to be shown
depending on where the user's cursor is with respect to the target
cell.
2022-03-19 09:31:29 +03:30
Karol Kosek 677e4845a7 PixelPaint: Add Cut action
It's just the Copy action with erasing selection at the end.
2022-03-19 00:50:59 +01:00
Karol Kosek 580c6080b5 PixelPaint: Put undo/redo actions on top of the Edit menu
To be consistent with the order with other apps on the system. :^)
2022-03-19 00:50:59 +01:00
Brian Gianforcaro f9bed65130 SoundPlayer: Fix read of uninitialized member variables on startup
I found these by running SoundPlayer under UserspaceEmulator.
After boot we attempt to read from these values before they
are initialized.
2022-03-18 02:13:05 -07:00
thankyouverycool ab86294660 FontEditor: Reset unicode block view on undo/redo actions
If the previous active glyph is outside the currently selected
block range, reset GlyphMap to show all glyphs. This is less
disorienting when undoing changes outside the visible range.
2022-03-18 01:12:26 +01:00
thankyouverycool a3956da6dc FontEditor: Make undo/redo compatible with multi-glyph selections
Previously the glyph undo stack saved an array of bytes representing
the restore state of an individual glyph when modified. Now the
selection undo stack saves a byte buffer of the entire selection,
letting us restore changes to multiple glyphs at once.
2022-03-18 01:12:26 +01:00
thankyouverycool 17b16f3997 FontEditor: Use memset/memcpy to copy/paste/delete glyphs
Iterating over each glyph to set bits was rather slow in large
selections. This lets us edit the entire character set almost
instantly.
2022-03-18 01:12:26 +01:00
Linus Groh 9422ae9bb2 LibJS: Add infallible variant of VM::push_execution_context()
It makes no sense to require passing a global object and doing a stack
space check in some cases where running out of stack is highly unlikely,
we can't recover from errors, and currently ignore the result anyway.

This is most commonly in constructors and when setting things up, rather
than regular function calls.
2022-03-18 01:12:12 +01:00
Linus Groh c19486172d Applications+Games: Drop ellipsis from settings action
There is no second step to complete after activating this action.
2022-03-18 01:10:16 +01:00
Tobias Christiansen be58e5c35b PixelPaint: Expand FastBoxBlur settings to allow vector input
This expands the previously added settings for the asymmetric radii of
th FastBoxBlurFilter to allow the user to specify an angle and the
desired magnitude of blur.
The given values are then calculated forward to corresponding x and y
blur radii.
2022-03-17 20:03:05 +01:00
Tobias Christiansen ffcc11c31b PixelPaint: Add asymmetric parameters to FastBoxBlur
This allows the user to blur the image not uniformly, but to specify
different radii for the x and y component.
2022-03-17 20:03:05 +01:00
Tobias Christiansen e8be8f7b6d PixelPaint: Add Timer for displaying previews of filters
This way the preview image is not generated on _every_ update_preview()
call but rather only if the last update_preview() was longer than 100ms
ago.
When rapidly moving the Slider for large blur values in the
FastBoxBlurFilter with the Gaussian approximation the usage became
noticeably sliggush because we queued a lot of preview generation just
to throw it away immediately. This patch fixes that.
2022-03-16 21:45:31 +01:00
Andreas Kling 544c796bcf Browser: Rename Inspector table view member names to match contents 2022-03-15 20:00:51 +01:00
Vrins 044be82567 Browser: Allow jumping to stylenames by typing in the inspector
This adds the default behavior of search and highlighting of
abstractView to the inspectorWidget. Search results are based on
the titles in the first columns.
2022-03-15 20:00:09 +01:00
Andreas Kling e5e621a63f Browser: Rename "Element" Inspector tab to "Box Model"
This tab shows the box model metrics, so let's call it "Box Model" :^)
2022-03-15 19:48:19 +01:00
Andreas Kling 1afd9467f2 Browser: Use accurate labels for the Inspector's style property tabs
"Styles" => "Computed"
"Computed" => "Resolved"

It'd be nice to show specified values as well, but we don't have great
infrastructure to do that yet.
2022-03-15 19:48:19 +01:00