blueman icon indicating copy to clipboard operation
blueman copied to clipboard

Put recent connections in toplevel applet menu

Open cschramm opened this issue 3 years ago • 10 comments
trafficstars

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.

cschramm avatar Dec 19 '21 23:12 cschramm

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.

infirit avatar Dec 21 '21 17:12 infirit

I'll test with 24 and see how the menu behaves.

infirit avatar Dec 21 '21 17:12 infirit

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?

cschramm avatar Dec 21 '21 18:12 cschramm

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.

cschramm avatar Dec 21 '21 20:12 cschramm

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. afbeelding

infirit avatar Dec 22 '21 18:12 infirit

Ouch, yeah, stupid me. The position indexes start to overlap at some point. :facepalm:

cschramm avatar Dec 22 '21 20:12 cschramm

it's still duplicating entries with the latest changes. image

Other than that it looks ok to me.

infirit avatar Jul 23 '22 09:07 infirit

I cannot replicate any duplication. :thinking:

The duplicate Devices (Apparaten) was because I used the tray from master instead of this PR.

again?

cschramm avatar Jul 24 '22 06:07 cschramm

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Jul 24 '22 06:07 sonarqubecloud[bot]

again?

Eeuh, wait, i get deja Vu, i may have done "it" again 😮‍💨

Let me check.

infirit avatar Jul 25 '22 07:07 infirit

Can you rebase this one last time :-). I'll make sure to test this weekend.

infirit avatar Sep 09 '22 12:09 infirit

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 09 '22 13:09 sonarqubecloud[bot]