Re: Reducing space between treeview rows



Some time ago I posted to various gtk related lists about reducing padding between treeview rows. I got the response below, which seemed promising as a hack fix for the single area of concern that initially sparked my interest in reducing the space between rows. My initial interest was to reduce the space between rows in the list of plugins in ardour's (www.ardour.org) mixer strip, as shown in the link below (the single column treeview where it says PLUGIN1 and PLUGIN2). I believe 3 lines should fit where there is only 2 in the image.

http://nostar.net/pics/ardour/ardour_mixer_redirect_treeview.png

If this were my only area if interest in reducing space between treeview rows, I would have given this method a try. I've realized though, that it's throughout gnome that I think the treeview spacing is way too much. I believe it to be a bug in gtk that its not possible via code or style properties to reduce vertical spacing right down to the point where the text touches each other if desired. Perhaps its actually within pango where the problem lies, i'm not sure about that. The following link shows my desktop, with my gtk theme modified to reduce treeview spacing as much as possible, compared to the KDE file manager (shown via K3B) with no modifications at all. I've been a long time kde user, and only recently switched to gnome to surround myself in the environment that I have recently began studying and developing in. Ive tried migrating to gnome in the past, and always reverted back to kde after being just unhappy with it as a desktop. These days, I'm happy to say, gnome has finally come so far that I'm happy using it as my desktop, and if this vertical treeview spacing issue can be resolved, I will have everything I desire about the look n feel of kde.

http://nostar.net/pics/gnome_vs_kde_treeview.png

By default, the spacing is even greater than shown. I used GtkTreeView::vertical-separator and ythickness settings in my gtkrc file to get it down this far.

Should I create a new bugzilla report from this post?

Doug
--
http://nostar.net


cole-anstey ntlworld com wrote:
What I do to get around this, is in my custom-cell-renderer (which may be hacky but it works for me) is to decrease from 'height' in its custom-cell-renderers 'get_size' function so when its finally rendered its closer to 'my_desired_height' as we use the space for rendering too (see below).
<snip>
    if (height)
    {
        gint vertical_separator;

        *height = my_desired_height;

        /* Each row has a vertical-separator equal to 2, decrease by this amount as we render to the blank area. */
        gtk_widget_style_get (widget, "vertical-separator", &vertical_separator, NULL);
        *height -= vertical_separator * 2;
    }
</snip> and then in the custom-cell-renderers 'render' function I then add the height back again.

    /* Each row has a vertical-separator equal to 2, increase by this amount to render over this blank area. */
    gtk_widget_style_get (widget, "vertical-separator", &vertical_separator, NULL);
    height += vertical_separator * 2;
This way though the space is still there, you are actually rendering over it,
giving the impression that its not there.  Hope you get what I mean.

From: Doug McLain <doug nostar net>
Date: 2006/03/28 Tue AM 09:32:53 GMT
To: cole-anstey ntlworld com
Subject: Re: Reducing space between treeview rows

Yes, I set it to 0, along with ythickness, used tiny fonts, set the y_pd property of the CellRenderer to 0, tried every theme I have and even bogus rc file (no theme). Nothing will bring the the rows any closer together. At the very closest 2 rows will come together in say the file manager, there is still enough room for almost another row of text. I want the ability to make one row of text to touch the next. Not that I would, but I want to get really close to that. It's looking like a gtk bug to me.


cole-anstey ntlworld com wrote:
Have you checked out the vertical_separator style property of the GtkTreeView.  Its this that is adding the extra spacing.

-----Original Message-----
From: Doug McLain [mailto:doug nostar net] Sent: 26 March 2006 08:56 am
To: Gus Koppel
Cc: gtk-app-devel-list gnome org
Subject: Re: Reducing space between treeview rows

***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********


I've tried different themes as well as setting xthickness and ythickness manually in both my theme's rc file and the applications rc file.


Gus Koppel wrote:
Doug McLain wrote:

I am trying to reduce the spacing between rows of text in a single column treeview. Ive been experimenting with both the ypad and height properties. They both work in adding space, but neither will take any space out. Seems like anything less than about ypad=3 doesn't do anything. With a font size of 8, there is almost enough space between rows to fit another row in between them. Even trying a tiny font size for troubleshooting purposes, doesnt bring the rows any closer together. Can someone help, please?
If it's not because late GTK+ versions have changed their behaviour here
then likely your current GTK+ theme is interfering with your pad
setting. Try some other themes. Basically, ypad = 0 should make a
difference. I use it, too. Unfortunately, as also the vartype shows,
negative ypad values are not supported.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-----------------------------------------
Email sent from www.ntlworld.com
Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information


-----------------------------------------
Email sent from www.ntlworld.com
Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]