Commit Graph

735 Commits

Author SHA1 Message Date
Aziz Berkay Yesilyurt
0da1353c80 Userland: Keep ImageViewer window size the same while zooming in
ImageViewer window kept growing while zooming in, which causes out of
memory error and crashes the application. Now, only the image content
is rescaled and the window size is preserved.

We also open the display window as the same size as the image, which may
cause a similar issue for very large image files. This is prevented by
limiting the maximum window size to be the screen size.
2021-07-08 00:21:31 +02:00
Andreas Kling
fda22c6889 FileManager: Fix Desktop rubber-banding getting clipped at the edge
The issue was that the desktop IconView has Gfx::FrameShape::NoFrame as
its frame shape, but with a non-zero frame_thickness().

This caused us to not render a frame, but to include one in the
selection boundary calculations.

Fix this by setting the desktop icon view's frame thickness to 0.

Fixes #8525.
2021-07-07 18:10:19 +02:00
Yuval Tasher
b08383c48d Assistant: Compare two chars instead of StringViews of length 1 2021-07-07 15:58:57 +02:00
networkException
2483a78313 Browser: Show an example url placeholder in the search engine InputBox
This makes it more clear what the format for a search engine url is :^)
2021-07-07 15:29:03 +02:00
Andreas Kling
8975caca45 PixelPaint: Make SprayTool only invalidate the modified area :^) 2021-07-07 13:01:20 +02:00
Andreas Kling
e28b22c316 PixelPaint: Make BrushTool only invalidate the modified area :^) 2021-07-07 13:01:20 +02:00
Andreas Kling
7cbcf5a5fa PixelPaint: Make PenTool only invalidate the modified area :^) 2021-07-07 13:01:20 +02:00
Andreas Kling
f7053059c9 PixelPaint: Allow partial invalidation of Layer and Image
Let's give ourselves the tools needed to update less than the entire
image every time we paint.

This patch adds plumbing so that Layer invalidations have a modified
rect that gets passed on to Image, and then on to ImageEditor.
2021-07-07 13:01:20 +02:00
Andrew Kaster
f0d562131f Tests: Generate data in memory for TestXSV benchmark case
The actual data file for this benchmark was never actually committed to
the repository, so let's generate 100k identical lines in memory to be
the fairly large data for this test instead.
2021-07-06 17:22:45 +02:00
Idan Horowitz
e3ef241108 LibJS: Remove the non-standard put helper and replace it's usages
This removes all usages of the non-standard put helper method and
replaces all of it's usages with the specification required alternative
or with define_direct_property where appropriate.
2021-07-06 14:20:30 +01:00
Idan Horowitz
53f70e5208 LibJS: Remove the default length & attributes from define_native_*
These are usually incorrect, and people sometimes forget to add the
correct values as a result of them being optional, so they should just
be specified explicitly.
2021-07-06 14:20:30 +01:00
Andreas Kling
73183ee5c4 PixelPaint: Paint the area around the image with ColorRole::Tray
It didn't really make sense for the transparency grid to extend
infinitely around the image. Now the grid is only visible underneath
the image, which matches how most other editors behave.
2021-07-06 12:24:51 +02:00
Andreas Kling
b650bb602a PixelPaint: Don't repaint area outside image when image itself changed 2021-07-06 12:24:51 +02:00
Andreas Kling
a6f0861c7b Assistant: Add missing <unistd.h> include 2021-07-05 23:30:15 +02:00
Marcus Nilsson
e1906d74b8 PixelPaint: Make move_selection() cycle through layers
Previously move_selection() did not work as expected. Instead store the
selected layer index in a member variable and continue to cycle through
the layers when you come to the start/end. Also use it to scroll into
view. Lastly rename the function to cycle_through_selection() to make it
clearer what it does.
2021-07-05 20:39:30 +02:00
Marcus Nilsson
8d205ae62e PixelPaint: Use layer menu as context menu in LayerListWidget
This enables the layer menu as a context menu in LayerListWidget,
setting the clicked layer as active for now, but in the future it
would be nice to have custom menu applying to the clicked layer instead
of the active layer.
2021-07-05 20:39:30 +02:00
Marcus Nilsson
9df3550e58 PixelPaint: Change color of disabled layers in LayerListWidget 2021-07-05 20:39:30 +02:00
Marcus Nilsson
36abb38f26 PixelPaint: Make LayerListWidget scrollable
Previously only a couple of layers would fit in the layer widget, this
makes it scrollable and also tweaks some sizes and coordinates.
2021-07-05 20:39:30 +02:00
Marcus Nilsson
13e526de43 PixelPaint: Change the default layer name to "Layer"
Change the default layer name to "Layer" and enable the user to press
return to quickly close the dialog.
2021-07-05 20:39:30 +02:00
kleines Filmröllchen
9f1f3c6f37 Piano: Use AudioServer instead of /dev/audio for audio
Piano is an old application that predates AudioServer. For this reason,
it was architected to directly talk to the soundcard via the /dev/audio
device. This caused multiple problems including simultaneous playback
issues, no ability to change volume/mute for Piano and more.

