Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Kling
a747a10eab LibGUI: Refactor context menus to be event-driven instead of declarative.
The declarative approach had way too many limitations. This patch adds a
context menu event that can be hooked to prepare a custom context menu on
demand just-in-time. :^)
2019-04-18 04:12:27 +02:00
Andreas Kling
ef8c613737 VisualBuilder: Share code for setting the selected widget.
This fixes an issue where the properties window didn't update when selecting
a new widget using the keyboard shortcuts. :^)
2019-04-16 23:11:35 +02:00
Andreas Kling
f7157520eb VisualBuilder: Add some keyboard navigation support.
Allow selecting widgets using the Tab key, and moving them around
using the arrow keys. :^)
2019-04-16 23:01:37 +02:00
Andreas Kling
52e846df87 VisualBuilder: Make it possible to move widgets to front/back. 2019-04-16 03:52:26 +02:00
Andreas Kling
707bfe848d VisualBuilder: Add a table view with the selected widget's properties. 2019-04-11 21:41:09 +02:00
Andreas Kling
f52e66ceda VisualBuilder: Add a widget registry and a property class.
I need somewhere to centralize the knowledge about the different widget
types available. And VBProperty represents a property key/value of arbitrary
type (it uses a GVariant for the value.)
2019-04-11 16:13:19 +02:00
Andreas Kling
07a9b2c4e6 VisualBuilder: Let's use 5 pixels for the grid size for now. 2019-04-11 13:16:18 +02:00
Andreas Kling
75c76f6692 VisualBuilder: Make it possible to insert widgets from the toolbox. 2019-04-11 04:13:11 +02:00
Andreas Kling
c71ece77fa VisualBuilder: Tweak grid size and add an (empty) toolbox window. 2019-04-11 04:01:17 +02:00
Andreas Kling
c6ffb3e2b8 VisualBuilder: Use real GWidgets instead of pretend VBWidgets.
That first design was the wrong idea. Instead, have VBWidget instantiate
a GWidget of the appropriate type and parent it to the VBForm.
We then use a new "greedy hit-testing" mechanism in GWidget to prevent any
mouse events from reaching the VBForm's children.

To paint the grabbers above the child widgets, I added a slightly hackish
but kind of neat second_paint_event() that is called after a widget has
painted all of his children. :^)
2019-04-11 03:34:37 +02:00
Andreas Kling
d73f79a2d2 VisualBuilder: Allow resizing widgets using their grabbers. 2019-04-11 02:35:30 +02:00
Andreas Kling
3c8e53ef2b VisualBuilder: Work on selecting a widget and moving it around. 2019-04-11 01:59:07 +02:00
Andreas Kling
8268ece1bd VisualBuilder: Start working on an interface builder application.
It's tedious making interfaces programmatically. Let's make a program to
help us with this. :^)
2019-04-11 00:05:47 +02:00