Commit Graph

5 Commits

Author SHA1 Message Date
c9c7b33647 Tooltips: how to draw on top of all widgets
By default, Tooltips will present after their associated widget presents
(if the mouse cursor is hovering over that widget, and the tooltip
should appear). But the tooltip is not guaranteed to draw "on top" of
neighboring doodads, unless you choose your Edge carefully depending on
the order you're drawing your widgets.

To solve this, Tooltips can be supervised to DrawOnTop() when they're
activated. To opt in, you simply call the Tooltip.Supervise() function
with your supervisor.
2022-03-05 22:41:20 -08:00
e675ead0ed WIP Themes Support 2020-06-17 18:04:18 -07:00
7d9ba79cd2 Window Manager Basics, Work in Progress
* Adds Window Manager support to the Supervisor, so that Window widgets
  can be dragged by their title bar, clicked to focus, etc.
* Create a ui.Window as normal, but instead of Packing or Placing it
  into a parent container as before, you call .Supervise() and give it
  your Supervisor. The window registers itself to be managed and drawn
  by the Supervisor itself.
* Supervisor manages the focused window order using a doubly linked
  list. When a window takes focus it moves to the top of the list.
  Widgets in the active window take event priority.
* Extended DragDrop API to support holding a widget pointer in the drag
  operation.
* Changed widget event Handle functions to return an error: so that they
  could return ErrStopPropagation to prevent events going to more
  widgets once handled (for important events).

Some bugs remain around overlapping windows and event propagation.
2020-04-06 22:57:28 -07:00
49f108f302 Prevent tooltips from clipping outside window boundaries 2020-03-09 22:24:04 -07:00
f9b305679a Tooltip Widget and Event Refactor
* Tooltip can be added to any target widget (e.g. Button) and pop up on
  mouse over.
* Refactor the event system. Instead of passing a render.Point to all
  event handlers, pass an EventData struct which can hold the Point or
  the render.Engine.
* Add event types Computed and Present, so a widget can set a handler on
  whenever its Computed or Present method is called.
2020-03-09 17:13:33 -07:00