Sam Atkins
6b66e39df4
LibGUI+Userland: Stop returning Layout from Widget::(try_)set_layout()
...
Nobody uses this return value any more. It also lets us remove a whole
bunch of `(void)` casts. :^)
2023-02-18 16:56:56 +00:00
Sam Atkins
77ad0fdb07
Userland: Specify margins and spacing in the GUI::Layout constructor
2023-02-18 16:56:56 +00:00
Sam Atkins
9561ec15f4
Userland: Use Widget::add_spacer() everywhere
2023-02-18 16:56:56 +00:00
Karol Kosek
ba5df46a49
PixelPaint: Propagate errors from making filter settings widgets
2023-02-17 22:45:44 -07:00
Karol Kosek
be717edd33
PixelPaint: Propagate errors from making tool property widgets
2023-02-16 23:36:58 +00:00
Karol Kosek
83da3c5c3e
PixelPaint: Add an option for making a Gradient with a secondary color
2023-02-16 10:50:58 +00:00
Karol Kosek
1ce2d7e674
PixelPaint: Put the main gradient color at the cursor
...
It doesn't seem right to me that we are 'holding' a transparent color,
with the main color being on the opposite side.
2023-02-16 10:50:58 +00:00
Karol Kosek
d27d19f012
PixelPaint: Set Tool on_*_color_change logic using virtual functions
...
Previously, we were rewriting the on_primary_color_change in the Text
Tool and Gradient, which made the palette widget no longer update after
picking a color from an image. Additionally, it also crashed the program
after leaving the Gradient tool and trying to change color.
2023-02-16 10:50:58 +00:00
Tim Schumacher
43f98ac6e1
Everywhere: Remove the AK::
qualifier from Stream usages
2023-02-13 00:50:07 +00:00
Tim Schumacher
606a3982f3
LibCore: Move Stream-based file into the Core
namespace
2023-02-13 00:50:07 +00:00
Karol Kosek
e39adc4772
Userland: Set Button text using the new String class
2023-02-13 00:45:09 +00:00
Karol Kosek
d32b052f22
LibGUI+Userland: Add _deprecated
suffix to AbstractButton::{set_,}text
2023-02-13 00:45:09 +00:00
Karol Kosek
67ffc687d8
LibGUI+PixelPaint: Port GUI::ValueSlider's suffix to the new String
2023-02-13 00:26:39 +00:00
Tim Ledbetter
4b604f702e
PixelPaint: Correct move tool alignment with the layer boundary
...
Previously, the move tool outline could "wobble" relative to the layer
boundary. This caused the layer boundary to appear and disappear when
zooming. With this commit, the layer boundary is always drawn behind
the move tool outline.
2023-02-08 20:29:48 +01:00
Tim Ledbetter
cc18d6fd25
PixelPaint: Use image coordinates for bucket tool bounds checking
...
Previously, layer coordinates were being used to check whether the
bucket tool was within the bounds of the current selection, rather
than image coordinates.
2023-02-08 20:28:55 +01:00
Tim Ledbetter
d4cb089acb
PixelPaint: Update text tool font color on primary color change
2023-02-02 14:41:59 +01:00
Tim Ledbetter
9115e99e4b
PixelPaint: Scale move tool resize anchors
...
The areas where the user must click to resize the image are now
scaled to ensure they do not overlap. This allows us to display the
correct cursor when zoomed out, as well as making the
borders look nicer.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
c82825379a
PixelPaint: Show resize anchors when using the move tool
...
This commit adds a two color border around areas that the user must
drag to resize, when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
4c617d370e
PixelPaint: Highlight active layer when using the move tool
...
This commit adds a two color border around the currently selected
layer when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
7b3bc883f1
PixelPaint: Set initial position correctly when using the move tool
...
This fixes an issue, where single clicking in the corner of the image
without moving the mouse would cause the layer to jump to the top left
corner of the canvas.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
4be6ee85e0
PixelPaint: Ensure layers are positioned correctly when painting
...
Previously, layer bitmaps could move slightly relative to their
boundary and the image background when panning and zooming.
2023-02-01 19:36:39 +01:00
Tim Ledbetter
607c8045dc
PixelPaint: Allow dragging when color picking using the Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
06e09cf415
PixelPaint: Disable current tool when color picking using the Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
2f5bbc68ed
PixelPaint: Use eyedropper cursor when color picking using Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
45e60a416b
PixelPaint: Use layer coordinates when color picking using Alt key
...
Previously, raw coordinates were being used, which meant that color
was being sampled from the wrong position.
2023-02-01 19:21:58 +01:00
Tim Schumacher
8464da1439
AK: Move Stream
and SeekableStream
from LibCore
...
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
2023-01-29 19:16:44 -07:00
MacDue
a75f9273b4
PixelPaint: Increase default window height by 10px
...
This stops the clone and gradient tools from being cut off the side
bar.
2023-01-29 13:38:27 +01:00
Linus Groh
108ea2b921
LibCore: Remove try_
prefix from fallible SharedCircularQueue methods
2023-01-28 22:41:36 +01:00
Linus Groh
65fa7db2b5
PixelPaint: Remove try_
prefix from fallible ProjectLoader methods
2023-01-28 22:41:36 +01:00
Linus Groh
86f28ceace
PixelPaint: Remove try_
prefix from fallible IconBag methods
2023-01-28 22:41:36 +01:00
Linus Groh
8a884b2581
PixelPaint: Remove try_
prefix from fallible Image methods
2023-01-28 22:41:36 +01:00
Linus Groh
39f1a6eb6f
PixelPaint: Remove try_
prefix from fallible Image methods
2023-01-28 22:41:36 +01:00
Sam Atkins
65d03e3b9d
PixelPaint: Remove declarations for non-existent methods
2023-01-27 20:33:18 +00:00
MacDue
69580d7f0e
PixelPaint: Allow the gradient tool to work with selections
...
Previously the call to layer->did_modify_bitmap() was missing so the
selection was not applied.
2023-01-27 18:05:19 +00:00
MacDue
681ed93a41
PixelPaint: Fix gradient tool clipping issues
...
This ensures that the gradient does not paint over the rulers at
any zoom level, and also shows the guidelines/handles even when the
gradient is clipped.
2023-01-27 18:05:19 +00:00
MacDue
efb2bed525
PixelPaint: Fix off-by-one in on_second_paint() clip rect
...
Previously the clip rect did not include the 1px border at the edges
of the rulers.
2023-01-27 18:05:19 +00:00
Sam Atkins
c36de98223
PixelPaint: Replace uses of JsonObject::get_deprecated()/get_ptr()
2023-01-27 08:07:24 -05:00
Tim Schumacher
82a152b696
LibGfx: Remove try_
prefix from bitmap creation functions
...
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Tim Ledbetter
77e15ff4da
PixelPaint: Let the move tool optionally select the active layer
...
Previously, the move tool would always select the topmost layer before
performing a move operation. This commit adds an option for the move
tool to always select the active layer, even if it is behind another.
2023-01-26 14:00:14 +01:00
Torstennator
452285a3f8
PixelPaint: Add a GradientTool
...
This patch adds a new gradient tool to pixelpaint that allows us to fill
the canvas with a smooth color gradient outline at the edge of the
filled area.
2023-01-26 10:37:26 +00:00
Tim Ledbetter
4bad4dc8d5
PixelPaint: Use background color when cropping layer to content
...
This commit expands the functionality of the "Crop Image to Content"
and "Crop Layer to Content" features by allowing them to detect and
crop the background color of an image instead of just cropping
transparent pixels.
The background color is determined by looking at the corner pixels of
the image. If no background color is found, the old behavior of
cropping transparent pixels is retained.
2023-01-25 14:31:15 +01:00
Sam Atkins
1dd6b7f5b7
AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
...
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-17 19:52:52 -05:00
Tim Ledbetter
3fb4d50982
PixelPaint: Preserve layer location when copying layers
...
Location metadata is now included when copying a layer to the
clipboard. This allows a pasted layer to be placed in the location it
was copied from.
2023-01-17 00:36:01 +01:00
Tim Ledbetter
dd582e4ae3
PixelPaint: Hold shift to increase move tool speed with the arrow keys
...
Holding shift while using the move tool with the arrow keys now moves
the selected layer in 10 pixel increments.
2023-01-15 19:11:25 +01:00
Tim Ledbetter
ecc202c59d
PixelPaint: Hold shift to constrain polygonal select tool line angle
...
Holding shift while using the polygonal select tool now constrains the
line angle in 22.5 degree increments. This matches the behavior of the
line tool.
2023-01-13 15:52:57 +01:00
Tim Ledbetter
569ef94228
PixelPaint: Don't allow the move tool to resize to zero pixels
...
This prevents an error message appearing when we attempt to scale
a layer to zero pixels using the move tool.
2023-01-13 15:45:28 +01:00
Liav A
e241b47fee
Userland: Remove a bunch of unveil calls on /sys/kernel/processes
...
These are not needed anymore since the introduction of the new
get_root_session_id syscall.
2023-01-13 13:41:30 +01:00
Tim Ledbetter
b0fad409bf
PixelPaint: Scale lasso tool preview path on zoom level change
...
The size of the preview shown by the lasso tool now scales with the
current zoom level.
2023-01-12 11:29:10 +01:00
Sam Atkins
e181b1cb82
Userland: Use Core::Timer::create_foo() factory functions where possible
2023-01-12 11:25:51 +01:00
Sam Atkins
a8cf0c9371
LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOr
...
clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
2023-01-12 11:25:51 +01:00