launcher icon indicating copy to clipboard operation
launcher copied to clipboard

Quick switch

Open mottosso opened this issue 8 years ago • 13 comments

Goal

Save time browsing for assets.

Implemenation

Mimic the Windows Explorer mechanism of browsing to an arbitrary level in any of the currently selected levels.

image

mottosso avatar Apr 29 '17 14:04 mottosso

Does this mean clicking on "assets" and directly going there? Or do you mean the pop-up list when clicking on the arrows in-between?

I'm looking for the first actually and tried adding index in the controller.pop() for the Breadcrumbs.qml (which is a QML Repeater) but somehow the index is always 1. Any idea how to pass to Python what index or button is pressed of the repeater?

BigRoy avatar Oct 29 '17 12:10 BigRoy

I mean both, but the former is a good first step.

As for how to go about it, if you mean this controller.pop() then I think you're on the right track. But it might not be an integer, but a QModelIndex. You'll need to tell the slot to accept QModelIndex here as well. Then you can get the integer index via index.row().

mottosso avatar Oct 30 '17 07:10 mottosso

According to this page the following would show it just as integers:

Column {
    Repeater {
        model: 10
        Text { text: "I'm item " + index }
    }
}

So I'd expect them to be integers. I was able to have it also print the index, it would just always be the integer 1 somehow.

BigRoy avatar Oct 30 '17 08:10 BigRoy

Possibly. In that case, it should work.

mottosso avatar Oct 30 '17 08:10 mottosso

Possibly. In that case, it should work.

That's what I assumed, but for each button - no matter which I clicked it - it was giving me a value of one. Maybe I'll have another stab at this soon. :)

BigRoy avatar Oct 30 '17 10:10 BigRoy

Regarding this: https://github.com/getavalon/launcher/blob/921c2764228f8da43cf60dc4b907065b4534979b/launcher/res/qml/Breadcrumbs.qml#L44

Ok, so I think I see what the issue is. The index in that scope in the QML file is probably from the Delegate. I need to somehow bring along (in QML) the index from the scope above it (the Repeater) into the delegate (the Toolbox).

BigRoy avatar Nov 10 '17 08:11 BigRoy

Hm, the delegate is a ToolButton, and it's got no index member. Try model.index to explicitly refer to the delegate's model.

mottosso avatar Nov 10 '17 09:11 mottosso

Actually. @aardschok is working on this now and we're getting to something functional now. I must have missed adding int to the Slot when I tried this before.

Cool stuff coming up soon.

BigRoy avatar Nov 10 '17 09:11 BigRoy

Solution was to give the Slot decorator and the method controller.pop an int argument. In the Breadcrumbs qml file we needed to give the index to controller.pop of the repeater.

See https://github.com/getavalon/launcher/pull/22

aardschok avatar Nov 10 '17 10:11 aardschok

Right now breadcrumbs navbar can jump only to current index -1, right ? Let say user trail is " batman > assets > bruce > modeling", After this if user click on batman then QListView will set to "anim, layout, lookdev,etc" instead of "assets,film".

ruchitinfushion avatar Oct 28 '18 06:10 ruchitinfushion

Pretty sure the quick switch has been implemented?

tokejepsen avatar Oct 28 '18 13:10 tokejepsen

Yes, should be with: https://github.com/getavalon/launcher/pull/22

We have it working on our Launcher at least, and I believe it's merged into here too.

BigRoy avatar Oct 29 '18 09:10 BigRoy

Supplying evidence GIF

launcher_quick_switch

:beers:

davidlatwe avatar Oct 29 '18 09:10 davidlatwe