This change moves Piano to use AudioServer like any well-behaved audio
application :^) The track processing and IPC communication is moved to
the main thread because IPC doesn't like multi-threading. For this, the
new AudioPlayerLoop class is utilized that should evolve into the
DSP->AudioServer interface in the future.

Because Piano's CPU utilization has gotten so low (about 3-6%), the UI
update loop is switched back to render at exactly 60fps.

This is an important commit on the road to #6528.
2021-07-05 19:33:55 +02:00
ForLoveOfCats
ce6658acc1 KeyboardSettings+Kernel: Setting to enable Num Lock on login 2021-07-05 06:19:59 +02:00
Marcus Nilsson
2183d01eb0 PixelPaint: Ask to preserve transparency when exporting
Previously the alpha channel was thrown away when exporting to BMP or
PNG in PixelPaint, instead let the user decide.
2021-07-05 00:43:00 +02:00
Andreas Kling
45a2bc27d5 Assistant: Don't index the /dev directory 2021-07-04 23:15:17 +02:00
Andreas Kling
085da369ff Assistant: Force the window to have a shadow despite being frameless 2021-07-04 23:15:17 +02:00
Andreas Kling
3368e54224 Magnifier: Make a custom 16x16 icon for this app + tweak 32x32 version
Stop piggybacking on the generic "find" icon and make a custom one. :^)
2021-07-04 23:15:17 +02:00
Andreas Kling
3e63633e1c Magnifier: Make the main widget a GUI::Frame
This makes the magnifier window look slightly nicer. :^)
2021-07-04 23:15:16 +02:00
Andreas Kling
782a5c88ce WindowServer: Make most remaining WindowServer IPC calls async
The only remaining sync call from client to server is now the call
that switches a window's backing store. That one actually relies on
the synchronization to hand over ownership of the backing stores,
so it has to stay synchronous for now.
2021-07-04 23:15:16 +02:00
Linus Groh
09bd5f8772 LibJS: Rewrite most of Object for spec compliance :^)
This is a huge patch, I know. In hindsight this perhaps could've been
done slightly more incremental, but I started and then fixed everything
until it worked, and here we are. I tried splitting of some completely
unrelated changes into separate commits, however. Anyway.

This is a rewrite of most of Object, and by extension large parts of
Array, Proxy, Reflect, String, TypedArray, and some other things.

What we already had worked fine for about 90% of things, but getting the
last 10% right proved to be increasingly difficult with the current code
that sort of grew organically and is only very loosely based on the
spec - this became especially obvious when we started fixing a large
number of test262 failures.

Key changes include:

- 1:1 matching function names and parameters of all object-related
  functions, to avoid ambiguity. Previously we had things like put(),
  which the spec doesn't have - as a result it wasn't always clear which
  need to be used.
- Better separation between object abstract operations and internal
  methods - the former are always the same, the latter can be overridden
  (and are therefore virtual). The internal methods (i.e. [[Foo]] in the
  spec) are now prefixed with 'internal_' for clarity - again, it was
  previously not always clear which AO a certain method represents,
  get() could've been both Get and [[Get]] (I don't know which one it
  was closer to right now).
  Note that some of the old names have been kept until all code relying
  on them is updated, but they are now simple wrappers around the
  closest matching standard abstract operation.
- Simplifications of the storage layer: functions that write values to
  storage are now prefixed with 'storage_' to make their purpose clear,
  and as they are not part of the spec they should not contain any steps
  specified by it. Much functionality is now covered by the layers above
  it and was removed (e.g. handling of accessors, attribute checks).
- PropertyAttributes has been greatly simplified, and is being replaced
  by PropertyDescriptor - a concept similar to the current
  implementation, but more aligned with the actual spec. See the commit
  message of the previous commit where it was introduced for details.
- As a bonus, and since I had to look at the spec a whole lot anyway, I
  introduced more inline comments with the exact steps from the spec -
  this makes it super easy to verify correctness.
- East-const all the things.

As a result of all of this, things are much more correct but a bit
slower now. Retaining speed wasn't a consideration at all, I have done
no profiling of the new code - there might be low hanging fruits, which
we can then harvest separately.

