summaryrefslogtreecommitdiff
path: root/Applications/PaintBrush
AgeCommit message (Collapse)Author
2019-12-24LibGUI+LibDraw: Add "Palette" concept for scoped color themingAndreas Kling
GApplication now has a palette. This palette contains all the system theme colors by default, and is inherited by a new top-level GWidget. New child widgets inherit their parents palette. It is possible to override the GApplication palette, and the palette of any GWidget. The Palette object contains a bunch of colors, each corresponding to a ColorRole. Each role has a convenience getter as well. Each GWidget now has a background_role() and foreground_role(), which are then looked up in their current palette when painting. This means that you no longer alter the background color of a widget by setting it directly, rather you alter either its background role, or the widget's palette.
2019-12-23WindowServer+LibGUI: Implement basic color themingAndreas Kling
Color themes are loaded from .ini files in /res/themes/ The theme can be switched from the "Themes" section in the system menu. The basic mechanism is that WindowServer broadcasts a SharedBuffer with all of the color values of the current theme. Clients receive this with the response to their initial WindowServer::Greet handshake. When the theme is changed, WindowServer tells everyone by sending out an UpdateSystemTheme message with a new SharedBuffer to use. This does feel somewhat bloated somehow, but I'm sure we can iterate on it over time and improve things. To get one of the theme colors, use the Color(SystemColor) constructor: painter.fill_rect(rect, SystemColor::HoverHighlight); Some things don't work 100% right without a reboot. Specifically, when constructing a GWidget, it will set its own background and foreground colors based on the current SystemColor::Window and SystemColor::Text. The widget is then stuck with these values, and they don't update on system theme change, only on app restart. All in all though, this is pretty cool. Merry Christmas! :^)
2019-12-20Build: clean up build system, use one shared Makefilejoshua stein
Allow everything to be built from the top level directory with just 'make', cleaned with 'make clean', and installed with 'make install'. Also support these in any particular subdirectory. Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as it runs. Kernel and early host tools (IPCCompiler, etc.) are built as object.host.o so that they don't conflict with other things built with the cross-compiler.
2019-12-17PaintBrush: Shift key constrains LineTool angleZyper
Holding Shift key will constrain the LineTool's line angle to 15 degrees increments. Many graphics editors have similar feature.
2019-12-17PaintBrush: Tools can receive KeyUp eventsZyper
2019-12-09LibGUI: Make GMenu inherit from CObjectAndreas Kling
This is primarily to make it possible to pass a GMenu* where a CObject* is expected.
2019-11-29PaintBrush: Allow canceling a line by pressing the Escape keyAndreas Kling
Sometimes you change your mind mid-line, and just want to get out of the situation. You can now do that :^)
2019-11-29PaintBrush: Add a "line" tool for drawing straight linesAndreas Kling
This implements "preview" of the line by allowing tool subclasses to hook the second_paint_event on the PaintableWidget. Work towards #375.
2019-10-15PaintBrush: Use secondary color for eraser (like in ms_paint)Chyza
Comes with a checkbox to turn it off if you dislike it.
2019-10-01LibGUI+PaintBrush: Fix to GFilePicker and PaintBrush enhancements.Brandon Scott
GFilePicker - Fixed GFilePicker to use new ref-counted construct method to stop crashing on open dialog. - PaintBrush is still crashing on open dialog due to an unrelated issue. PaintBrush - Created 16x16 icon for PaintBrush - Moved Open option into App menu. - Changed help menu to make use of the standardized About dialog.
2019-09-30GMessageBox: Hide the constructor and fix broken usagesAndreas Kling
We no longer support creating CObjects on the stack. Use construct().
2019-09-22LibCore: Remove ObjectPtr in favor of RefPtrAndreas Kling
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22LibCore: Make CObject reference-countedAndreas Kling
Okay, I've spent a whole day on this now, and it finally kinda works! With this patch, CObject and all of its derived classes are reference counted instead of tree-owned. The previous, Qt-like model was nice and familiar, but ultimately also outdated and difficult to reason about. CObject-derived types should now be stored in RefPtr/NonnullRefPtr and each class can be constructed using the forwarding construct() helper: auto widget = GWidget::construct(parent_widget); Note that construct() simply forwards all arguments to an existing constructor. It is inserted into each class by the C_OBJECT macro, see CObject.h to understand how that works. CObject::delete_later() disappears in this patch, as there is no longer a single logical owner of a CObject.
2019-09-21LibGUI: Convert custom widgets and subclasses to ObjectPtrAndreas Kling
2019-09-21GButton: Convert most code to using ObjectPtr for GButtonAndreas Kling
2019-09-21LibGUI: Convert GFrame to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GWindow to ObjectPtrAndreas Kling
2019-09-21LibCore: Remove CTimer::create() overloads in favor of construct()Andreas Kling
2019-09-21LibGUI: Convert GWidget to ObjectPtrAndreas Kling
2019-09-21LibGUI: Convert GSpinBox to ObjectPtrAndreas Kling
2019-09-20GCommonActions: Add "Open..." actionAndreas Kling
Make use of this in PaintBrush and TextEditor. :^)
2019-09-20LibCore: Convert CTimer to ObjectPtrAndreas Kling
2019-09-14LibGUI: Simplify GCommonActions a bitAndreas Kling
Use the same callback signature as GAction so we can just forward it to GAction instead of chaining callbacks.
2019-09-13GMenu: Update apps now that you can create a nameless GMenuAndreas Kling
We had many context menus with names, simply because you were forced to give them names.
2019-09-12PaintBrush: Only send left and right mouse button events to toolsAndreas Kling
Tools don't know what to do with the middle mouse button anyway, so it's better if we just don't pass it along. Fixes #546.
2019-09-05PaintBrush: Added GCommonActionsrhin123
2019-07-25LibCore: Introduce a C_OBJECT macro.Andreas Kling
This macro goes at the top of every CObject-derived class like so: class SomeClass : public CObject { C_OBJECT(SomeClass) public: ... At the moment, all it does is create an override for the class_name() getter but in the future this will be used to automatically insert member functions into these classes.
2019-07-23LibGUI: Get rid of GWindow::should_exit_event_loop_on_close().Andreas Kling
This behavior and API was extremely counter-intuitive since our default behavior was for applications to never exit after you close all of their windows. Now that we exit the event loop by default when the very last GWindow is deleted, we don't have to worry about this.
2019-07-23PaintBrush: Exit the event loop on main window close.Andreas Kling
2019-07-20GWidget: Add set_preferred_size(width, height) overload.Andreas Kling
It was annoying to always write set_preferred_size({ width, height }). :^)
2019-07-18LibDraw: Introduce (formerly known as SharedGraphics.)Andreas Kling
Instead of LibGUI and WindowServer building their own copies of the drawing and graphics code, let's it in a separate LibDraw library. This avoids building the code twice, and will encourage better separation of concerns. :^)
2019-07-16LibGUI: Add input types to GMessageBox.Andreas Kling
Currently the two available input types are: - GMessageBox::InputType::OK (default) - GMessageBox::InputType::OKCancel Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
2019-07-08StringView: Rename characters() to characters_without_null_termination().Andreas Kling
This should make you think twice before trying to use the const char* from a StringView as if it's a null-terminated string.
2019-06-30Meta: Removed all gitignore in the source tree only keeping the root oneVAN BOSSUYT Nicolas
2019-06-30PaintBrush: Make a little icon for the eraser tool.Andreas Kling
2019-06-30GUI: Use Win2K-like "warm gray" color instead of the older colder gray.Andreas Kling
Someone suggested this a long time ago and I never got around to it. So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-28PaintBrush: Add size context menu to SprayToolRobin Burchell
2019-06-28PaintBrush: Add an erase toolRobin Burchell
2019-06-25Move common Application build steps into their own Makefile.commonLawrence Manning
Further consolidation is of course possible, eg the Games/ programs follow the same rules more or less.
2019-06-25PaintBrush: Allow RGBA32 to use the bucket and spray tools.Andreas Kling
Eventually I'd like to do some kind of bitmap layers, and we definitely want alpha channel support then, so let's just not paint ourselves into an uncomfortable corner early on. :^)
2019-06-25PaintBrush: Add support for opening files.Andreas Kling
Obviously this only supports whatever PNG files that load_png() can decode at the moment.
2019-06-23PaintBrush: Implement a thickness setting for the pen tool.Andreas Kling
Painter gains the ability to draw lines with arbitrary thickness. It's basically implemented by drawing filled rects for thickness>1. In PaintBrush, Tool classes can now override on_contextmenu() to provide a context menu for the toolbox button. :^)
2019-06-22PaintBrush: Fix compiler warnings.Andreas Kling
2019-06-22PaintBrush: Add a color picker tool.Andreas Kling
2019-06-21AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.Andreas Kling
2019-06-21PaintBrush: Make a little icon for the spray tool.Andreas Kling
2019-06-17PaintBrush: Make spray circular.Sergey Bugaev
2019-06-17Add a simple spray fill toolRobin Burchell
Could do with some more tweaking no doubt, and it'd be nice to have a circular spray, but this is better than nothing.
2019-06-16PaintBrush: Reduce debug spam in the color editor dialog.Andreas Kling
2019-06-16PaintBrush: Allow editing palette colors by ctrl-clicking them.Andreas Kling
Maybe the ColorDialog class could be fashioned into something generally usable in LibGUI, but for now it lives in the PaintBrush app. :^)