Tim Ledbetter
bdaad815a1
PixelPaint: Rename Layer::resize() to Layer::scale()
...
This name more accurately describes the transform being performed.
2023-03-16 10:00:26 +01:00
Tim Ledbetter
690f3ae43b
PixelPaint: Always specify a new bounding rect when resizing layers
...
This commit also removes the other Layer::resize() overloads, as they
are no longer used.
2023-03-16 10:00:26 +01:00
Tim Ledbetter
c17b32e058
PixelPaint: Make Resize Image scale each layer to the correct size
...
The "Resize Image" action will now scale layer such that
the corners of each layer maintain their position relative to the edge
of the canvas.
Previously, each layer was scaled to the same size of the canvas.
2023-03-16 10:00:26 +01:00
Tim Ledbetter
92a0a7e3fa
PixelPaint: Don't resize layers when resizing the canvas
...
Calling Image::resize() with ScalingMode::None now resizes the canvas
without changing the size or position of any layers.
2023-03-16 10:00:26 +01:00
Karol Kosek
797968c310
LibGUI+Userland: Make TabWidget::*add_tab() take title using new string
2023-03-16 09:58:42 +01:00
Karol Kosek
5fed25ca9a
PixelPaint: Port ImageEditor title to new string
2023-03-16 09:58:42 +01:00
Karol Kosek
3805e4e3a9
LibGUI+HackStudio+PixelPaint: Port Widget title to the new String
...
I had to add a set_title(String) helper function for ImageEditor because
TabWidget requires it. This is a temporary fix and will be handled in
subsequent commit.
2023-03-16 09:58:42 +01:00
Tim Ledbetter
8ffe91c2f7
PixelPaint: Make the clone tool brush size consistent with other tools
...
Other brush tools treat the brush size as a radius, not diameter. The
clone tool now does the same.
2023-03-15 23:56:47 +01:00
Tim Ledbetter
8fa6a85100
PixelPaint: Scale the clone tool sample marker size with zoom level
2023-03-15 23:56:47 +01:00
Tim Ledbetter
da0ec8e635
PixelPaint: Repaint clone tool sample marker on size change
2023-03-15 23:56:47 +01:00
Tim Ledbetter
9f75c2b075
PixelPaint: Minimize clone tool sample marker repaints
...
This removes 2 FIXMEs :^)
2023-03-15 23:56:47 +01:00
Tim Schumacher
ecd1862859
AK: Rename Stream::write_entire_buffer to Stream::write_until_depleted
...
No functional changes.
2023-03-13 15:16:20 +00:00
Lucas CHOLLET
b5594bf9a2
PixelPaint: Display color information on mousemove with the PickerTool
...
Per-channel values of the pixel color are now displayed in the status
bar when the PickerTool is selected. This information obviously updates
on mousemove.
2023-03-12 22:08:24 +01:00
Nico Weber
f1a3028ef1
LibGfx: Change BMPWriter API to be consistent with other image writers
2023-03-12 21:32:21 +01:00
Nico Weber
9b297c634f
LibGfx: Make QOIWriter use ErrorOr
...
In addition to it now handling allocation failures, the encode() API is
now consistent with PNGWriter.
2023-03-12 13:23:34 +00:00
Tim Ledbetter
4fd12b6b79
PixelPaint: Add list of recently opened files to the file menu
2023-03-09 21:21:18 +01:00
Tim Ledbetter
4accc6a61f
PixelPaint: Propagate errors from menu initialization
2023-03-09 21:21:18 +01:00
Andreas Kling
21db2b7b90
Everywhere: Remove NonnullOwnPtr.h includes
2023-03-06 23:46:35 +01:00
Andreas Kling
359d6e7b0b
Everywhere: Stop using NonnullOwnPtrVector
...
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06 23:46:35 +01:00
Andreas Kling
689ca370d4
Everywhere: Remove NonnullRefPtr.h includes
2023-03-06 23:46:35 +01:00
Andreas Kling
8a48246ed1
Everywhere: Stop using NonnullRefPtrVector
...
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00
Ali Mohammad Pur
500044906d
LibCore+Everywhere: Remove ArgsParser::add*(char const*&)
...
This is not guaranteed to always work correctly as ArgsParser deals in
StringViews and might have a non-properly-null-terminated string as a
value. As a bonus, using StringView (and DeprecatedString where
necessary) leads to nicer looking code too :^)
2023-03-01 10:47:19 +01:00
Tim Ledbetter
e33791502f
PixelPaint: Do not change layers when scaling with the move tool
...
The move tool will no longer change the foreground layer if the cursor
is currently hovering over a resize anchor.
2023-03-01 08:15:46 +00:00
Tim Ledbetter
f3d1be933a
PixelPaint: Remove shrink_to_fit property from LevelsDialog GML
...
This was causing the levels dialog to be displayed incorrectly.
2023-02-28 08:44:05 +00:00
Tim Ledbetter
3112a6b44f
PixelPaint: Fix clicking on the layer menu with no image loaded
...
Previously, clicking on the layer menu with no image loaded would
cause a crash.
2023-02-28 08:37:10 +00:00
Tim Ledbetter
ef54a3c0d2
PixelPaint: Disable levels dialog action when no image is loaded
...
Previously, clicking on the levels dialog with no image loaded would
cause a crash.
2023-02-28 08:37:10 +00:00
Tim Ledbetter
799d570afc
PixelPaint: Add "Apply Mask" action
...
This commit adds a "Apply Mask" action which merges the active layer
mask with the layer bitmap. The option is only displayed if the active
layer is masked.
2023-02-26 13:09:16 +01:00
Tim Ledbetter
062c9efa88
PixelPaint: Add "Delete Mask" action
...
This commit adds a "Delete Mask" action which deletes the active layer
mask. The option is only displayed if the active layer is masked.
2023-02-26 13:09:16 +01:00
Linus Groh
09d40bfbb2
Everywhere: Use _{short_,}string to create Strings from literals
2023-02-25 20:51:49 +01:00
Tim Ledbetter
d62c95d779
PixelPaint: Make "Add Mask" action fallible
2023-02-24 20:33:18 +01:00
Tim Ledbetter
b548a7b5ea
PixelPaint: Make "Add Mask" action undoable
2023-02-24 20:33:18 +01:00
Tim Ledbetter
f1a792e6c9
PixelPaint: Save layer mask when adding to the UndoStack
...
This makes undoing actions performed on layer masks work as
expected.
did_modify_bitmap() is now also called on redo, to ensure the layer
mask is displayed correctly.
2023-02-24 20:33:18 +01:00
Tim Ledbetter
e294c96aef
PixelPaint: Make merge up and down actions work with disjoint layers
...
The "Merge Active Layer Up" and "Merge Active Layer Down" actions now
work with layers of different sizes. These actions now expand the
bounding rect of the newly merged layer to contain all layers being
merged. Layers which are not visible are now ignored by these actions.
2023-02-21 12:06:31 +00:00
Tim Ledbetter
74dff6250c
PixelPaint: Make image flattening actions work with disjoint layers
...
The "Flatten Image" and "Merge Visible" actions now work with layers
of different sizes. These actions now expand the bounding rect of the
newly merged layer to contain all layers being merged.
2023-02-21 12:06:31 +00:00
Andreas Kling
33e87d1627
Userland: Fix remaining smart pointer const-correctness issues
2023-02-21 00:54:04 +01:00
Andreas Kling
df07416171
PixelPaint: Store tool cursors as NNRP<Gfx::Bitmap const>
2023-02-21 00:54:04 +01:00
Andreas Kling
053afbf2d1
PixelPaint: Make Filter::apply() non-virtual and non-const
...
It didn't need to be either of these things.
2023-02-21 00:54:04 +01:00
Tim Ledbetter
3d9ba87077
PixelPaint: Enable more text tool keyboard shortcuts
...
This commit allows the text tool's internal TextEditor component to
handle keyboard shortcuts that would normally be handled by menu
actions.
The shortcuts that can now be used are: cut, copy, paste, undo, redo
and select all.
2023-02-19 01:48:14 +01:00
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