Skip to content

Add desktop icon label width scaling at runtime#3736

Open
mg-code-solutions wants to merge 1 commit intolinuxmint:masterfrom
mg-code-solutions:desktop-icon-label-width-scaling
Open

Add desktop icon label width scaling at runtime#3736
mg-code-solutions wants to merge 1 commit intolinuxmint:masterfrom
mg-code-solutions:desktop-icon-label-width-scaling

Conversation

@mg-code-solutions
Copy link

@mg-code-solutions mg-code-solutions commented Mar 17, 2026

Purpose

This pull request addresses the issue where desktop icon labels can overlap when horiztonal grid spacing is reduced (typically when trying to get the icons closer together and/or closer to the left hand edge of the desktop).

Change Target

This change is only for nemo-desktop, nemo's (file manager) behaviour should be unchanged.

Background

The issue of overlapping desktop icon labels has been raised in the following bug #2700 (linuxmint locked as too heated and limited conversation to collaborators on May 30, 2021).

Discovery

The width of the desktop icon label is currently hard coded in libnemo-private/nemo-icon-info.h; for each particular zoom level (e.g. #define NEMO_DESKTOP_TEXT_WIDTH_STANDARD 110).

The layout system (pango) uses these values to set the maximum width for which the label name is to be formatted.

If the text is short, then the layout rectangle is generally less than the maximum width.

If the text is long, then the text displayed is capped at the hard coded width maximum and is broken down over multiple lines.

The desktop icons will display a maximum of two lines, with an ellipsis added at the end of the second line in lieu of any omitted text, if required. The omitted text becomes visible when the mouse enters the icon / label area.

As icons are brought closer together, these hard coded maximum width values cause the labels to start to overlap. Aesthetically, a displeasing outcome.

Solution (tentative)

The solution presented is to add the ability to scale the width of the desktop label at runtime, via the "desktop overlay" window that appears when right-clicking on the desktop and selecting "Customise".

Much like the horizontal and vertical grid spacing sliders, a new "Icon Label Width Scale" (feel free to rename) slider has been added. This new slider allows the user to control the maximum width of the desktop icon label. Currently, from 50% to 200% of the hard coded values.

Also, like the horizontal and vertical grid adjusts, the desktop label width scale adjust value is stored in and loaded from the ~/.config/nemo/desktop.metadata file.

All the plumbing has been implemented to replicate the same behaviour produced when interacting with the existing grid spacing sliders.

Screenshots

The following imagines show a portion of a 1080x1920 desktop with a background image of a 96x104 pixel grid (effectively giving 10 icons down and 20 icons across).

A variety of long and short label texts are on display.

The grid spacing has been set to horizontally: center the desktop icons within its "grid cell", and vertically: place the icons near the top of their respective "grid cell".

  1. Nemo Desktop Overlay Window Modified
1  Nemo Desktop Overlay Window Modified

Image shows the modified "customise" window.

  1. Current layout with no scaling applied
2  Current layout with no scaling applied

Image shows the current layout with hard coded maximum desktop icon label widths, where the longer labels overlap.

  1. New layout with scaling applied
3  New layout with scaling applied

Image show the new layout with the desktop icon label scaling set to reduce the maximum desktop icon label width, where the longer labels do not overlap.

  1. Nemo (unmodified)
4  Nemo (unmodified)

Image shows Nemo (unmodified) file explorer running showing the Desktop icons

  1. Nemo (modified)
5  Nemo (modified)

Image shows Nemo (modified) file explorer running showing the Desktop icons

Images 4. and 5. are effectively the same, just shown for visual reference.

First time attempting to contribute to an open source project. Valid, constructive criticisms welcomed.

@Jeremy7701
Copy link
Contributor

Is this change intended only for nemo-desktop?

@mg-code-solutions
Copy link
Author

Is this change intended only for nemo-desktop?

Yes, this change is intended only for nemo-desktop, not nemo (file manager).

The last two images were meant to show how the nemo (file manager) had not changed.

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