stacked layout * ControlObject initialised the wrong way?

Asked by ronso0

I built a skin (http://www.mixxx.org/forums/viewtopic.php?f=8&t=8578) where I integrated a skin settings menu like in Deere.
This menu is stacked on top of main part of skin (not inside it to not disturb SizeAwareStacks).
No matter which value I give to the corresponding custom ControlObject which is toggling the visibility in skin.xml: menu is visible after starting MIxxx. It seems this CO just isn't picked up correctly.
When I set it to 0 the toggle_button is in zero-state (invisible) but the menu is visible anyway. Pressing the button toggles to 1 and menu is still visible, pressing it again finally hides the menu.
When I initially set it to 1 button and menu are both in 1-state and visible (expected). This is how left it to avoid any confusion, though I suppose I/we don't need skin settings at every start.

It doesn't matter if persist="" is true or false.
It doesn'tmatter if I put it mixxx.cfg before starting.
Do I have to put that declaration in a special place/order in skin.xml? I just don't get it..
All other COs work correct.
Thanks for any help!

To clearify:
in skin.xml I have
<attribute persist="true" config_key="[FlatNite],show_skin_settings">0</attribute>
and below
<WidgetGroup>
   <ObjectName>SkinContainer</ObjectName>
      <Layout>stacked</Layout>
      <SizePolicy>me,me</SizePolicy>
      <Children>
-> <Template src="skin:skin_settings.xml"/>
         <WidgetGroup><!-- "rest" of UI -->
            ...
         </WidgetGroup>
      </Children>
</WidgetGroup>

skin_settings.xml
<Template>
   <WidgetGroup>
      <Children>
         ...
      </Children>
      <Connection>
-> <ConfigKey>[FlatNite],show_skin_settings</ConfigKey>
         <BindProperty>visible</BindProperty>
      </Connection>
   </WidgetGroup>
</Template>

Question information

Language:
English Edit question
Status:
Solved
For:
Mixxx Edit question
Assignee:
No assignee Edit question
Solved by:
Daniel Schürmann
Solved:
Last query:
Last reply:
Revision history for this message
Daniel Schürmann (daschuer) said :
#1

Does the forum attached skin contains the code of this question?
If not, please attach.

Revision history for this message
ronso0 (ronso0) said :
#2

Yeah, the skin in the forum is the same. There in skin.xml I set
[FlatNite],show_skin_settings to "1" to avoid that double click to close.

Revision history for this message
Best Daniel Schürmann (daschuer) said :
#3

The issue is that QT sets the first (top) widget in a stacked layout visible.
Your skin_settings is the top widget.
You can work around it, by adding an other widget of 0 size on top of it.

      <WidgetGroup>
       <Size>0f,0f</Size>
      </WidgetGroup>

I think this is an unexpected behaviour and it should be finally fixed inside the C++ domain.
for this QStackedLayout::StackAll stacked layout.

I also noticed an other issue in your skin in button_2state.xml:
<EmitOnPressAndRelease>true</EmitOnPressAndRelease>
should be removed. In this case, the visible state is set twice.

You could probably remove all these options, since Mixxx "learns " the right behavior from the connected control.

Revision history for this message
ronso0 (ronso0) said :
#4

Great! Added this extra zero-size WidgetGroup, now it works.
Thank you!

Revision history for this message
ronso0 (ronso0) said :
#5

Thanks Daniel Schürmann, that solved my question.