Instead of determining the focus item through item tree traversal and
pointer comparison and storing the intermediate indices in the
components in the tree, remember the focus item by a pair of
VWeak<ComponentVTable, Dyn> and item_index: usize.
This speeds up determining the focus item as well as delivering events,
which can now be done directly after retrieving an ItemRef with
get_item_ref.
This also fixes the duplicate line edit focus in the 7gui cells
test case.
This also removes the funny binding on the button in the gallery.
UI wise it's confusing that a button changes its size when pressed, and we can
show off bindings somewhere else :-)
* Set the Enabled state throughout the "widgets". This corrects the visual appearance of Button and CheckBox in particular.
* Render a button that's not down as raised, in order to show its outline.
The Q_WS_MAC pre-processor macro does not exist anymore. The original
reason for the widget was erroneously applied - the cocoa controls
themselves are NSViews and it's just that the backing store view in the
style will be nil -- that seems to make no visual difference though.
Draw rounded rectangles using a distance function. This removes the need
to use lyon to tesselate the rounded corners and as a bonus it gives
anti-aliased borders.
Given choice of ONE_MINUS_SRC_ALPHA blending function, we assume not
only that textures are pre-multiplied with their alpha (see commit
bf396ad578), the same applies also to
flat colors.
This fixes blending such as this:
App := Window {
Text {
text: "Hello World";
}
Rectangle {
color: #ff335588;
width: 100%;
height: 100%;
}
}
Similar to the parent commit, don't calculate the native_padding_* as a side-effect of calling
layout_info(), but calculate it property through a binding.
Setting the value of the native_padding_{left, right, top, bottom}
properties *during* the layout_info() call is too late, as the calling
compute_layout implementation has already queried for those properties.
Instead, this patch moves the padding calculation into a shared property
binding that's queried from bindings to the individual native_padding_*
properties and layout_info() just uses the properties, too.