10

I'm looking to edit the way for nautilus to handle the zoom.

Since Ubuntu 13.04, when you use the zoom in nautilus it only changes the thumbnails/icons size, and the filename text stay the same.

Is there a way to make the zoom function change the size of the filename font?

In image: Differences in nautilus zoom, Ubuntu 11.04 / 13.04

I tried to look for a hidden option inside dconf-editor (org.gnome.nautilus.*) but nothing concur to what I'm looking for.

Any tips !?

Notes: I'm using a desktop version of Ubuntu as 'Tv' that I control from my couch, when I was on Ubuntu 11.04 I could simply zoom at 200% and read the filenames easily from the distance, but now, it's just the icons...

There is also the exemple of my father who have a poor sight, the old zoom function was perfect for him too.

1
  • This sounds like a bug. May I suggest that you report it. Oct 9, 2013 at 15:42

2 Answers 2

11

You can try to edit the Nautilus source code to scale the font in the zoom like in Nautilus 3.4.

NOTE: In this example I'm running ubuntu 13.04 with nautilus (files) 3.6.3. You can test this in a virtual machine to see if everything is OK.

First of all, I set the Nautilus Prefereces in "List View" as Default View and "200%" the zoom in List View Defaults.

enter image description here

enter image description here

By default the result with no scale font would be:

enter image description here


1) Make sure you have enable the Source code repository

  • Open the Ubuntu Software Center
  • In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository". Just in case I use the "Main Server" to Download.

enter image description here

Open a Terminal window and type:

  • sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

  • sudo apt-get install build-essential quilt

3) Install build dependencies.

  • sudo apt-get build-dep nautilus

4) Create a folder to download the source code.

  • mkdir ~/Downloads/src

  • cd ~/Downloads/src

5) Download the source code & Export variables.

  • apt-get source nautilus

  • export QUILT_PATCHES=debian/patches

  • export EDITOR=gedit

6) Create the patch and Edit the source code.

  • cd nautilus-3.6.3/

  • quilt new my_custom_zoom.patch

  • quilt edit src/nautilus-list-view.c

After line 133 add:

static void   nautilus_list_view_scale_font_size                 (NautilusListView        *view,
                                                                  NautilusZoomLevel  new_level);

enter image description here

After line 2506 add:

static void
nautilus_list_view_scale_font_size (NautilusListView *view, 
                    NautilusZoomLevel new_level)
{
    GList *l;
    static gboolean first_time = TRUE;
    static double pango_scale[7];
    int medium;
    int i;

    g_return_if_fail (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
              new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST);

    if (first_time) {
        first_time = FALSE;
        medium = NAUTILUS_ZOOM_LEVEL_SMALLER;
        pango_scale[medium] = PANGO_SCALE_MEDIUM;
        for (i = medium; i > NAUTILUS_ZOOM_LEVEL_SMALLEST; i--) {
            pango_scale[i - 1] = (1 / 1.2) * pango_scale[i];
        }
        for (i = medium; i < NAUTILUS_ZOOM_LEVEL_LARGEST; i++) {
            pango_scale[i + 1] = 1.2 * pango_scale[i];
        }
    }

    g_object_set (G_OBJECT (view->details->file_name_cell),
              "scale", pango_scale[new_level],
              NULL);
    for (l = view->details->cells; l != NULL; l = l->next) {
        g_object_set (G_OBJECT (l->data),
                  "scale", pango_scale[new_level],
                  NULL);
    }
}

enter image description here

After line 2569 add:

/* Scale text. */
nautilus_list_view_scale_font_size (view, new_level);

enter image description here

Remove lines 3051 & 3052.

/* ensure that the zoom level is always set before settings up the tree view columns */
list_view->details->zoom_level = get_default_zoom_level ();

enter image description here

7) Build the deb packages.

  • quilt refresh
  • fakeroot dpkg-buildpackage

8) Install the deb packages.

  • cd ..

  • sudo dpkg -i *deb

9) Finally you can Logout and Login to see the changes.

Result:

enter image description here

NOTE: You can zoom in, zoom out with the Ctrl + Mouse Whell or with Ctrol++ & Ctrol+- keys.

Hope it helps.

1

You asked to control the zoom behavior specifically in Nautilus, but you also mentioned low-vision accessibility issues, which may indicate a wider application. If you find the zoom factor more useful applied globally, i.e., not just to Nautilus, but to all text on the desktop, you can change it easily in System Settings (gear icon in the upper-right corner of the Unity desktop) ==> Universal Access ==> "Seeing" tab. This will change the size of text globally on the desktop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .