Commit graph

15 commits

Author SHA1 Message Date
Mustafa Quraish
3141d51164 PixelPaint: Use LibConfig to allow custom pixel grid threshold
Depending on the size / scaling of the UI, someone might want to
change what the threshold is to show the pixel grid. For instance
if you are working on a 50x50 image, and want to see the grid while
still fitting the whole image in the editor.

Since there's no UI for settings in PixelPaint right now, this
commit just uses LibConfig to read the following entry:
    ("PixelPaint", "PixelGrid", "Threshold")
which is then used when drawing the grid.
2021-09-12 00:17:04 +02:00
Mustafa Quraish
5a8c6b95e6 PixelPaint: Refactor main.cpp into MainWidget
Previously, all the UI setup was done in `main.cpp`, with a whole
bunch of lambdas,, and actions etc just being stored in the main
function. This is probably an artifact from back when it was first
created.

Most other applications now have a "MainWidget" class of some sort
which handles setting up all the UI/menubars, etc. More importantly,,
it also lets us handle application-wide events which we were
previously not able to do directly, since the main widget was just
a default GUI::Widget.

This patch moves all the core functionality of the PixelPaint
application into PixelPaint::MainWidget, which is then instantiated
by the main function. There is likely some more refactoring that
would help, but this commit is big enough as it is doing mostly
a direct port.
2021-09-06 10:36:08 +02:00
Tobias Christiansen
508d563189 PixelPaint: Add ProjectLoader to abstract away opening of files
This new class will open and parse files (either images directly or .pp
project files) and one can get the parsed Image as well as other
information from it.

This patch removes a bunch of 'try_create_from..." methods from Image in
favor of using the ProjectLoader.

The only json_metadata that is available are Guides for now.
2021-09-04 03:29:09 +02:00
Tobias Christiansen
abcb982485 PixelPaint: Rename CreateNewGuideDialog to EditGuideDialog
This doesn't change the behavior at all but sets the naming up be more
descriptive on what it does in the next patches.
2021-09-01 13:46:44 +02:00
Timothy
1927dbf025 PixelPaint: Use unveil to hide file system 2021-08-07 12:48:22 +02:00
Tobias Christiansen
7923929a4d PixelPaint: Add GuideTool for editing Guides
This patch adds the logic for the GuideTool. Pulling in from outside the
image creates a new Guide, moving a Guide outside of the image deletes
it and a Guide can be deleteted via the context menu.
A Guide is considered clicked when the cursor is less than 20 pixels
away from the line.
2021-08-07 02:52:47 +04:30
Tobias Christiansen
515bbd0b83 PixelPaint: Add a Dialog for the creation of a Guide
You can select whether you want a horizontal or a vertical Guide and
specify the offset you want it to be at.
2021-08-07 02:52:47 +04:30
Davipb
0828c75e57 PixelPaint: Add a Mask class
The Mask class represents an opacity mask over a rectangular section
of an image, linking every pixel to an alpha value ranging from 0 (not
selected) to 255 (fully selected). "Partially selected" pixels can be
used to simulate anti-aliased curves.

This class will be used as the basis for the new non-rectangular
selection feature.
2021-06-22 11:00:00 +02:00
Gunnar Beutner
631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Andreas Kling
1b897ec561 PixelPaint: Add a Selection class (ImageEditor has a Selection)
This will represent a complex, region-based selection in the future.
For now though, it's just a simple rectangle. :^)
2021-06-14 18:25:17 +02:00
Andreas Kling
4bd905de0e PixelPaint: Add a new "Rectangle Select" tool :^)
This patch only adds the tool along with a toolbar icon for it.
It doesn't do anything yet.
2021-06-14 18:25:17 +02:00
Andreas Kling
68a307be4e PixelPaint: Use ImageDecoder to load images out-of-process
This sandboxes the image decoding work done by PixelPaint to prevent
bugs in the decoding framework from compromising PixelPaint itself. :^)
2021-06-12 11:19:29 +02:00
Andreas Kling
8c044d4f52 PixelPaint: Convert main UI to GML :^) 2021-05-16 01:11:56 +02:00
lucastarche
fa9dfa3da1 PixelPaint: Added Zoom tool 2021-03-23 08:21:08 +01:00
Andreas Kling
dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00
Renamed from Applications/PixelPaint/CMakeLists.txt (Browse further)