The Tab currently doesn't do anything with the focus, but this
serves as a workaround for #798 so that inner widget of a tab can't
keep the focus when they are hidden
cc #798
Because we currently don't have a way to detect when the popup is closed
we workaround the problem by never show the combo box as open.
Workaround #456
The button bevel was rendered upside down, which happens due to some
weird double y-axis inversion, which goes away when passing the QWidget
pointer to the style. When using the Qt backend, we can do that.
- The Tab must be drawn before the contents, because the style draws something under the active tab,
outside of its region
- Also set the QStyleOptionTab::HasFrame flag since we are in the equivalent of a QTabWidget
Some styles recompute the size based on the contents given in the QStyleOptionButton,
Some styles need to be given the icon in their content size. And this was not done properly
Set QStyle::State_Active conditional to whether the window is active,
which maps to Qt's active window concept and winit's has-focus (until we
render popups differently).
It was impossible to see which tab was the current tab.
Ensure that we set State_Active, like we do for the other styled controls.
Later, the active state should be tied to whether the window is "active" or not.
The metrics properties and the implementation of layout_info needs to
strictly reading cross-axis properties to avoid circular dependencies.
This patch applies a INT_MAX / 2 on the cross-axis to QStyle when
querying. Mostly the styles appear to just add/subtract margins, so this
value should not produce overflows while still providing an
approximation of "infinite" :)
Fixes#412