elementary / dock

A quick app launcher and window switcher for Pantheon and elementary OS
https://elementary.io
GNU General Public License v3.0
87 stars 24 forks source link

Implement DnD reordering #181

Closed leolost2605 closed 8 months ago

leolost2605 commented 1 year ago

Pretty much replicates the plank remove and reorder experience 1 : 1

lenemter commented 1 year ago

And I think the Launcher object being a drop target is wrong, we need to insert a separate drop target object in between the launchers and expand them on hover, like the Plank does.

leolost2605 commented 1 year ago

Unpinned apps can't be removed anymore. Also I added animations when reordering and the poof animation. The reordering and removing experience should therefore be almost the same as with plank now. Currently there is a bug in GTK4 < 4.8 that CSS animations sometimes just don't play that is noticeable when reordering but that's fixed with this PR and I tested it with 4.10 and it works really good there. I'm not very experienced with CSS so it's a very basic animation but IMO it looks pretty similar to the plank one. Still if somebody has ideas to improve it they're very welcome. Admittedly the poof animation seems like a bit of a hacky solution but it works and I had only the plank svg to work with 🤷. Also the poof animation now is the same size as the icons whereas in plank it was a bit bigger, I'm not sure which way to go here?

lenemter commented 1 year ago

This looks really nice but I consistently get glitches after removing apps image

leolost2605 commented 1 year ago

Hmm just removing an app nothing else?

lenemter commented 1 year ago

@leolost2605 yep

leolost2605 commented 1 year ago

@lenemter that is strange, cause I don't get these glitches... I'm not very familiar with how gtk draws stuff but is it possible that different gala or gtk versions do something like that? Also do you get the poof animation?

lenemter commented 1 year ago

I'm not very familiar with how gtk draws stuff but is it possible that different gala or gtk versions do something like that?

TBH I'm not familiar with this either. I remember seeing similar glitches in Sideload app and the cause was that window didn't smoothly change its size. It was easy to fix thanks to Gtk.Stack.interpolate_size, but since here's no stack used, I don't know if that can be the source of issues.

Also do you get the poof animation?

Oh yes, I do. It's a bit small though.

leolost2605 commented 1 year ago

I get some more or less similar glitches both in master and this branch when launching dock without any pinned launchers but with open windows. That doesn't happen when commenting resizable=false so maybe that's the cause of your glitch too?

It's a bit small though.

I changed the poof size back to the same as it is in plank. I'm not sure whether it's aligned correctly with the icon everywhere though.

lenemter commented 1 year ago

That doesn't happen when commenting resizable=false so maybe that's the cause of your glitch too?

I no longer encounter glitches, but I can resize the dock now :)

leolost2605 commented 1 year ago

The last two commits make it that one can't remove pinned launchers that have open windows but it still unpins them. It also still plays the animation. IMO that might be good to give feedback that it's not pinned anymore and plank does the same but idk.

leolost2605 commented 1 year ago

I no longer encounter glitches, but I can resize the dock now :)

Ok the last commit adds decorated=false which fixes all glitches for me and keeps the resizable=false. I hope that might also fix yours?

danirabbit commented 9 months ago

@lenemter Would you be okay with merging for now since it's working in X and then we can keep iterating since we're such early days here? It would be nice to keep momentum going to replace plank ASAP imo

danirabbit commented 9 months ago

@leolost2605 can you resolve conflicts here please? :)

leolost2605 commented 8 months ago

@danirabbit done!