blueman
blueman copied to clipboard
Put recent connections in toplevel applet menu
Other applets like NetworkManager's do not try to keep menu small, so why should blueman...
Closes #1558
This was lying around for a while now. I'm not happy with the presentation yet and don't have any better idea for it but in general this should be good.
I tried it and outside of duplicated entires for devices and it being mixed in with the recent connections I worry about the exit menu running off the screen. How are we going to make sure when someone has 24 set as the max recent connections exit is still accessible?
I was thinking of adding an expander when we reach, let's say 6 recent, and hide older ones. This however is going to complicate the current design so yeah.. not sure what's worse.
I'll test with 24 and see how the menu behaves.
When I considered #1558 I thought about an adapting expander as well, but came to the conclusion that just adding everything to the top level should be fine. Some arguments for "don't worry about large menus":
- The default maximum for recent connections is 6.
- If I remember correctly, back when I wrote the code I looked at nm-applet and found that they have no limit for their menu at all (or least something huge like 50 or something), so they do not seem to worry either.
- At least GTK-based menu implementations typically show a concept of scrolling, so if all goes wrong, all we get is a scrolling but still usable menu.
I can imagine that it might get rather nasty on low resolutions, though, but I guess at least as people do not increase the default maximum, they should be fine.
Duplicate devices? 🤔 Ah, you mean standard connect vs recent connection items?
Just checked a very low resolution and indeed multiple status icon menus - including our current one - started scrolling (mate-panel). Also, it looks like I did not remember correctly regarding nm-applet. It shows 5 networks and puts more into a submenu.
In any case, if we talk about adding 5 items on toplevel, plus a submenu item, so that it's up to 6 vs. just adding all items on toplevel that's the same number in 99.9 % of all cases as 6 is exactly our default maximum of recent connections and I don't think it's worth addressing the very special case of an increased maximum and a low resolution just to avoid scrolling in the menu if we're lucky.
Thanks for checking.
This is what I am seeing. The duplicate Devices (Apparaten) was because I used the tray from master instead of this PR. But it still shows up in the middle of all the recently connected devices.

Ouch, yeah, stupid me. The position indexes start to overlap at some point. :facepalm:
it's still duplicating entries with the latest changes.

Other than that it looks ok to me.
I cannot replicate any duplication. :thinking:
The duplicate Devices (Apparaten) was because I used the tray from master instead of this PR.
again?
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
again?
Eeuh, wait, i get deja Vu, i may have done "it" again 😮💨
Let me check.
Can you rebase this one last time :-). I'll make sure to test this weekend.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication