We were using a roundabout method of checking if an event matched
(should be looked at) to a widget. It broke down when you want to have
a compound widget where the top one gets all the events and directs them
to widgets inside.
Now we call matchEvent() on the widget and it says if the given event
should be looked at.
We are moving from passing in options (like whether to process events
and what stuff to draw) to install() to having a few more
functions per widget.
Instead of customizing a widget via options, the
idea is to start with the functions called in the high-level api
(like button()), and then adjust as needed.
When I consolidated captureMouseMaintain into WidgetData, I forgot that
floating windows (FloatingWindow and Popup) need to call
captureMouseMaintain after they add themselves with
subwindowCurentSet/subwindowAdd.
Otherwise it breaks being able to drag modal dialogs.
This used to be done in each widget, but it should always happen.
labelClick() showed how a widget that doesn't normally capture the mouse
could be used in that way.
The original entypo cc.svg didn't convert and looked very strange
compared to the ccw.svg. I manually mirrored ccw.svg to produce a
working cc.svg that converted into tvg.
Also examples now have buttons to adjust size/rotation of the icons and
images
I did that under the assumption that menus would largely be vertical.
Now I think having a default expand that's not .none is a mistake. It's
too hard to remember which things have which defaults.
When you use beginWait()/waitTime() so that dvui manages the framerate
for you, it maintains an estimate of how much time is spent outside of
dvui's begin/end.
This estimate is used as part of what waitTime() returns to more
accurately hit timer deadlines. The estimate is only updated when we are
trying to wait for a timer and are not woken by an event.
Previously this estimate (in microseconds) was adjusted by how many
frames we had been adjusting it in the same direction.
Now we adjust it by 2^number of frames. This should reduce the amount
of frames it takes for the estimate to find the "true" value.
Also show the internal estimate in the clock example.
The debug window got a new button that toggles whether refresh logs who
is calling it.
These helped me figure out where a spurious refresh was coming from.
In my case, the fps labels were changing size (because fps went from 10
to 9), and any widget that changes its minimum size triggers a refresh.
One solution is to pad the text. Another is to specify a
min_size_content width.
If compiling in Debug or ReleaseSafe modes, we now save the typeName in
dataSet, and check that against the type given to dataGet.
Also includes some fixes to textLayout that were revealed by this.
* QT_AUTO_SCREEN_SCALE_FACTOR - if 0 we won't guess content scale from
SDL2's dpi
* QT_SCALE_FACTOR - force content scale
* GDK_SCALE - force content scale
Hopefully these help improve the default content scale for some people.
* Heuristically this seems to work. Generally the new windows show up
where the user us currently interacting.
* Also we nudge the new window downright if it's directly on top of
either the previously focused window or the previously highest. This
helps prevent duplicate error alerts from exactly overlapping.
* .window_avoid = .nudge continues to nudge the window until it's no
longer above any other window (but may still do so at the bottom right
of the screen)
* For custom placement, after FloatingWindowWidget.init(), user code can
modify the widget's rect (probably only want to do so if the rect has
width/height, because it's zero-sized on the first frame)