Commit Graph

154 Commits

Author SHA1 Message Date
pbrw
601de466cb Mandelbrot: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
8293ad33ee LibGfxScaleDemo: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
dee90b2dc3 LibGfxDemo: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
abf86b7501 Fire: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
2642abb773 Eyes: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
79bc587d03 Cube: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
pbrw
370c5986ab CatDog: Use TRY() a lot more :^) 2021-11-25 08:49:31 +01:00
Andreas Kling
3d126fe921 WidgetGallery: Port to LibMain :^) 2021-11-23 15:44:59 +01:00
Andreas Kling
21a5fb0fa2 LibCore+LibSystem: Move syscall wrappers from LibSystem to LibCore
With this change, System::foo() becomes Core::System::foo().

Since LibCore builds on other systems than SerenityOS, we now have to
make sure that wrappers work with just a standard C library underneath.
2021-11-23 11:33:36 +01:00
Mustafa Quraish
4d302e0e88 Everywhere: Use Application::construct() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Mustafa Quraish
2fbcab46bf Everywhere: Use ArgsParser::parse() with Main::Arguments directly
Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
2021-11-22 21:13:42 -08:00
Pedro Pereira
0ed3520ef5 Starfield: Port to LibMain
Simplified two pledge() by using TRY().
2021-11-22 21:56:20 +01:00
Pedro Pereira
efe5f37b04 Starfield: Modify speed by Plus or Minus keypresses
Although this is supposed to be a screensaver, it makes all the sense in
the world that it should support modifying the speed interactively. :^)
2021-11-21 16:40:14 +00:00
Pedro Pereira
7b923d1376 Starfield: Modify speed by command argument
This change allows us to change the speed variable by passing a
-s or --speed argument.
2021-11-21 16:40:14 +00:00
Pedro Pereira
6ac97d4397 Starfield: Support variable speed
This change allows us to modify the speed in which the Starfield is
generated. Increasing the speed also increases the length of each trail.
2021-11-21 16:40:14 +00:00
Andreas Kling
0de33b3d6c LibGfx: Use ErrorOr<T> for Bitmap::try_create()
Another one that was used in a fajillion places.
2021-11-08 00:35:27 +01:00
Andreas Kling
235f39e449 LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08 00:35:27 +01:00
Andreas Kling
8262bbf624 LibGfx: Use ErrorOr<T> for Bitmap::cropped() 2021-11-08 00:35:27 +01:00
Andreas Kling
83d1460ee8 LibGfx: Use ErrorOr<T> for Bitmap::try_create_wrapper() 2021-11-08 00:35:27 +01:00
Karol Kosek
657409736a WidgetGallery: Make custom cursors visible only in the cursors tab
Prior to this change, the selected cursor stayed changed throughout
the app, even after switching tabs, which didn't look quite right.
2021-11-08 00:06:55 +01:00
FrHun
54605794f9 Applications: Remove border from GroupBox margins 2021-11-03 16:13:19 +01:00
Ben Wiederhake
3796d417e0 Demos+DevTools+Games: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
2021-11-02 22:56:53 +01:00
Filiph Sandström
c6247fe414 Everywhere: Rename back-click to backward-click
This matches the current forward-click terminology.
2021-10-27 22:05:58 +03:00
Filiph Sandström
d6a0726302 Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
2021-10-27 22:05:58 +03:00
Idan Horowitz
4f1d45705f Demos: Remap mouse button events to physical buttons in MouseDemo
This ensures we paint the left button as clicked when the left mouse
button is pressed (and vice-versa with the right one) when the right
mouse button is set as the primary one in the mouse settings.
2021-10-26 16:51:29 +02:00
Idan Horowitz
14223a9c20 Demos: Change MouseDemo's window title to "Mouse demo"
The previous title ("Mouse button demo") didn't fit in the window's
titlebar, which looked pretty bad.
2021-10-26 16:51:29 +02:00
Peter Elliott
e1684860a3 LibGUI: Support drag-to-reorder in TabWidget 2021-10-07 12:19:27 +02:00
Karol Kosek
bcfb07bc30 WidgetGallery: Crop animated cursors
Selecting the wait cursor displayed the full sprite image.

This has been borrowed from the MouseSettings.
2021-09-20 15:59:34 +02:00
Karol Kosek
d1846867cd WidgetGallery+MouseSettings: Use LexicalPath::basename() 2021-09-20 15:59:34 +02:00
Karol Kosek
9ddd2fdcc5 WidgetGallery: Simplify cursor change code
The code here wasn't updated when a new file icons appeared, so double-
-clicking a cursor didn't always set it to the correct one.

Also, the cursor list is sorted alphabetically, by the file name.
So if a theme used a different file naming in Config.ini, then
the previous code would also be incorrect.

Here we will just take the bitmap icon from the model.

