Commit graph

19 commits

Author SHA1 Message Date
Andreas Kling
575b674081 LibGUI: Add missing window() null check when widget's child is removed
Before notifying our window that a child was removed, we should first
check that we actually have a window! :^)
2020-05-12 14:06:25 +02:00
Andreas Kling
9d6c85e6a6 LibGUI: Remove ancient code for debugging widget underdraw 2020-05-12 13:43:37 +02:00
Andreas Kling
0f0d73d1b5 LibGUI: Make the "enabled" widget state propagate to child widgets
This simplifies building composite widgets by not having to worry about
updating widget subtrees.
2020-05-08 13:49:58 +02:00
Andreas Kling
42f0b2522b LibGUI: Introduce widget content margins + improve splitters
A GUI::Widget can now set an optional content margin (4x0 by default.)
Pixels in the content margin will be ignored for hit testing purposes.

Use this to allow frame-like widgets (like GUI::Frame!) to ignore any
mouse events in the frame area, and instead let those go to parent.

This allows GUI::Splitter to react "sooner" to mouse events that were
previously swallowed by the child widgets instead of ending up in the
splitter. The net effect is that 2 more pixels on each side of a
splitter handle are now interactive and usable for splitting! :^)
2020-04-24 19:05:02 +02:00
Tibor Nagy
9e6e731a78 LibGUI: Remove G prefix from macros 2020-03-19 23:17:34 +01:00
Oriko
2a32330257 LibGUI: Add a ThemeChange event 2020-03-16 13:39:34 +01:00
Andreas Kling
3edcaa9b99 LibGUI: Implement set_property() on Widget and AbstractButton
This makes it possible for an RPC client to modify some interesting
widget properties.
2020-03-05 15:50:22 +01:00
Andreas Kling
4d5e144a6b LibGUI: Forget some of Window's widgets eagerly on widget unparenting
Previously the focused widget would only get cleared on replacement or
on destruction (being a WeakPtr and all.) This could lead to window
dispatching events to a focused widget after it had been removed from
the window's widget tree.

The same issue existed for the hovered widget, etc. So this patch
makes sure that we eagerly clear the various widget pointers in Window
immediately when they are removed from the window's widget tree.
2020-03-05 15:48:57 +01:00
Andreas Kling
e23c5b7e83 LibGUI+Inspector: Highlight the currently remotely inspected widget
This patch adds a magenta rectangle around the currently inspected
widget. This allows you to browse an app's widget tree somewhat
visually using the Inspector. :^)
2020-03-05 14:42:05 +01:00
Andreas Kling
849fdc1c0b LibGUI: Make Layout a Core::Object and add basic serialization
This allows you to view layouts (as data) in Inspector.
2020-03-05 09:22:43 +01:00
Andreas Kling
6fa104ffd3 LibGUI: Ignore keyboard and mouse events in disabled widgets 2020-03-04 23:47:27 +01:00
Andreas Kling
e4f433dddd LibGUI: Remove unused GUI::Widget::click_event() 2020-03-04 21:21:46 +01:00
Andreas Kling
ceec1a7d38 AK: Make Vector use size_t for its size and capacity 2020-02-25 14:52:35 +01:00
Andreas Kling
c5d913970a LibGUI: Remove parent parameter to GUI::Widget constructor 2020-02-23 12:27:53 +01:00
Andreas Kling
e1ff4fa034 LibGUI: Remove more header dependencies from Widget.h 2020-02-15 00:24:14 +01:00
Andreas Kling
34c7322d77 LibGUI: Remove some header dependencies from Widget.h 2020-02-14 23:53:11 +01:00
Andreas Kling
3ce80bec97 WindowServer+LibGUI: Add a "drag move" event
This allows windows/widgets to learn when something is being dragged
over them. They can then repaint themselves somehow to indicate that
they are willing to accept a drop.

Currently this is piggybacking somewhat on the mouse event mechanism
in WindowServer. I'm not sure that's the best design but it seemed
easier to do it this way right now.
2020-02-13 21:43:32 +01:00
Andreas Kling
f4fa758959 LibGUI: Add a Widget::did_layout() that gets called after layout
This will allow widgets to implement post-layout behaviors.
2020-02-11 11:53:38 +01:00
Andreas Kling
6a9cc66b97 LibGUI: Remove leading G from filenames 2020-02-06 20:33:02 +01:00
Renamed from Libraries/LibGUI/GWidget.cpp (Browse further)