Commit Graph

375 Commits

Author SHA1 Message Date
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
Andreas Kling
bcc00857a4 AK: Revert Eternal<T> for now since it doesn't work as intended. 2019-04-05 05:14:20 +02:00
Andreas Kling
64a5abf8db Taskbar: Only include "Normal" windows in the taskbar window list. 2019-04-04 16:23:23 +02:00
Andreas Kling
82b02ed82b LibGUI: Use TextElision::Right for GButton captions. 2019-04-04 15:20:02 +02:00
Andreas Kling
89c544d97b LibGUI: Allow specifying GButton text alignment. 2019-04-04 14:15:57 +02:00
Andreas Kling
7b1384c4ef Taskbar: Plumb window active state from the WindowServer to the taskbar. 2019-04-04 13:19:26 +02:00
Andreas Kling
19eb814850 LibGUI: Make it possible for GButton to be checkable. 2019-04-04 13:18:27 +02:00
Andreas Kling
96104b5524 Taskbar: More bringup work. We now see a basic window list. 2019-04-04 01:44:35 +02:00
Andreas Kling
aa03a07e61 Taskbar+LibGUI: More work on bringup. 2019-04-03 21:04:16 +02:00
Andreas Kling
a22774ee3f Taskbar: Start working on a taskbar app.
I originally thought I would do this inside WindowServer, but let's try to
make it as a standalone app that communicates with WindowServer instead.
That will allow us to use LibGUI. :^)
2019-04-03 19:38:44 +02:00
Andreas Kling
318db1e48e WindowServer: Broadcast screen rect changes to all clients.
GUI clients can now obtain the screen rect via GDesktop::rect().
2019-04-03 17:22:14 +02:00
Andreas Kling
c02c9880b6 AK: Add Eternal<T> and use it in various places.
This is useful for static locals that never need to be destroyed:

Thing& Thing::the()
{
    static Eternal<Thing> the;
    return the;
}

The object will be allocated in data segment memory and will never have
its destructor invoked.
2019-04-03 16:52:25 +02:00
Andreas Kling
528054d192 GWindow: Don't ignore update(), it should repaint the whole window.
This was causing some apps to have an empty window on startup since the
call to update() in show() was effectively a no-op.
2019-04-03 15:54:16 +02:00
Andreas Kling
401d3662c6 GInputBox: Make the input text box a bit taller. 2019-04-02 20:48:37 +02:00
Andreas Kling
76ce68ac48 GSocket: Add a connect() overload that takes a hostname instead of an IP. 2019-04-02 20:40:10 +02:00
Andreas Kling
17e02e7450 Move NetworkOrdered.h to AK/ since it's used in both kernel and userspace. 2019-04-02 20:04:54 +02:00
Andreas Kling
b797458962 GTreeView: Support navigating the tree with the up/down keys. 2019-04-02 03:18:26 +02:00
Andreas Kling
6673284b06 LibGUI: Switch to a resizing cursor when hovering or using a GSplitter.
Also expose the various standard cursors on WSWindowManager so they can
be reused by the override mechanism.
2019-04-02 02:34:09 +02:00
Andreas Kling
c9b0d87927 LibGUI: Fix broken doubleclick detection due to uninitialized GElapsedTimer. 2019-04-01 22:03:32 +02:00
Andreas Kling
dcf6726487 WindowServer: Add support for per-window override cursors.
Use this to implement automatic switching to an I-beam cursor when hovering
over a GTextEditor. :^)
2019-03-31 23:52:02 +02:00
Andreas Kling
25f28a54a1 Terminal+LibGUI: Make the terminal cursor blink.
Added a GTimer class to help with this. It's just a simple GObject subclass
that sets up an event loop timer and invokes a callback on timeout.
2019-03-30 21:40:57 +01:00
Andreas Kling
6d9fa1026b LibGUI: Fix bad initial layout of GScrollableWidget's scrollbars.
If it's the first time we're laying these out, we can't rely on the width()
or height() to be set, so instead use preferred_size().
2019-03-30 20:42:41 +01:00
Andreas Kling
9ac5909394 LibGUI: Highlight the GSplitter when hovering over it. 2019-03-30 14:04:53 +01:00
Andreas Kling
9538c06a45 LibGUI: Add a simple GSplitter container widget.
This allows you to put multiple widgets in a container and makes the space
in between them draggable to resize the two adjacent widgets.
2019-03-30 13:53:30 +01:00