Commit graph

8636 commits

Author SHA1 Message Date
Andreas Kling
bed0e6d250 Kernel: Make Process and Thread non-copyable and non-movable 2020-04-22 12:36:35 +02:00
Andreas Kling
a59453d4b7 AK: Tweak exchange() implementation
Make it constexpr and do perfect forwarding.
2020-04-22 12:36:35 +02:00
AnotherTest
1a7af4d677 LibLine: Do not ignore ^C and do not finish() after interrupt 2020-04-22 12:12:41 +02:00
angel
0d47ad7efe FileManager: Exit the application cleanly when failing to open initial directory
Co-Authored-By: Andreas Kling <kling@serenityos.org>
2020-04-22 12:12:32 +02:00
angel
cc424b7b0f FileManager: Graceful handling of access errors
A neat error message is displayed when failing to open a directory!
2020-04-22 12:12:32 +02:00
angel
451b3fa73c LibGUI: Added error events to FileSystemModel
This will allow us to catch errors early on FileManager
2020-04-22 12:12:32 +02:00
Brendan Coles
802c06ab7b Base: Add missing Syntax color settings for Joi theme 2020-04-22 11:48:38 +02:00
Linus Groh
038051d205 LibJS: Parse while statements 2020-04-22 11:48:14 +02:00
Brendan Coles
7e01e38cf4 Base: Add Sunshine theme 2020-04-22 11:47:42 +02:00
Nick Tiberi
d12f27b58e LibWeb: support confirm() with no arguments 2020-04-22 11:37:33 +02:00
AnotherTest
730ca98698 LibLine: Avoid OOB access when one of the suggestions is the prefix 2020-04-22 11:35:53 +02:00
Andreas Kling
ef69f900c7 LibWeb: Invalidate the canvas element after put_image_data()
This makes sure we repaint it right away so we can see the changes.
2020-04-22 00:09:23 +02:00
Andreas Kling
5326eebb1b WindowServer+LibGUI: Notify DisplayLinks at 60 fps no matter what
The original implementation only sent out notifications when there was
something being drawn on screen. If nothing was going on, we'd get too
lazy and just not notify display links.

This obviously break requestAnimationFrame(), so now we just drive the
DisplayLinks at 60 fps no matter what. :^)
2020-04-22 00:07:48 +02:00
Andreas Kling
2d4c91df8e LibWeb: Add ImageData objects and implement 2D context putImageData()
An ImageData is a wrapper around a Bitmap wrapper around a
JS::Uint8ClampedArray.
2020-04-21 23:49:51 +02:00
Andreas Kling
54133c683d LibWeb: Hack requestAnimationFrame() to provide a (very fake) timestamp 2020-04-21 23:49:09 +02:00
Andreas Kling
627fd6374b LibJS: Add Uint8ClampedArray :^)
This is a special kind of byte array that clamps its values to 0...255
It will be used for HTML ImageData objects.

I made Object::put_by_index() and get_by_index() virtual for this.
We'll probably need to make non-numeric property name lookups virtual
as well, but this solves my current problem well enough.
2020-04-21 23:47:39 +02:00
Andreas Kling
0fa7cf70b5 WindowServer+SystemMenu: Check the current system theme on startup 2020-04-21 18:40:52 +02:00
Andreas Kling
b6d035aa05 SystemMenu: Make the system theme menu items checkable (and exclusive) 2020-04-21 17:50:20 +02:00
Andreas Kling
705cee528a LibGUI: Make it easier to create checkable GUI::Actions
This patch adds GUI::Action::create_checkable() helpers that work just
like the existing create() helpers, but the actions become checkable(!)

Clients are no longer required to manage the checked state of their
actions manually, but instead they will be checked/unchecked as needed
by GUI::Action itself before the activation hook is fired.
2020-04-21 17:21:28 +02:00
angel
1032ae0140 WindowServer: Allow the system menu to be open when a modal is shown 2020-04-21 16:54:34 +02:00
angel
b9be57a9cd WindowServer: Don't process menu bar events when modal is open
This prevents accesing the parent window menubar when a modal is
currently open, which was not a desired behavior.
2020-04-21 16:27:36 +02:00
angel
5250f4fb90 WindowServer: Don't ignore modal events when showing menus
PR #1495 fixes #1464 but only accounts for window menus. In File
Manager, for example, attempting to pop up the context menu on the file
name text box of the properties modal window, will result in the same
behavior.

Removing the code altogether solves the problem, altough I'm
not sure if it could have any bad implications.

I was thinking it might allow interaction with a parent window menu if
it remains open just before the popup window is shown, but I have not
seen a way to replicate this behavior.
2020-04-21 16:27:36 +02:00
Andreas Kling
52a250cb61 LibGUI: Make MenuBar a Core::Object
This makes it show up in Inspector with all the menus inside it. :^)
2020-04-21 16:19:18 +02:00
Andreas Kling
a19690170f LibCore: Make Core::File::open() return a Result<NNRP<File>, String>
It was impractical to return a RefPtr<File> since that left us no way
to extract the error string. This is usually needed for the UI, so the
old static open() got basically no use.
2020-04-21 16:19:18 +02:00
Andreas Kling
ba3b561a40 AK: Simplify Result class so we can start using it
There were some ideas about how to use this class but we never actually
started using it, so let's just simplify it and get it ready for use.

