Subject: FVWM: Maximize/Restore buttons

From: [email-masked]
Date: Thu, 15 Jul 2004 16:27:38 -0300

Hello.

I want to set up one of two different images on button 4
in the title bar, depending on the maximization state
of the window. This button is to be used as a toggle of
the mazimation state of window (maximize/restore).
How can I configure that?

Up to now I have:

ButtonStyle 4 -- flat
AddButtonStyle 4 \
  Active (HGradient 128 Azure2 Azure1 -- flat) \
  Active (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  ActiveDown (-- raised) \
  Inactive (HGradient 64 Grey80 Grey90 -- flat) \
  Inactive (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  InactiveDown (-- raised)

Regards,

Romildo
--
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: [email-masked]
Date: Thu, 15 Jul 2004 23:24:53 -0300

> How can I configure that?

Below is an excerpt from my configuration file where
I try to set the maximize/restore buttons as
described above.

But it is not working: the vector image of the restore
button (the toggled button 4, when the window is
maximized) is not being drawn. Any help? I am running
FVWM 2.5.10 on Gentoo Linux.

#-----------------------------------------------------------------
Style * MWMFunctions
Style * MWMDecor
Style * MWMBorder
Style * MWMButtons

ButtonStyle All - Clear
ButtonStyle 1 - MwmDecorMenu
ButtonStyle 4 - MwmDecorMax
ButtonStyle 6 - MwmDecorMin

# Button 1: window operations
AddButtonStyle 1 \
  Active (HGradient 64 Azure1 Azure3) \
  Inactive (HGradient 64 Gray90 Gray60) \
  MiniIcon

# Button 2: delete
AddButtonStyle 2 \
  Active (HGradient 64 Azure1 White) \
  Inactive (HGradient 64 Grey90 Grey100) \
  (13 20x20@0 80x80@0 85x80@0 25x20@0 30x20@0 90x80@0 50x50@0 20x80@0 80x20@0 85x20@0 25x80@0 30x80@0 90x20@0)

#Button 4: Maximize
AddButtonStyle 4 \
  AllActive (HGradient 128 Azure2 Azure1) \
  AllInactive (HGradient 64 Grey80 Grey90) \
  AllNormal (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  AllToggled (10 40x70@0 10x70@0 10x10@0 70x10@0 70x40@0 40x40@4 90x40@0 90x90@0 90x40@0 40x40@0)

# Button 6: Minimize (image of large window being shrunk down)
AddButtonStyle 6 \
  Active (HGradient 128 LightSteelBlue Azure2) \
  Inactive (HGradient 64 Grey70 Grey80) \
  (4 25x80@0 85x80@0 85x75@4 25x75@0)

AddButtonStyle All AllUp (-- flat)
AddButtonStyle All AllDown (-- raised)

Mouse 1		4    	A     	Maximize layer grow grow
#-----------------------------------------------------------------

---

From: [email-masked]
Date: Fri, 16 Jul 2004 00:58:34 -0300

> FVWM 2.5.10 on Gentoo Linux.
[...]
>   AllToggled (10 40x70@0 10x70@0 10x10@0 70x10@0 70x40@0 40x40@4 90x40@0 90x90@0 90x40@0 40x40@0)
[...]

It seems that there is a bug with "AddButtonStyle AllToggled (Vector ...)"
in the command above. Replacing it with other button styles does
work. For Instance:

AddButtonStyle 4 AllToggled (MiniIcon)

or

AddButtonStyle 4 AllToggled (Pixmap maximizeA.xpm)

Can anybody confirm this as a bug?

Regards.

Romildo

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 16 Jul 2004 11:16:43 +0200

> Can anybody confirm this as a bug?

It's the mysterious syntax of the ButtonStyle/AddButtonStyle
commands.  There is probably not a single person who understands
how it works exactly.  This works:

  ButtonStyle 4 - Clear
  ButtonStyle 4 - MwmDecorMax
  ButtonStyle 4 AllActive HGradient 128 Azure2 Azure1
  ButtonStyle 4 AllInactive HGradient 64 Grey80 Grey90
  ButtonStyle 4 AllNormal 7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0
  ButtonStyle 4 AllToggled 10 40x70@0 10x70@0 10x10@0 70x10@0 70x40@0 40x40@4 90x40@0 90x90@0 90x40@0 40x40@0

You don't want to use AddButtonStyle because it does not erase the
effects that were already applied to the buttons.

Ciao

Dominik ^_^  ^_^

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

---

From: [email-masked]
Date: Fri, 16 Jul 2004 09:43:00 -0300

> > > I try to set the maximize/restore buttons

> > > maximized) is not being drawn.

> > AddButtonStyle 4 AllToggled (Pixmap maximizeA.xpm)

Further testing shows that the vector for the toggled
button is in fact drawn, but with a color different from
the colors used for all other buttons (which is very
strange), and it can not be seen with the style used
(HGradient 128 Azure2 Azure1).

If I change the line
   AllActive (HGradient 128 Azure2 Azure1)
to
   AllActive (Solid Red)
for instance, the toggled active vector can be seen.

I have found also that if I replace the HGradient
style for all active buttons with an equivalent
colorset style, the color used to draw the active
toggled button is visible:

  Colorset 8 HGradient 64 Azure2 Azure1
  ButtonStyle All - Clear
  ButtonStyle 4 - MwmDecorMax
  AddButtonStyle 4 \
    AllActive (Colorset 8) \
    AllInactive (HGradient 64 Grey80 Grey90) \
    AllNormal (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
    AllToggled (12 40x60@1 20x60@1 20x20@1 60x20@1 60x40@1 \
   	      	   40x40@4 80x40@1 80x80@1 40x80@1 40x40@1 40x45@1 80x45@1)

So, why does the use of the colorset style differ from
the hgradient style, considering that the colorset
is defined exactly like the hgradient style?

> effects that were already applied to the buttons.

This woks partially. The vector is drawn, but both
HGradient styles are not used. In my understanding
the ButtonStyle commands for AllNormal and AllToggled
buttons are replacing the HGradient styles. If last
four ButtonStyle commands are replaced by AddButtonStyle,
the gradients are used (but again the vector is draw
in an unsuitable color).

Any ideas?

Romildo

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 16 Jul 2004 17:35:04 +0000

> Up to now I have:
[sample from original message]
>   Inactive (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \

This is incorrect, You can't use two Active (and Inactive) definitions
in one [Add]ButtonStyle command, only one definition will be used.
Here is the correct syntax (the same thing, just rearranged):

ButtonStyle 4 -- flat
ButtonStyle 4 \
  Active (HGradient 128 Azure2 Azure1 -- flat) \
  Inactive (HGradient 64 Grey80 Grey90 -- flat)
AddButtonStyle 4 \
  Active (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  ActiveDown (-- raised) \ 
  Inactive (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  InactiveDown (-- raised)

>  	      	   40x40@4 80x40@1 80x80@1 40x80@1 40x40@1 40x45@1 80x45@1)

AllActive and AllInactive are an alternative cut of All than AllNormal
and AllToggled, so you can't use all of them in one [Add]ButtonStyle.
Here is the correct syntax (the same thing, just rearranged):

ButtonStyle 4 \
  AllActive (Colorset 8) \
  AllInactive (HGradient 64 Grey80 Grey90)
AddButtonStyle 4 \
  AllNormal (7 20x20@0 90x20@0 90x25@0 20x25@0 20x80@0 90x80@0 90x20@0) \
  AllToggled (12 40x60@1 20x60@1 20x20@1 60x20@1 60x40@1 \
                 40x40@4 80x40@1 80x80@1 40x80@1 40x40@1 40x45@1 80x45@1)

Regards,
Mikhael.