I need to modify the PCManFM desktop manager so that the desktop icons can have 
wider text labels (more text on a single line of a desktop icon label).

I'm trying to modify the 1.2.1 version, and so far I have tried modifying this section 
from the "desktop.c" file:

static void calc_item_size(FmDesktop* desktop, FmDesktopItem* item, GdkPixbuf* 
icon)
{
    PangoRectangle rc2;

    /* icon rect */
    if(icon)
    {
        item->icon_rect.width = gdk_pixbuf_get_width(icon);
        item->icon_rect.height = gdk_pixbuf_get_height(icon);
    }
    else
    {
        item->icon_rect.width = fm_config->big_icon_size;
        item->icon_rect.height = fm_config->big_icon_size;
    }
    item->icon_rect.x = item->area.x + (desktop->cell_w - 
item->icon_rect.width) / 2;
    item->icon_rect.y = item->area.y + desktop->ypad + (fm_config->big_icon_size - 
item->icon_rect.height) / 2;
    item->icon_rect.height += desktop->spacing; // FIXME: this is probably wrong

    /* text label rect */
    pango_layout_set_text(desktop->pl, NULL, 0);
    pango_layout_set_height(desktop->pl, desktop->pango_text_h);
    pango_layout_set_width(desktop->pl, desktop->pango_text_w);
    pango_layout_set_text(desktop->pl, fm_file_info_get_disp_name(item->fi), 
-1);

    pango_layout_get_pixel_extents(desktop->pl, NULL, &rc2);
    pango_layout_set_text(desktop->pl, NULL, 0);

    /* FIXME: RTL */
    item->text_rect.x = item->area.x + (desktop->cell_w - rc2.width - 4) / 2;
    item->text_rect.y = item->area.y + desktop->ypad + fm_config->big_icon_size + 
desktop->spacing;
    item->text_rect.width = rc2.width + 4;
    item->text_rect.height = rc2.y + rc2.height + 4;
    item->area.width = (desktop->cell_w + MAX(item->icon_rect.width, 
item->text_rect.width)) / 2;
    item->area.height = item->text_rect.y + item->text_rect.height - 
item->area.y;
}

Changing the values of item->text_rect.width and item->area.width does not 
produce any visible results, and I'm not sure what is the unit for these variables 
(doesn't seem to be pixels...).

Changing desktop->text_w and desktop->text_h works at modifying the spacing 
between desktop icons, but the desktop icon label maximum width does not change.

Can any developer help me with any hints?
Just point me to the file and variable(s) that need to be handled.


_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list

Reply via email to