mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:07:34 +00:00
PaintBrush: Add a PaletteWidget to allow color selection.
Also use different colors for left/right mouse button. :^)
This commit is contained in:
parent
642c82fbff
commit
f86b1bdca1
6 changed files with 82 additions and 9 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "PaintableWidget.h"
|
||||
#include "PaletteWidget.h"
|
||||
#include <LibGUI/GApplication.h>
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GWindow.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -8,10 +10,16 @@ int main(int argc, char** argv)
|
|||
|
||||
auto* window = new GWindow;
|
||||
window->set_title("PaintBrush");
|
||||
window->set_rect(100, 100, 600, 400);
|
||||
window->set_rect(100, 100, 600, 432);
|
||||
|
||||
auto* paintable_widget = new PaintableWidget(nullptr);
|
||||
window->set_main_widget(paintable_widget);
|
||||
auto* main_widget = new GWidget(nullptr);
|
||||
window->set_main_widget(main_widget);
|
||||
main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
main_widget->layout()->set_spacing(0);
|
||||
|
||||
|
||||
auto* paintable_widget = new PaintableWidget(main_widget);
|
||||
auto* palette_widget = new PaletteWidget(*paintable_widget, main_widget);
|
||||
|
||||
window->show();
|
||||
return app.exec();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue