Subject: Re:FVWM: HoverIcon for FvwmButtons (Was: animated FvwmButtons)

From: [email-masked]
Date: Tue, 06 Jul 2004 14:41:00 +0800

Hi SCoTT,

In your mail:
>From: Scott Smedley <[email-masked]>
>Reply-To: 
>To: [email-masked]
>Subject: FVWM: HoverIcon for FvwmButtons (Was: animated FvwmButtons)
>
>> Can we have the animated FvwmButtons?
> > For example, the texte on the buttons change the color when mouse pass (like a
link in a web page)?
> 
> I had a go at implementing a "HoverIcon" option for the FvwmButtons module.
> This allows an alternative image to be displayed when the mouse cursor is
> over a button.
> 
> See here:
> 
> http://users.tpg.com.au/users/scottie7/tmp/hoverIcon.html
> 
> As FvwmButtons is used in all kinds of different ways, I need a few people
> to test the patch & find bugs etc.
> 
> Please report any feedback to [email-masked].
> 
> Thanks,
> 
> SCoTT. :)
> --

Now I found a bug.
Say you have a normal FvwmButtons as following:
####
Style FvwmDockUt* StaysOnBottom, NeverFocus
DestroyModuleConfig FvwmDockUt: *
*FvwmDockUt: Geometry 128x28+56-25
*FvwmDockUt: Font none
*FvwmDockUt: BoxSize fixed
*FvwmDockUt: Frame 0
*FvwmDockUt: Padding 0 0
*FvwmDockUt: Colorset 12
*FvwmDockUt: Rows 1
*FvwmDockUt: Columns 12
*FvwmDockUt: (1x1, Title "1")
*FvwmDockUt: (2x1, Title "2", Icon Ut/configure.png, Action (Mouse 1) 'Menu
MenuFvwmConfig Rectangle +$left+$top 0 -100m')
*FvwmDockUt: (2x1, Title "3", Icon Ut/gphoto.png, Action (Mouse 1) Exec exec
gvidcap)
*FvwmDockUt: (2x1, Title "4", Icon Ut/aim.png, Action (Mouse 1) Exec exec
LumaQQ/lumaqq)
*FvwmDockUt: (2x1, Title "5", Icon Ut/Calculator.png, Action (Mouse 1) Exec exec
xcalc)
*FvwmDockUt: (2x1, Title "6", Icon Ut/office.png, Action (Mouse 1) Exec exec
texmaker)
*FvwmDockUt: (1x1, Title "7")
Module FvwmButtons FvwmDockUt
########################

When you init fvwm, FvwmButtons won't display the icons.
A Restart will turn on the icons.

The above setting works fine without the hovericon patch.
So I guess something is wrong with the hovericon patch.

Best,
Liu Shidai

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Scott Smedley <[email-masked]>
Date: Tue, 6 Jul 2004 23:47:01 +1000

Hi Liu,

> I'd like this patch to be stablized and merged into fvwm

Ditto. FvwmButtons is quite complex. Consequently, I'm not comfortable
commiting this patch until it's had wider testing. Maybe you can convince
some fellow FVWMers to try it out? :)

> > Out of curiosity, how responsive is this?
> I have a P4 2G cpu. This causes no speed loss

hehe! Not that you'd notice with a 2G CPU. :)

> Now I found a bug.
...
> A Restart will turn on the icons.

I cannot reproduce this problem. What version of FVWM are you using?
The config you gave me (with altered Icon images of course) works fine.

Can you give me any further info?

SCoTT. :)

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 6 Jul 2004 21:37:27 +0200

> some fellow FVWMers to try it out? :)

You'd encourage at least one more FVWMer if you'd just commit the
patch.  Backing out patches is easy while having to apply patches
and taking care not to accidentally commit them is a pain :-)
 
Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]

---

From: Scott Smedley <[email-masked]>
Date: Sat, 10 Jul 2004 19:20:10 +1000

> and taking care not to accidentally commit them is a pain :-)

Ok, committed.

Combining "Icon" & "HoverTitle" gives a nice effect. ie.

*FvwmButtons(Icon firefox.png, HoverTitle Web, Action ...)

as does "Icon" & "HoverIcon". ie.

*FvwmButtons(Icon firefox.png, HoverIcon firefoxLarge.png, Action ...)

There are lots of other effects you can get using HoverColorset.

You can get an example config here:

SCoTT. :)

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 10 Jul 2004 12:34:18 +0000

> http://users.tpg.com.au/users/scottie7/tmp/hoverIcon.html

This is a nice config, although I would add a test for HoverTitle and
possibly HoverColorset too, like "HoverTitle apple". Great feature.

But I think the feel on press is incorrect.

The correct feel on the cell press IMO is: restore the original icon and
title, draw the sunken relief (if non zero) and don't change this look
until the mouse button is released; lock the pressed cell, don't hover
other cells. I used the word "cell", because "button" is too overloaded.

