Subject: Re: Patch to allow titlebar buttons to be drawn depressed based on layer

From: Dominik Vogt <[email-masked]>
Date: Wed, 16 Jan 2002 22:26:45 +0100

On Mon, Dec 10, 2001 at 10:26:25PM +0000, Richard Curnow wrote:
> I've got titlebar buttons set up to force windows to the top or bottom
> of the stacking order, or to let them 'float' again, like this:
> 
> Mouse 0 3    A Function "Put-on-top"
> Mouse 0 5    A Function "Put-on-bottom"
> Mouse 0 7    A Function "Put-at-default"
> 
> with the functions defined thus:
> 
> AddToFunc "Put-on-top" "I" Layer 0 6
> +               "I" RefreshWindow
> AddToFunc "Put-on-bottom" "I" Layer 0 2
> +               "I" RefreshWindow
> AddToFunc "Put-at-default" "I" Layer 0 4
> +               "I" RefreshWindow
> 
> I wanted to make one of the buttons be drawn 'pressed in', depending on
> the window's current layer (similar to MWMDecorStick and friends).  I've
> attached my patch to version 2.4.3 to achieve this.  I'm not sure if
> it's the best way to do it, but it seemed quite convenient.  I have the
> buttons defined this way to use the new 'Layer' option to ButtonStyle
> that the patch adds:
> 
> ButtonStyle 3 15 10x5@1 90x5@1 90x20@0 50x20@0 50x25@0 80x55@0 60x55@0 60x90@0 40x90@0 40x55@1 20x55@1 50x25@1 50x20@0 10x20@0 10x5@1 -- Flat
> ButtonStyle 3 ActiveDown 15 10x5@0 90x5@0 90x20@1 50x20@1 50x25@1 80x55@1 60x55@1 60x90@1 40x90@1 40x55@0 20x55@0 50x25@0 50x20@1 10x20@1 10x5@0 -- Flat
> ButtonStyle 3 - Layer 6
> 
> ButtonStyle 5 13 10x80@1 10x95@1 90x95@0 90x80@0 50x80@1 80x50@0 60x50@1 60x5@0 40x5@1 40x50@1 20x50@1 50x80@0 10x80@1 -- Flat
> ButtonStyle 5 ActiveDown 13 10x80@0 10x95@0 90x95@1 90x80@1 50x80@0 80x50@1 60x50@0 60x5@1 40x5@0 40x50@0 20x50@0 50x80@1 10x80@0 -- Flat
> ButtonStyle 5 - Layer 2
> 
> ButtonStyle 7 21 40x0@0 40x12@1 20x12@1 50x42@0 10x42@1 10x58@1 50x58@0 20x88@1 40x88@0 40x100@1 60x100@0 60x88@0 80x88@0 50x58@0 90x58@0 90x42@0 50x42@1 80x12@0 60x12@1 60x0@0 40x0@1 -- Flat
> ButtonStyle 7 ActiveDown 21 40x0@1 40x12@0 20x12@0 50x42@1 10x42@0 10x58@0 50x58@1 20x88@0 40x88@1 40x100@0 60x100@1 60x88@1 80x88@1 50x58@1 90x58@1 90x42@1 50x42@0 80x12@1 60x12@0 60x0@1 40x0@0 -- Flat
> ButtonStyle 7 - Layer 4

I've finally applied the patch with a little clean up and a small
bug fix (the button look was not updated when the layer of a
window changed).  I renamed "Layer" to "MwmDecorLayer".  Although
the feature has nothing to do with Mwm it makes the effect more
clear.

Bye

Dominik ^_^  ^_^

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

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