1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:47:46 +00:00

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.
This commit is contained in:
Mustafa Quraish 2021-09-06 00:11:46 -04:00 committed by Andreas Kling
parent bbddfeef4b
commit 5a8c6b95e6
4 changed files with 856 additions and 785 deletions

View file

@ -24,6 +24,7 @@ set(SOURCES
LayerListWidget.cpp
LayerPropertiesWidget.cpp
LineTool.cpp
MainWidget.cpp
main.cpp
MoveTool.cpp
PaletteWidget.cpp