Commit Graph

398 Commits

Author SHA1 Message Date
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
Andreas Kling
93a4a4c597 Taskbar: Replace TaskbarWidget with a simple GFrame.
There's no need for a custom widget here, at least not now.
2019-04-08 17:17:16 +02:00
Andreas Kling
6d5a54690e LibGUI: Make GSocket connection asynchronous.
Now connect() will return immediately. Later on, when the socket is actually
connected, it will call GSocket::on_connected from the event loop. :^)
2019-04-08 04:56:11 +02:00
Andreas Kling
7fcca0ce4b GHttp: Rename GHttpNetworkJob => GHttpJob. And tidy up a little bit. 2019-04-08 02:24:34 +02:00
Andreas Kling
71b6436552 GHttp: Fix little bug in HTTP header parsing. 2019-04-07 22:47:34 +02:00
Andreas Kling
31b9d8354e GIODevice: Remove accidentally committed debug spam. 2019-04-07 20:18:58 +02:00
Andreas Kling
51b4d3fe5a GHttp: Work on bringing this up. 2019-04-07 19:35:48 +02:00
Andreas Kling
8f30657390 Start working on a Downloader app and backing classes in LibGUI.
LibGUI is slowly becoming LibKitchensink but I'm okay with this for now.
2019-04-07 14:36:10 +02:00
Andreas Kling
e74f32ae40 LibGUI: Always invalidate layout on GWidget child removal.
This code can get a bit confused when the child is destroyed before we
handle the ChildRemoved event. In those cases, the GChildEvent::child()
getter will return nullptr as it's backed by a WeakPtr.

To work around this issue, just always invalidate the layout for now.
This can be made a lot tighter in the future.
2019-04-06 21:15:13 +02:00
Andreas Kling
6306cf5c27 GScrollBar: Add the same hover highlight effect as GButton. 2019-04-06 13:55:56 +02:00
Andreas Kling
ef9fbef4c6 Taskbar: Show minimized window titles in [brackets].
Had to plumb the minimization state from WindowServer to Toolbar in order
to implement this.
2019-04-06 00:58:30 +02:00
Andreas Kling
74142d78c1 LibGUI: GButton's caption should be drawn in the foreground color. 2019-04-06 00:57:31 +02:00
Andreas Kling
99b98dc653 WindowServer: Merge WM_WindowAdded and WM_WindowStateChanged.
These events are identical, so it's silly to send both. Just broadcast
window state changes everywhere instead, it doesn't matter when it was
added as clients are learning about this asynchronously anyway.
2019-04-05 15:01:28 +02:00