Commit Graph

7900 Commits

Author SHA1 Message Date
Brendan Coles
d64589101c Userland: Add optional human readable output to /bin/df
/bin/df now allows the operator to view human readable
output using `-h` or `--human-readable` optional flags.
2020-03-31 09:08:30 +02:00
Sergey Bugaev
7bd077a3ae LibGUI: Fix index invalidation
When the model gets updated, we have to let go of the old indexes,
because they're invalid from that moment on.

Fixes https://github.com/SerenityOS/serenity/issues/1541
2020-03-30 23:05:14 +02:00
Linus Groh
3fcea71538 LibJS: Implement Date.prototype.to{Date,Time}String() 2020-03-30 21:43:35 +02:00
Linus Groh
dc9b1226ac LibJS: Implement Date.prototype.toString() 2020-03-30 20:36:18 +02:00
Andreas Kling
b4fde72013 LibGUI: Brighten icons when hovering items in item views
View classes now track their hovered item and paint them in a slightly
brighter shade to liven up the user interface. :^)
2020-03-30 19:57:44 +02:00
Andreas Kling
add93bf593 LibGUI: Brighten buttons when hovering over them :^) 2020-03-30 19:40:44 +02:00
Andreas Kling
7976ef7a79 LibGfx: Add Painter::blit_filtered() and blit_brightened()
blit_filtered() can be used to easily implement per-pixel filtered blit
functions. All you need to do is provide a callback that can compute
the Color for each pixel based on the original Color.
2020-03-30 19:39:37 +02:00
Andreas Kling
fb2be5c404 Shell: Shorten $HOME to '~' in shell prompts
The "\w" substitution in shell prompts now uses '~' to represent the
user's home directory (technically, whatever $HOME contains.)
2020-03-30 18:08:47 +02:00
Andreas Kling
012a4eb0b5 WindowServer+NotificationServer: Vertical title bar for notifications
This patch adds a specialized window type for notifications. They now
have a title bar on the right-hand side, with a close button.

This removes the need for the "Done" button in notifications, giving us
a bit more horizontal space overall.

Design based on a mock-up from @xTibor :^)
2020-03-30 17:03:15 +02:00
Andreas Kling
cbd7effd3b LibGfx: Support vertical gradient fill (not just horizontal) :^) 2020-03-30 17:00:12 +02:00
Jack Karamanian
098f1cd0ca LibJS: Add support for arrow functions 2020-03-30 15:41:36 +02:00
Jack Karamanian
f90da71d28 LibJS: Add Parser save_state() and load_state() functions
These functions allow us to try to parse ambiguous expressions (such as
arrow function arguments in parentheses), and
rewind the state of the Parser if an expression candidate failed to
parse.
2020-03-30 15:41:36 +02:00
Linus Groh
fb0401871c LibJS: Throw TypeError when calling non-function object
We now have "undefined is not a function" :^)
2020-03-30 14:43:58 +02:00
Linus Groh
d4e3688f4f LibJS: Start implementing Date :^)
This adds:

- A global Date object (with `length` property and `now` function)
- The Date constructor (no arguments yet)
- The Date prototype (with `get*` functions)
2020-03-30 14:11:54 +02:00
Andreas Kling
5c779c124b LibVT: Don't scroll-to-bottom when pressing the Logo key
Let's treat the Logo key like all the other modifiers and not scroll to
the bottom of the buffer.
2020-03-30 13:15:47 +02:00
Andreas Kling
a1c718e387 LibJS: Use some macro magic to avoid duplicating all the token types 2020-03-30 13:11:07 +02:00
Tibor Nagy
f221771717 HackStudio: Add icon for the Find action 2020-03-30 13:03:53 +02:00
Tibor Nagy
c7f3d72a6a HackStudio: Add an upscaled 32x32 icon to the About dialog 2020-03-30 13:03:53 +02:00
Tibor Nagy
f15e9ee0fc HackStudio: Fix the labels of project opening menu and dialog 2020-03-30 13:03:53 +02:00
Andreas Kling
5c37570dfc Shell: Stop making shell history files world-readable
\0 pointed out that it's pretty bad to have world-readable .history
files, especially for root's shell!
2020-03-30 12:09:26 +02:00
Andreas Kling
0df15823b5 LibCore: Add a static Core::File::open() convenience function
This helper opens a file with a given name, mode and permissions and
returns it in a RefPtr<File>. I think this will be a bit nicer to use
than having to go through Core::File::construct() every time.
2020-03-30 12:08:25 +02:00
Andreas Kling
ec91d2eb9f Documentation: Inform people that anon can su to root by default
\0 pointed out that this is not mentioned anywhere, technically making
it a "local privilege escalation" bug.

This patch adds it to the documentation, and I've also paid out the
first $5 bounty to the "Kiwis for Kiwi" charity as per \0's request!