Special thanks to Idan for helping me with this by tracking down bugs,
updating everything outside of LibJS to work with these changes (LibWeb,
Spreadsheet, HackStudio), as well as providing countless patches to fix
regressions I introduced - there still are very few (we got it down to
5), but we also get many new passing test262 tests in return. :^)

Co-authored-by: Idan Horowitz <idan.horowitz@gmail.com>
2021-07-04 22:07:36 +01:00
zawwwu
f6cca0b8f0 Spreadsheet: Move down a cell when Return is pressed in the cell editor
If Return key is pressed when using cell value editor in a top bar,
cursor is automatically moved one line down. Fixes #8287.
2021-07-04 21:54:50 +04:30
zawwwu
cf91815654 Spreadsheet: Add function for moving cursor
This function allows to access cursor movement functionality outside of
SpreadsheetView class.
2021-07-04 21:54:50 +04:30
LuK1337
0486e5895d Terminal: Grey out color scheme widget when there's nothing to select
By default we only include one color scheme.
2021-07-04 17:58:33 +02:00
timre13
55dd568583 Assistant: Show a border around the window 2021-07-04 14:48:54 +02:00
Gunnar Beutner
3bbe86d8ea Everywhere: Prefer using "..."sv over StringView { "..." } 2021-07-04 14:24:03 +02:00
ForLoveOfCats
d73f53d1de Assistant: Prevent window from being minimized 2021-07-04 13:58:56 +02:00
Daniel Bertalan
6c0b9919ce FileManager: Remove explicit T to Optional<T> conversion 2021-07-04 07:24:41 +04:30
Gunnar Beutner
f52bf15f8d Assistant: Make more of the classes final 2021-07-03 22:38:53 +02:00
Gunnar Beutner
52a3226f6d Assistant: Make the bitmap accessor pure virtual
Assistant looks broken when a result doesn't have an icon.
2021-07-03 22:38:53 +02:00
Gunnar Beutner
6af08f950a Assistant: Add missing bitmap accessor for terminal actions 2021-07-03 22:38:53 +02:00
Edwin Hoksberg
a4b4397a10 Assistant: Skip URL provider if query is empty or provider specific 2021-07-03 22:38:40 +02:00
Andreas Kling
c06f72c264 Assistant: Don't index the /proc and /sys directories
Roughly 20% of indexing time in a fresh install was spent on traversing
these kernel-generated directories. Let's just not. :^)
2021-07-03 22:14:09 +02:00
Andreas Kling
94def5ae9d Assistant: Avoid copying the result vectors when providers finish
Just move() them instead to cut down on the copying. :^)
2021-07-03 22:14:09 +02:00
Andreas Kling
e4199beccc Assistant: Keep the set of providers in a Vector for easy iteration 2021-07-03 22:14:09 +02:00
Andreas Kling
4fce72a967 Assistant: Use fstatat() while building FileProvider path cache
Using fstatat() allows the kernel to do relative path resolution as
opposed to absolute path resolution, which is significantly faster
and allows us to build the path cache sooner. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
801f74362e Assistant: Use StringView more in FileProvider fuzzy matching code
By not allocating new String objects, the fuzzy matcher becomes a lot
faster and more responsive while typing. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
d640031214 Assistant: Use FileIconProvider for FileProvider query results
Instead of showing the default "folder" icon for all file results,
we now show an appropriate icon for the given file. :^)
2021-07-03 20:03:53 +02:00
Andreas Kling
513e67e2eb Assistant: Make Result bitmaps virtual/lazy
Result classes now return their bitmap via a virtual Gfx::Bitmap*
getter. This effectively makes bitmap fetching lazier, since only
results that end up on screen actually get asked for their bitmap.

This drastically reduces the amount of work done by the FileProvider
background worker.
2021-07-03 20:03:53 +02:00
Marcus Nilsson
e0cf6f3cf0 TextEditor: Reset editor width when disabling preview mode
When disabling preview mode, reset the fixed width of m_editor so that
it fills out the window again even after resizing the splitter.
2021-07-03 17:36:50 +02:00
Timothy Flynn
27fe2b45e5 Assistant: Convert all Vector<NonnullRefPtr> to NonnullRefPtrVector 2021-07-03 15:41:35 +02:00
Timothy Flynn
d69691a26b Assistant: Add provider to run a command in a terminal
Prefix text with "$" in the Assistant text box to run a command in a
forked terminal. For example, "$ top" or "$ top -s pid".
2021-07-03 15:41:35 +02:00
Edwin Hoksberg
d5dfc255ed Assistant: Add new URLProvider to open URL's in the browser 2021-07-03 15:27:19 +02:00