After you get this feel correctly, you may think about adding PressIcon,
PressTitle and PressColorset to be used instead of the original ones. :)

Regards,
Mikhael.

---

From: Remko Troncon <[email-masked]>
Date: Sat, 10 Jul 2004 14:46:32 +0200

> PressTitle and PressColorset to be used instead of the original ones. :)

Would this make it possible to have a different icons for the 'up' and
'down' state of a button ? Because i'm awaiting this feature
for a long time, but don't like hacking into FvwmButtons myself.

cheers,
Remko

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 10 Jul 2004 13:00:08 +0000

> for a long time, but don't like hacking into FvwmButtons myself.

Yes, if Scott has a free time to complete his patch. :)

Regards,
Mikhael.

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 01:09:15 +1000

Hi Mikhael, :)

> possibly HoverColorset too, like "HoverTitle apple".

D'oh! I included an old config (from my initial implementation).
I've updated it with the config I've been testing with recently. It
has all kinds of combinations of HoverTitle, HoverIcon & uses a
HoverColorset too. It's available on the web site now.

Sorry for the confusion.

> other cells. I used the word "cell", because "button" is too overloaded.

Mmmm, good idea.

> PressTitle and PressColorset to be used instead of the original ones. :)

Good idea too! That should be easy now that I've done all the hard work. :)

SCoTT. :)

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 01:13:33 +1000

> Yes, if Scott has a free time to complete his patch. :)

Lots of free time - the girlfriend is overseas for 2 weeks & I'm
injured so I can't play squash every day like I was planning to
while she was away! :)

SCoTT. :)

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 10 Jul 2004 15:51:52 +0000

> HoverColorset too. It's available on the web site now.

Ok, the new config is better.

Quote: "Make sure the images from the example are in your ImagePath".

You may create self containing config that may be Read, using $. variable
(that is the config's dir). For example:

  Read $./another-config-in-the-same-dir
  ImagePath +:$.

or maybe even:

  Test (!i smiley12.png) ImagePath $.:+

Regards,
Mikhael.

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 03:35:51 +1000

> > other cells. I used the word "cell", because "button" is too overloaded.

Fixed.

> > PressTitle and PressColorset to be used instead of the original ones. :)

Done.

Example config updated on web site:

SCoTT. :)

---

From: Scott Smedley <[email-masked]>
Date: Sun, 11 Jul 2004 03:42:56 +1000

>   Test (!i smiley12.png) ImagePath $.:+

Ah, nice! Thanks.

SCoTT. :)

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 13 Jul 2004 12:55:44 +0200

> > and taking care not to accidentally commit them is a pain :-)

There was a crash when the pointer enters unused button space,
i.e. slots that are not allocated to any button.  I have fixed
this, but there may be similar bugs in other parts of
FvwmButtons.

Other issues with HoverColorset:

 1 When you click a button, it is drawn in the original colours as
   long as the mouse button is held.  Shouldn't it also use the
   HoverColorset?
   This is because the ButtonPress handler does not take the
   current HoverButton into account.

 2 Move the mouse on any button with an action bound to it.  The
   button is hilighted.  Now press and release a mouse button 
   ==> The button is no longer hilighted.
   This is because the ButtonRelease handler does not take the
   current HoverButton into account.

 3 Press a mouse button on a button, drag the pointer to another
   button, then release the mouse button without moving the mouse
   ==> The button under the pointer is not hilighted.  As soon as
   the mouse moves it switches to the HoverColorset again.

 4 When the pointer is on a container or a swallowed application,
   the border of that container is hilighted.  I think only
   buttons that actually have an action bound to them should be
   hilighted (maybe this should be configurable).
 
 5 I'm not sure "Hover" is a good name.  I associate all kinds of
   things with "hovering", but definitely not the current
   behaviour.  In the menu code we use "Active" for that purpose.

Ciao

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 13 Jul 2004 15:24:58 +0200

Fixed.

Fixed.

Fixed.

Ciao

Dominik ^_^  ^_^

---

From: Scott Smedley <[email-masked]>
Date: Wed, 14 Jul 2004 10:08:24 +1000

Hi Dominik, :)

Thanks for testing out FvwmButtons.

> this, but there may be similar bugs in other parts of

I've got quite a few minor fixes in my own tree, & I've rearranged
the code a bit to make it a bit neater - I'll need to merge & checkin
soon.

>    hilighted (maybe this should be configurable).

I think an option is best. Any suggestions for a name?

>    behaviour.  In the menu code we use "Active" for that purpose.

Good idea.

One noticable difference I've made is to draw the button using
Press{Colorset,Icon,Title} when a button has been clicked & instructed
to wait for a window to popup. (the former behaviour was just to make
the button relief sunken.) I think this is intuitive, but would
appreciate other opinions.

SCoTT. :)