http://serenityos.org/bounty/kiwis4kiwi.png
2020-03-30 11:35:39 +02:00
Andreas Kling
06aec9667e LibWeb: Support more advanced selectors in document.querySelectorAll()
I made some mistakes in the selector parsing code. It's now able to
parse selectors composed of multiple complex selectors, instead of just
one complex selector.
2020-03-30 11:35:39 +02:00
Andreas Kling
c1c56b1131 LibWeb: Add Element.id property to the bindings 2020-03-30 11:35:39 +02:00
Andreas Kling
0f7bcd4111 LibWeb: Add naive support for document.querySelectorAll()
This currently returns a JS::Array of elements matching a selector.
The more correct behavior would be to return a static NodeList, but as
we don't have NodeLists right now, that'll be a task for the future.
2020-03-30 11:35:39 +02:00
Tibor Nagy
c56acba75e SoundPlayer: Set parent window for AboutDialog 2020-03-30 10:52:09 +02:00
Tibor Nagy
cfd1e783a5 Solitaire: Set parent window for AboutDialog 2020-03-30 10:52:09 +02:00
Tibor Nagy
317a0d666b LibGUI: AboutDialog now inherits the icon of its parent window 2020-03-30 10:52:09 +02:00
Tibor Nagy
7a61ed4178 Taskbar: Show default window icons when no icons are set
To be consistent with WindowServer.
2020-03-30 10:52:09 +02:00
Andreas Kling
8c5fa05c39 WindowServer: Use Gfx::ShareableBitmap for SetWindowIconBitmap 2020-03-29 19:37:23 +02:00
Andreas Kling
7cfe712f4d LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an
IPC message. As long as the message itself is synchronous, the bitmap
will be adopted by the receiving end, and disowned by the sender nicely
without any accounting effort like we've had to do in the past.

Use this in NotificationServer to allow sending arbitrary bitmaps as
icons instead of paths-to-icons.
2020-03-29 19:37:23 +02:00
Andreas Kling
24a0354ce8 LibIPC+LibGfx: Pass the IPC::Decoder to decoding helpers
Instead of passing the BufferStream, pass the Decoder. I'd like to stop
using BufferStream eventually anyway, so it's good to get it out of any
API's where it's in currently.
2020-03-29 19:37:23 +02:00
Andreas Kling
01ff36a2f4 LibIPC: Add forwarding header for LibIPC 2020-03-29 19:37:23 +02:00
Andreas Kling
ae9fe60412 LibGUI: Make Label::set_icon() take a const Gfx::Bitmap* 2020-03-29 19:37:23 +02:00
Linus Groh
0a94661c14 LibJS: Implement String.prototype.startsWith() 2020-03-29 19:37:16 +02:00
Hüseyin ASLITÜRK
7971af474d DisplayProperties: Add options to set the background color and wallpaper mode.
Wallpaper mode and background color change options are now available. Monitor preview
widget show new settings before apply. We have some missing preview features :(
2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
f88b90f6fd LibGUI: Desktop, add methods for set background color and wallpaper mode 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
adf524015a WindowServer: Add methods for set background color and wallpaper mode 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
7194b4823e LibGUI: ComboBox, add "set_selected_index" method
Easy way to set selected item.
2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
db692a807b Base: Add icons for color-chooser 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
38dd8f28bd Base: Add tile wallpaper 2020-03-29 19:36:37 +02:00
Hüseyin ASLITÜRK
48a7d7c72d Base: Add monitor.png 2020-03-29 19:36:37 +02:00
Linus Groh
402fd5a3a3 LibJS: Add tests for Math constants 2020-03-29 17:35:08 +02:00
Linus Groh
03c3530d86 LibJS: Add constant properties to MathObject 2020-03-29 17:35:08 +02:00
Linus Groh
c698cc899d LibJS: Add tests for value to number conversion 2020-03-29 16:45:11 +02:00
Linus Groh
bad0556a59 LibJS: Handle empty strings and arrays in Value::to_number()
- An empty string is converted to 0
 - An empty array is converted to 0
 - An array with one item is converted to that item's numeric value
 - An array with more than one item is converted to NaN
2020-03-29 16:45:11 +02:00
Andreas Kling
2d3634d5f5 LibJS: Implement Math.abs() 2020-03-29 15:03:58 +02:00
Andreas Kling
2285f84596 LibJS: Implement basic execution of "switch" statements
The "break" keyword now unwinds to the nearest ScopeType::Breakable.
There's no support for break labels yet, but we'll get there too.
2020-03-29 15:03:58 +02:00
Andreas Kling
1923051c5b LibJS: Lexer and parser support for "switch" statements 2020-03-29 15:03:58 +02:00
Tibor Nagy
70dc80fa47 SystemMenu: Sort applications alphabetically 2020-03-29 14:58:26 +02:00