Space Aware WidgetStack needed

Bug #1374214 reported by Sergey Ukolov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
Daniel Schürmann

Bug Description

We need space aware WidgetStack to make our skin engine much better and allow skins easily adopt to window size without manual actions.
This "SAWidgetStack" should switch it childrens based on available space (width or height).

For example, we have 3 childrens: [80x20], [130x20] and [170x20].
And we have space, which can changes from 80 to 200 px or more.
SAWidgetStack looks for available space around and if space between 80 and 129 it puts children [80x20], if we have from 130 to 169 space available, then we put [130x20] children, and if we have much than 170px free space we put [170x20] children.

Also, may be, we should have some SAWS priority rules system, because suddenly we can get 2 SAWS in similar space situation and we will have to select one of them to expand if free space going to grow.

Tags: skin resize
Owen Williams (ywwg)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
milestone: none → 1.13.0
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Serge, Thank you for the request.
It is required for your 1.12 skin approach?
I think this is an easy bug, we should have a look at it if you need it hard.

tags: added: easy
Revision history for this message
Owen Williams (ywwg) wrote :

This is not easy, and I don't want to try to get it in for 1.12. Let's work with the skin system we have, even though it has flaws, and take a fresh look at it after release.

tags: removed: easy
Revision history for this message
Daniel Schürmann (daschuer) wrote :

I thought it was only:

class SAWidgetStack : public QStackedWidget {
    void resizeEvent ( QResizeEvent * event ) {
         // deside which Widget in stack fits best
         setCurrentIndex(indexOfBestFiting)
    }
}

+ a syntax to define this from the skin parser.

Revision history for this message
Owen Williams (ywwg) wrote :

Hm, ok maybe it's not so hard. I just don't want to start piling hacks on top of hacks, although maybe that's just what the skin system is anyway.

Revision history for this message
Sergey Ukolov (zezic) wrote :

If it's easy to do (how Daniel says) user would not need to do many clicks to shrink Mixxx width with these SAWidgetStack's, because now without them i'm going to do manual shrinking of some GUI elements (loop grid, for example).
It would be nice if we have this feature for 1.12 so i able to do complete (totally) resizeable skin.

Revision history for this message
Sergey Ukolov (zezic) wrote :

If it's hard to check available free space in Qt i can use special (somehow marked) space holding WidgetGroups in skins, size of which should be checked by SAWidgetStack after resizeEvent.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

We should avoid hacks on top of hacks. I am always a fan of killing the brain bug :-)

I am afraid I have not the overview, to decide if this is one of this kind. But If it is a last missing peace for the 1.12 skinning system I am willing to spend some time.

Is there a similar feature in QML or XAML? Do they provide a solution?

@Serge: Could you provide a draft for the XML syntax?

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Qt makes this pretty hard -- adding a resizeEvent trigger can trigger an infinite loop of layouts because changing the shown index triggers a relayout of the parent (because children sizehints changed) -- which triggers a resize of the child, which triggers a resizeevent -- which triggers...

I think we'll need a custom widget that prevents triggering relayouts of the parent. I think this might be possible by only lying about the sizeHint (i.e. either force SizePolicy ignore or always set to max(sizeHint(children))) so it never changes. If Qt gives us less space than we wanted then we switch to the largest child that fits.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I agree this would be super useful though but we shouldn't include it until we can make sure it doesn't cause a bunch of extra repaints.

Revision history for this message
Sergey Ukolov (zezic) wrote :

@Daniel:

<SAWidgetStack>
    <Layout>horizontal</Layout>
    <Size>me,40</Size>
    <Children>
        <!-- Small children -->
        <WidgetGroup spacemax=39>
            <Children>...</Children>
        </WidgetGroup>
        <!-- Medium children -->
        <WidgetGroup spacemin=40 spacemax=99>
            <Children>...</Children>
        </WidgetGroup>
        <!-- Big children -->
        <WidgetGroup spacemin=100>
            <Children>...</Children>
        </WidgetGroup>
    </Children>
</SAWidgetStack>

For example, in this draft small children displayed even if we have less than 39px space, when free space grows to 40px small children should disappear and medium children have to appear, and when free space grows to 100px medium children disappear and big children appear.

I don't know best way to calculate free space around SAWidgetStack, so i propose to fill available space by it and use it's own size as free space.

Revision history for this message
Sergey Ukolov (zezic) wrote :

Guys, after some thinking i realised this feature is VERY VERY needed for many skin things.
Please, if somebody can do it it will be just awesome. Needed just stack that can switch childrens based on itself size. This solves many problems.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

I hope I find time after finishing the Moog Ladder filter. Or is there someone else with some spare time now?

Revision history for this message
Owen Williams (ywwg) wrote :

I would strongly suggest that you try to make your skins as good as possible without this feature. This is a difficult issue and we're not likely to block the release based on this feature request.

Revision history for this message
Sergey Ukolov (zezic) wrote :

Ok, i make all i can do without that feature. Just found, that i can use SVG to solve some moments.
Now, if resizing SVG for faders (sliders) and buttons will work properly, there is only 2 things, that needed SAWS by and large:
1) Loop grid (to fill maximum space in deck and give maximum visible loop lenghts).
2) FX knobs (to change size of knobs according to number of parameters, to ergonomically fit 4 Echo knobs or 8 EQ knobs in same space).

Revision history for this message
Owen Williams (ywwg) wrote :

I think all of our current shipping effects have 3 or 4 knobs (echo has the most I believe) so you can optimize the layout for 4 knobs.

Changed in mixxx:
assignee: nobody → Daniel Schürmann (daschuer)
Revision history for this message
Daniel Schürmann (daschuer) wrote :
Changed in mixxx:
status: Confirmed → In Progress
jus (jus)
Changed in mixxx:
milestone: 1.13.0 → 1.12.0
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7587

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.