The basic idea is: a function returns a Result<ValueType, ErrorType>.
Callers check if the result object is_error(). If so, an ErrorType can
be fetched with the error() getter. Otherwise, a ValueType is fetched
with the value() getter. That's it. :^)
2020-04-21 16:19:18 +02:00
Andreas Kling
59cd181ed9 AK: Remove unused Error template 2020-04-21 16:19:18 +02:00
angel
ae20775fb7
WindowServer: Unset active input window on active window change (#1901)
This was not done previously and resulted in modal windows not being
able to accept input unless they were clicked one time if their parent
windows were the active input window.
2020-04-21 15:46:27 +02:00
Jack Karamanian
1fa0c7304d LibJS: Implement Function.prototype.bind() 2020-04-21 12:23:07 +02:00
Jack Karamanian
b3800829da LibJS: Prepend callee's bound arguments to the CallFrame and set the
this_value to the callee's bound |this| in CallExpression::execute()
2020-04-21 12:23:07 +02:00
Jack Karamanian
5750edd859 LibJS: Allow Function objects to be constructed with a bound |this|
value and bound arguments

This allows Function objects produced by Function.prototype.bind, as well
as arrow functions to track their |this| values and bound arguments.
2020-04-21 12:23:07 +02:00
Nicolas Van Bossuyt
6a66207efa
PaintBrush: Initial support for transparency. (#1883) 2020-04-21 12:03:58 +02:00
Hüseyin ASLITÜRK
84317df579 Base: Add QuickShow application to system menu 2020-04-21 12:03:35 +02:00
Hüseyin ASLITÜRK
2abf2a2db1 LibGUI: MessageBox change height to icon cropping 2020-04-21 12:03:35 +02:00
Valtteri Koskivuori
3339a77f6c
LibGUI: Don't accelerate TextEditor autoscroll on wiggle (#1897)
This little tweak fixes the issue where the scrolling speeds up
significantly if the user wiggles their cursor. Just something obvious
I spotted while watching the video :^)
2020-04-21 09:54:46 +02:00
Brendan Coles
a47b9fe490 TextEditor: Add "Find Next" 16x16 icon 2020-04-21 09:49:47 +02:00
Linus Groh
13f806b1b0 LibJS: Rename global_call_fram to global_call_frame
Seems to be a typo.
2020-04-21 09:43:56 +02:00
Linus Groh
660fd04063 Meta: Build Lagom js and run LibJS tests on Travis 2020-04-20 22:44:13 +02:00
Linus Groh
9722cac9fe LibJS: Let run-tests return 1 when not all tests pass 2020-04-20 22:44:13 +02:00
angel
441c2715bb LibGUI: Add Select all action to TextEditor
Previously, TextEditor processed the Select all command directly on the
keydown event handler. For this reason, WindowManager would not process
it as an action for the focused control and an action with the same
keyboard shortcut from the parent could override the TextEditor's one
even when it is focused.

For instance, when pressing Ctrl+A on the FileManager's path bar, all
files were selected instead, which is not the expected behavior.

Now the Select all command is an actual action on TextEditor, so that
WindowManager can process it correctly before any other actions. I also
added an icon for it!
2020-04-20 22:43:40 +02:00
Andreas Kling
563a377f6b LibGUI: Fix unpleasant selection behavior when dragging far to the left
If you select some text and drag the cursor outside the widget on the
left hand side, we would previously suddenly snap the selection cursor
to the end of the line instead of keeping it at the start of the line
as you would expect. This patch fixes that. :^)
2020-04-20 21:39:07 +02:00
Andreas Kling
5c15c24976 LibGUI: Keep scrolling while drag-selecting outside a TextEditor
If you start selecting text and move the cursor outside the TextEditor
widget area without letting go of the mouse button, we will now keep
scrolling a little bit every 100ms.
2020-04-20 21:31:49 +02:00
Andreas Kling
f78a92c5a9 LibJS: Remove default parameter from assertThrowsError() for now
We don't support these yet, and it broke all the tests. :^)
2020-04-20 20:33:21 +02:00
AnotherTest
364ca1f476 LibLine: Autocomplete already-complete suggestions
Suggesting whatever the user has input is not quite sane :^)
2020-04-20 20:23:26 +02:00
AnotherTest
f9b0490383 LibLine: Handle ctrl-{left,right}_arrow by jumping between words
Words are delimited by spaces.
Perhaps this should be a configurable behaviour?
2020-04-20 20:23:26 +02:00
AnotherTest
54d400c685 LibVT: Handle ctrl+arrow keys
Prior to this commit, we would treat them the same.
2020-04-20 20:23:26 +02:00
Andreas Kling
50218f7edc Build: Use the GCC port if building on "SerenityOS" :^) 2020-04-20 19:52:35 +02:00
Linus Groh
cff68af965 LibJS: Add JSDoc to test-common.js 2020-04-20 17:31:49 +02:00
AnotherTest
e578b7884b LibLine: Properly handle ^C and do not return after being interrupted
this commit fixes a...surprisingly long-standing ^C bug, where it would
return the buffer instead of voiding it and starting over :^)
2020-04-20 17:27:30 +02:00
AnotherTest
42f06fc305 LibLine: Implement searching via up/down arrow keys 2020-04-20 17:27:30 +02:00
AnotherTest
58912994ab LibLine: Implement ^R searching
This commit adds searching in the editor history with ^R.
It does so by instantiating...another Line::Editor inside the current
Line::Editor :^)
2020-04-20 17:27:30 +02:00