Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network applet: fixes to # of visible networks #12417

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jknockel
Copy link
Contributor

When there are more than NUM_VISIBLE_NETWORKS total networks, there should be exactly NUM_VISIBLE_NETWORKS visible networks. This pull request contains two commits aimed at fixing different scenarios in which there are more than NUM_VISIBLE_NETWORKS total networks but where the number of actually visible networks may be more than NUM_VISIBLE_NETWORKS or fewer than NUM_VISIBLE_NETWORKS. I was especially motivated to make these fixes because, on lower resolution displays, if many more networks than NUM_VISIBLE_NETWORKS are displayed, the menu may exceed the size of the screen and some networks may not be easily selectable.

In _createSection() and _createNetworkItem(), previously we would skip
the menu index in which the active network is present.  If this index
was < NUM_VISIBLE_NETWORKS, then we could display too few networks
before we begin stashing them in the "more" menu.

_accessPointAdded() is also refactored to more closely resemble the
above two, but this is a nonbehavioral change.
When adding a network, if we add it to a menu index <
NUM_VISIBLE_NETWORKS, if we now have > NUM_VISIBLE_NETWORKS networks, we
need to push the last visible network to being the first network in the
"more" menu.  Otherwise, we could end up with too many visible networks.

When updating a network position, we first removed it from the menu.
When doing this, if its original menu index was < NUM_VISIBLE_NETWORKS,
then we need to bump the first network in the "more" menu to being the
last visible network.  We now do this by now calling the already
existing _accessPointRemoved() method which handles this case.
Otherwise, we could end up with too few visible networks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant