Commit Graph

410 Commits

Author SHA1 Message Date
Andreas Kling
c812d63ea6 GWidget: Remove unnecessary extra parent lookup in move_to_{back,front}(). 2019-04-16 04:01:14 +02:00
Andreas Kling
04500c1ae2 GWidget: Add some new child z-ordering facilities.
- child_at(Point)
- move_to_front()
- move_to_back()
- is_frontmost()
- is_backmost()

This patch also makes it possible to receive the mouse event that triggers
a context menu before the context menu is shown. I'm not sure this is the
best design for context menus but it works for now.
2019-04-16 03:47:55 +02:00
Andreas Kling
73c70e5d2e GTableView: Remove the old-style focus rect. 2019-04-16 03:04:14 +02:00
Andreas Kling
6dc9a6ef42 GWidget: Add direct setters for x, y, width & height. 2019-04-14 04:10:43 +02:00
Andreas Kling
3f6408919f AK: Improve smart pointer ergonomics a bit. 2019-04-14 02:36:06 +02:00
Andreas Kling
91e1f3ffb1 LibGUI+WindowServer: Add a way to dismiss opened menus from the client. 2019-04-14 01:53:19 +02:00
Andreas Kling
c09c114d77 WindowServer+LibGUI: Add ability to set per-window icons.
The icons are passed around as filesystem paths for now, since the shared
memory bitmaps only support 2 sides.
2019-04-13 16:59:55 +02:00
Andreas Kling
7a74b76769 GWidget: Silence debug spam about the click clock. 2019-04-13 16:15:47 +02:00
Andreas Kling
0f4050903d GVariant: Add to_bool(), to_int() and to_color(). 2019-04-13 12:39:20 +02:00
Andreas Kling
a90e218c71 Minesweeper: Start working on a simple minesweeper game. :^) 2019-04-13 03:08:16 +02:00
Andreas Kling
c06a3bdeb4 LibGUI+WindowServer: Add support for per-GWidget context menus.
You can now simply assign a GMenu as a GWidget's context menu and it will
automagically pop up on right click. :^)
2019-04-12 17:18:13 +02:00
Andreas Kling
c98bbff0cb VisualBuilder: Add some widget-specific properties. 2019-04-12 15:17:53 +02:00
Andreas Kling
3674bb9429 GVariant: Tweak stringification of Color, Boolean and Invalid variants. 2019-04-12 14:49:45 +02:00
Andreas Kling
8f4c59c276 GVariant: Don't crash when extracting a null String. 2019-04-12 14:43:44 +02:00
Andreas Kling
054c982181 LibGUI+WindowServer: Add support for enabled/disabled actions.
The enabled state of a GAction now propagates both to any toolbar buttons
and any menu items linked to the action. Toolbar buttons are painted in
a grayed out style when disabled. Menu items are gray when disabled. :^)
2019-04-12 02:53:27 +02:00
Andreas Kling
32e5c8c689 GTextEditor: Add on_selection_changed callback.
This is probably a bit eager and won't coalesce all updates or even
ignore no-op changes to the selection.
2019-04-12 02:52:34 +02:00
Andreas Kling
269886fc4e GWidget: Add "enabled" state for widgets.
There's nothing magical that happens for painting, each widget needs to
handle it manually in their painting code.
2019-04-12 02:51:16 +02:00
Andreas Kling
47a2982119 LibCore: Move LibGUI/GTimer to LibCore/CTimer. 2019-04-12 00:09:45 +02:00
Andreas Kling
c425bc2e71 GVariant: Add Point, Size and Rect variant types. 2019-04-11 22:52:34 +02:00
Andreas Kling
c57cf9834b LibGUI: Add GVariant copy constructor. 2019-04-11 21:36:04 +02:00
Andreas Kling
52152e171b GVariant: Zero out invalid GVariants to unconfuse debugging. 2019-04-11 17:28:59 +02:00
Andreas Kling
ef23ed7ef1 GTableView: Handle not having a model a bit more gracefully. 2019-04-11 17:26:30 +02:00
Andreas Kling
93b76628a5 GGroupBox: Improve appearance with new FrameShape::Box style. 2019-04-11 14:27:31 +02:00
Andreas Kling
16990fece3 GScrollBar: Improve appearance for curiously-shaped scrollbars. 2019-04-11 13:16:43 +02:00
Andreas Kling
b5d1cfef58 VisualBuilder: Add icons to the toolbox, and support for GProgressBar. 2019-04-11 06:08:06 +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
d8e1545783 LibCore: Move LibGUI/GLock to LibCore/CLock. 2019-04-10 22:39:59 +02:00
Andreas Kling
ab1c84cf53 LibCore: Move HTTP classes from LibGUI to LibCore. 2019-04-10 22:28:10 +02:00
Andreas Kling
cfd6e6cc36 LibCore: Move GIODevice hierarchy from LibGUI to LibCore. 2019-04-10 20:22:23 +02:00
Andreas Kling
fc1d3074de LibCore: Move LibGUI/GNotifier to LibCore/CNotifier. 2019-04-10 17:35:43 +02:00
Andreas Kling
b2542414d7 LibCore: Add CEventLoop and make LibGUI/GEventLoop inherit from it.
This is shaping up to be quite nice.
2019-04-10 17:30:58 +02:00
Andreas Kling
2f1f51b8ab LibCore: Move LibGUI/GObject to LibCore/CObject. 2019-04-10 17:01:54 +02:00
Andreas Kling
b8062f69d8 LibCore: Add CEvent and make LibGUI/GEvent inherit from it. 2019-04-10 16:56:55 +02:00
Andreas Kling
5e0577a042 Introduce LibCore and move GElapsedTimer => CElapsedTimer.
I need a layer somewhere between AK (usable both by userspace and kernel)
and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-10 16:14:44 +02:00
Andreas Kling
55811f233f LibGUI+WindowServer: Coalesce paints and resizes on the client side.
Only process paint and resize events on the GUI client side if those events
have the latest up-to-date window size. This drastically reduces async
overdraw during interactive resize.
2019-04-10 15:39:28 +02:00
Andreas Kling
0ac55f2c38 GWindow: Discard wrongly-sized backing stores in set_rect().
The WindowServer still holds on to at least one backing store in case it
needs to paint us again before we can render a new one. This ensures that
we don't end up stuck with an undersized backing store.
2019-04-10 14:35:13 +02:00
Andreas Kling
d4818dd2dd WindowServer: Give windows a "background color" to use for missing parts.
When resizing a window, we often end up having to paint some part of it
without coverage in the current backing store. This patch makes those cases
look nicer by having a fallback background color for each window, passed
along with the CreateWindow client message.
2019-04-10 14:29:47 +02:00
Andreas Kling
f6543c5946 LibGUI: Add a simple GGroupBox widget.
This needs some work on the visual side, but it gets the job done already.
2019-04-10 05:52:15 +02:00
Andreas Kling
cf8b117d97 GCheckBox: Paint the box part as a container frame. 2019-04-10 03:44:23 +02:00
Andreas Kling
4ab0cd5d4c LibGUI: Move frame painting from GFrame to StylePainter.
This way it can be used by others who might not have a GFrame object.
2019-04-10 03:43:46 +02:00
Andreas Kling
313ac51832 LibGUI: Turn GTextBox into a wrapper around a single-line GTextEditor. 2019-04-10 03:08:29 +02:00
Andreas Kling
5ab043a687 GSpinBox: Move increment/decrement button within the widget frame. 2019-04-10 02:09:06 +02:00
Andreas Kling
9311164439 GWidget: Make hit testing respect child z-order.
This was as simple as iterating the children in reverse order. Duh. :^)
2019-04-10 02:08:32 +02:00
Andreas Kling
b8f150457e LibGUI: Repaint GScrollBar without hover highlight immediately on leave. 2019-04-10 01:50:10 +02:00
Andreas Kling
4abffa4dbe GSpinBox: Put nice little arrow glyphs on the buttons. 2019-04-10 01:37:08 +02:00
Andreas Kling
4c0f586f2b LibGUI: Add a spinbox widget.
This is essentially a combo widget containing a single-line GTextEditor
and two buttons for increment and decrement. The GTextEditor::on_change
callback is hooked to prevent non-numeric input but it's not entirely
perfect since that callback is asynchronous. This will work until we have
some more sophisticated input validation mechanism though.
2019-04-09 16:29:00 +02:00
Andreas Kling
151b7149e6 GTextEditor: Add GTextEditor::on_change callback for when content changes. 2019-04-09 16:20:36 +02:00
Andreas Kling
7f2eeb0b35 LibGUI+WindowServer: Add support for GWidget tooltips.
Any GWidget can have a tooltip and it will automatically pop up below the
center of the widget when hovered. GActions added to GToolBars will use
the action text() as their tooltip automagically. :^)
2019-04-08 18:58:44 +02:00
Andreas Kling
3e175c9a96 LibGUI: Move GSocketAddress to its own file. 2019-04-08 17:19:35 +02:00