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

icon view: Refresh icon positions for manual layout on zoom change #1676

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

cwendling
Copy link
Member

When zoom changes on a manual layout icon view, the available area changes and can lead to some icons to either overflow or be able to go back to their actually saved position.

This is done correctly when the view is reloaded entirely, but not in response to zoom change, leading to disappearing icons (when zoom increases) or unexpected empty space (when zoom decreases).

Fix this by re-computing actual positions based on saved positions when zoom changes, to match what would actually happen when the view gets loaded.


To test this:

  1. Make sure you show desktop icons gsettings set org.mate.background show-desktop-icons true
  2. Put some icons to the far bottom and/or right edges of the desktop
  3. Play with the icon view default zoom gsettings set org.mate.caja.icon-view default-zoom-level large (smaller, small, standard, large, laregr, etc.). You can also use Edit → Preferences → Views → Defaults → Icon View → Default zoom level.

Expected results (with this PR): when the zoom changes, all icons remain visible (e.g. don't overflow)

Actual results (without this PR): when zoom grows, some icons overflow and disappear. If you refresh the desktop (F5 on it) or restart Caja, they appear properly.

Known issues: given the bigger the icons the least amount can fit on the desktop, at some point when you increase the zoom factor, some icons might overlap. That didn't change, and I don't know of a real theoretical solution as there always gonna be so much space to use anyway.

Basically, this PR should make the state of the desktop after a zoom change match the one after a zoom change followed by a reload/restart.

When zoom changes on a manual layout icon view, the available area
changes and can lead to some icons to either overflow or be able to go
back to their actually saved position.

This is done correctly when the view is reloaded entirely, but not
in response to zoom change, leading to disappearing icons (when zoom
increases) or unexpected empty space (when zoom decreases).

Fix this by re-computing actual positions based on saved positions when
zoom changes, to match what would actually happen when the view gets
loaded.
Copy link
Member

@lukefromdc lukefromdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my test, this prevented icons from overflowing when zooming on on the desktop but not on a navigation window. They return to original positions without issue when zooming out. When zooming further out, the entire layout is zoomed out, showing extra space to the bottom and right same as before and same as in a navigation window. Not sure if that is the intended behavior but it is not objectionable.

Navigation windows w manual icon arrangement seemed unaffected when zooming in: the whole arrangment zoomed in on,icons overflowing offscreen to bottom and right

@cwendling
Copy link
Member Author

When zooming further out, the entire layout is zoomed out, showing extra space to the bottom and right same as before and same as in a navigation window. Not sure if that is the intended behavior but it is not objectionable.

I think it is intended: the view keeps the stored locations and clamps them to the view area, but they are still relative to the top left corner, not "at bottom right", or "20% from the top". That could possibly be a nice feature (although I'm not sure how useful it would be, or how well it would actually play with the icons growing), but that's orthogonal to the issue here I think.

Navigation windows w manual icon arrangement seemed unaffected when zooming in: the whole arrangment zoomed in on,icons overflowing offscreen to bottom and right

I think that's expected, as they gain a scrollbar then (which the desktop doesn't, and wouldn't expect). And you can see that if you refresh the view, they still overflow, so at least it would be a different problem.

@cwendling cwendling merged commit af235d0 into master Nov 23, 2022
@cwendling cwendling deleted the desktop-no-overflow branch November 23, 2022 17:32
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.

2 participants