Closes: #10142
2021-09-20 15:59:34 +02:00
Brian Gianforcaro
a34ea51ca4 Fire: Use ElapsedTimer::start_new() 2021-09-12 17:24:44 +00:00
Brian Gianforcaro
ddfdfc2342 Cube: Use ElapsedTimer::start_new() 2021-09-12 17:24:44 +00:00
Mustafa Quraish
c545d4ffcb WidgetGallery: Add GUI::ValueSlider widget
This was a cool slider and was missing from the gallery completely.
Vertical mode for this isn't enabled, and it looked awfully crammed
in the bottom along with the other horizontal sliders, so for now
I've just added this to the top, and it controls the opacity of the
image along with the opacity slider.
2021-09-11 11:37:39 +02:00
Ben Wiederhake
f717008bde CatDog: Switch to new mouse-tracking method 2021-09-08 10:53:49 +02:00
Ben Wiederhake
c6546c7b03 Eyes: Switch to new mouse-tracking method 2021-09-08 10:53:49 +02:00
Mustafa Quraish
1da081bf86 Mandelbrot: Use the new Zoom cursor
It makes it really clear now that you can use the mouse to zoom
when you see the zoom cursor.
2021-09-04 03:35:23 +02:00
Andreas Kling
c915174563 Userland: Remove IRC Client
The IRC Client application made some sense while our main communication
hub was an IRC channel. Now that we've moved on, IRC is just a random
protocol with no particular relevance to this project.

This also has the benefit of removing one major client of the single-
process Web::InProcessWebView class.
2021-08-24 16:37:28 +02:00
sin-ack
b30b7de2d2 ModelGallery: Add the new Model Gallery application :^)
This is an application analogous to WidgetGallery, in that it tests
various capabilities of LibGUI models. Right now it is pretty bare, but
as more work towards LibGUI models is done regarding persistent model
indices, more demos will be added.
2021-08-23 12:25:26 +04:30
Maciej Zygmanowski
040a723f1f WindowServer: Add support for cursor themes
Now you can specify a CursorTheme key in /etc/WindowServer.ini. The
cursors are loaded from /res/cursor-themes/<name> directory. This
directory contains a Config.ini file with format similar to previous
Cursor section, except it uses relative paths.

This commit adds also Default theme, which uses cursors being
previously in /res/cursors.

The WidgetGallery is updated to match the new cursor path format.
2021-08-23 01:41:53 +02:00
Andreas Kling
20b104dead WidgetGallery: Remove menubar 2021-08-20 01:27:39 +02:00
sin-ack
e11d177618 Userland+LibGUI: Add shorthand versions of the Margins constructor
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same
margin on all edges, for example. The constructors follow CSS' style of
specifying margins. The added constructors are:

- Margins(int all): Sets the same margin on all edges.
- Margins(int vertical, int horizontal): Sets the first argument to top
  and bottom margins, and the second argument to left and right margins.
- Margins(int top, int vertical, int bottom): Sets the first argument to
  the top margin, the second argument to the left and right margins,
  and the third argument to the bottom margin.
2021-08-18 10:30:50 +02:00
sin-ack
9c9a5c55cb Userland+LibGUI: Make Margins arguments match CSS ordering
Previously the argument order for Margins was (left, top, right,
bottom). To make it more familiar and closer to how CSS does it, the
argument order is now (top, right, bottom, left).
2021-08-18 10:30:50 +02:00
Nico Weber
5c3440c5db Mandelbrot: Add a View menu with zoom actions 2021-08-14 19:50:44 +02:00
Nico Weber
19068945de Mandelbrot: Extract reset() method 2021-08-14 19:50:44 +02:00
Nico Weber
ad7bfe017f Mandelbrot: Extract zoom() method 2021-08-14 19:50:44 +02:00
sin-ack
1be59d663a Mandelbrot: Only recalculate missing areas after panning
We can reuse the areas that we have from before and just recalculate
the areas that are fresh. This makes panning super smooth. :^)
2021-08-10 09:48:12 +02:00
sin-ack
d28802ad22 Mandelbrot: Add panning
Adds the ability to use the middle-mouse click to pan the current view.
2021-08-10 09:48:12 +02:00
sin-ack
faec8bbe45 Mandelbrot: Add mousewheel zooming
This allows the user to zoom in with a up scroll of the mousewheel and
zoom out with a down scroll.
2021-08-10 09:48:12 +02:00
sin-ack
a08dd5b99c Mandelbrot: Use a GUI::Frame to paint into
This allows us to have a frame border which looks nicer.
2021-08-10 09:48:12 +02:00
sin-ack
07f5e12568 WidgetGallery: Change model update() functions to invalidate()
These functions reload the whole model contents and thus can be moved to
invalidate(), which saves us from the need to manually call update() on
them.
2021-08-08 14:45:23 +02:00