Re: FVWM: Hiding Icon images and Icon text seperately

From: Richard Lister <ric_at_giccs.georgetown.edu>
Date: Tue, 20 Oct 1998 16:04:25 -0400

On Tue, 20 Oct 1998 12:35:13 -0700
John Benninghoff <johnb_at_netscape.com>
wrote concerning 'Re: FVWM: Hiding Icon images and Icon text seperately':
> >
> > Aha! It's been a long time since I used this stuff (I use FvwmIconMan
> > now), but I just dug back into some of my old code. The following patch
> > should do the trick for you. Apply it to fvwm/icons.c, then say:
> >
> > Style "*" Icon NoPixmap
>
> This didn't work but when I commented out the 2 functions above your diff
> change, I got it to work.


Hmm, strange, I seem to remember it working fine. I used to have a setup
close to what you're trying to achieve. Maybe the logic is a little
screwy (need 'else if' in a couple of places). At a cursory glance
it seems some of that section would benefit from a bit of a rewrite
anyway.


> Commenting out GetIconBitmap(tmp_win) is what really did it, I think.

Yup, Netscape is passing the pixmap hint to the WM, causing that
pixmap to be used.


> The icon text however is no longer trimmed regardless of the value of the width
> parameter. Strange.


I know what is happening here. With icon pixmaps the pixmap width is
used to calculate the width of the whole icon. When I first started using
no pixmaps on the icons I found that fvwm calculated the width based
on the icon title string length. This was OK, but some apps change
their icon title frequently (e.g. netscape urls, xterms which show CWD
in the title, etc). I decided I wanted the icon to grow or shrink with the
title on each iconify event. The following patch, which was adopted
into the main distribution, does that:


--- fvwm/icons.c.orig Sun Jun 9 20:57:11 1996
+++ fvwm/icons.c Thu Jun 13 10:55:51 1996
_at_@ -809,6 +809,15 @@
     else
       CreateIconWindow(tmp_win, def_x, def_y);
 
+ /* if no pixmap we want icon width to change to text width every iconify */
+ if( (tmp_win->icon_w != None) && (tmp_win->icon_pixmap_w == None) ) {
+ tmp_win->icon_t_width =
+ XTextWidth(Scr.IconFont.font,tmp_win->icon_name,
+ strlen(tmp_win->icon_name));
+ tmp_win->icon_p_width = tmp_win->icon_t_width+6;
+ tmp_win->icon_w_width = tmp_win->icon_p_width;
+ }
+
   AutoPlace(tmp_win);
   tmp_win->flags |= ICONIFIED;
   tmp_win->flags &= ~ICON_UNMAPPED;



Looking at this it would probably be pretty straightforward to change
the behaviour so that, for example, all icons are say 64 pixels wide,
but show the full title when focussed. If that is what you want.

Ric

Richard J Lister, Georgetown Institute for Cognitive and Computational Sciences
Georgetown University Medical Center, Washington, DC 20007, USA
Phone: +1 202-687 2878
Email: ric_at_giccs.georgetown.edu
Web: http://www.giccs.georgetown.edu/~ric/
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Oct 20 1998 - 15:14:50 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:01 BST