fvwm 視窗樣式
阿新 • • 發佈:2018-12-14
Window Styles
31.8.1. AddButtonStyle
AddButtonStyle button [state] [style] [-- [!]flag... ]
Adds a button style to button. button can be a button number, or one of "All", "Left" or "Right". state can be "ActiveUp", "ActiveDown", "InactiveUp" or "InactiveDown", or "Active" (the same as both "ActiveUp" and "ActiveDown") or "Inactive" (the same as both "InactiveUp" and "InactiveDown") or any of these 6 with "Toggled" prepended. The "Active" states apply to the focused window, the "Inactive" ones apply to all other windows. The "Up" states apply to the non pressed buttons, the "Down" ones apply to pressed buttons. The "Toggled" prefix refers to maximized, shaded or sticky windows that have the corresponding MwmDecor... button style set. Additionally, the following shortcuts may be used: "AllNormal", "AllToggled", "AllActive", "AllInactive", "AllUp", "AllDown". They are actually different masks for 4 individual states from 8 total. These are supported too: "AllActiveUp", "AllActiveDown", "AllInactiveUp", "AllInactiveDown".
If state is omitted, then the style is added to every state. If the style and flags are enclosed in parentheses, then multiple state definitions can be placed on a single line. Flags for additional button styles cannot be changed after definition.
Buttons are drawn in the order of definition, beginning with the most recent button style, followed by those added with AddButtonStyle. To clear the button style stack, change style flags, or for descriptions of available styles and flags, see the ButtonStyle command. Examples:
ButtonStyle 1 Pixmap led.xpm -- Top Left
ButtonStyle 1 ActiveDown HGradient 8 grey black
ButtonStyle All -- UseTitleStyle
AddButtonStyle 1 \
ActiveUp (Pixmap a.xpm) \
ActiveDown (Pixmap b.xpm -- Top)
AddButtonStyle 1 Vector 4 [email protected] [email protected] [email protected] [email protected]
Initially for this example all button states are set to a pixmap. The second line replaces the "ActiveDown" state with a gradient (it overrides the pixmap assigned to it in the line before, which assigned the same style to every state). Then, the UseTitleStyle flag is set for all buttons, which causes fvwm to draw any styles set with TitleStyle before drawing the buttons. Finally, AddButtonStyle is used to place additional pixmaps for both "ActiveUp" and "ActiveDown" states and a vector button style is drawn on top of all states.
31.8.2. AddTitleStyle
AddTitleStyle [state] [style] [-- [!]flag... ]
Adds a title style to the title-bar. state can be "ActiveUp", "ActiveDown", "InactiveUp" or "InactiveDown", or "Active" (the same as both "ActiveUp" and "ActiveDown") or "Inactive" (the same as both "InactiveUp" and "InactiveDown") or any of these 6 with "Toggled" prepended. If state is omitted, then the style is added to every state. If the style and flags are enclosed in parentheses, then multiple state definitions can be placed on a single line. This command is quite similar to the AddButtonStyle command.
Title-bars are drawn in the order of definition, beginning with the most recent TitleStyle, followed by those added with AddTitleStyle. To clear the title style stack, change style flags, or for the descriptions of available styles and flags, see the TitleStyle and ButtonStyle commands.
31.8.3. AddToDecor
AddToDecor decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Add or divert commands to the decor named decor. A decor is a name given to the set of commands which affect button styles, title-bar styles and border styles. If decor does not exist it is created; otherwise the existing decor is modified. Note: Earlier versions allowed to use the HilightColor, HilightColorset and WindowFont commands in decors. This is no longer possible. Please use the Style command with the Hilight... and Font options.
New decors start out exactly like the "default" decor without any style definitions. A given decor may be applied to a set of windows with the UseDecor option of the Style command. Modifying an existing decor affects all windows which are currently assigned to it.
AddToDecor is similar in usage to the AddToMenu and AddToFunc commands, except that menus and functions are replaced by ButtonStyle, AddButtonStyle, TitleStyle, AddTitleStyle and BorderStyle commands. Decors created with AddToDecor can be manipulated with ChangeDecor, DestroyDecor, UpdateDecor and the Style option.
The following example creates a decor "FlatDecor" and style "FlatStyle". They are distinct entities:
AddToDecor FlatDecor
+ ButtonStyle All Active (-- flat) Inactive (-- flat)
+ TitleStyle -- flat
+ BorderStyle -- HiddenHandles NoInset
Style FlatStyle \
UseDecor FlatDecor, HandleWidth 4, ForeColor white, \
BackColor grey40, HilightFore black, HilightBack grey70
Style xterm UseStyle FlatStyle
An existing window's decor may be reassigned with ChangeDecor. A decor can be destroyed with DestroyDecor.
DestroyDecor FlatDecor
AddToDecor FlatDecor ...
Style FlatStyle UseDecor FlatDecor
and now apply the style again:
Style xterm UseStyle FlatStyle
31.8.4. BorderStyle
BorderStyle state [style] [-- [!]flag... ]
Defines a border style for windows. state can be either "Active" or "Inactive". If state is omitted, then the style is set for both states. If the style and flags are enclosed in parentheses, then multiple state definitions can be specified per line.
style is a subset of the available button styles, and can only be TiledPixmap (uniform pixmaps which match the bevel colors work best this way) or Colorset. If a '!' is prefixed to any flag, the behavior is negated. If style is not specified, then one can change flags without resetting the style.
The HiddenHandles flag hides the corner handle dividing lines on windows with handles (this option has no effect for !Handles windows). By default, HiddenHandles is disabled.
The NoInset flag supplements HiddenHandles. If given, the inner bevel around the window frame is not drawn. If HiddenHandles is not specified, the frame looks a little strange.
Raised causes a raised relief pattern to be drawn (default). Sunk causes a sunken relief pattern to be drawn. Flat inhibits the relief pattern from being drawn.
To decorate the active and inactive window borders with a textured pixmap, one might specify:
BorderStyle Active TiledPixmap marble.xpm
BorderStyle Inactive TiledPixmap granite.xpm
BorderStyle Active -- HiddenHandles NoInset
To clear the style for both states:
BorderStyle Simple
To clear for a single state:
BorderStyle Active Simple
To unset a flag for a given state:
BorderStyle Inactive -- !NoInset
title-bar buttons can inherit the border style with the UseBorderStyle flag (see ButtonStyle).
31.8.5. ButtonState
ButtonState [ActiveDown bool] [Inactive bool] [InactiveDown bool]
The ButtonState command controls which states of the window titles and title buttons are used. The default is to use all four states: "ActiveUp>", "ActiveDown>", "InactiveUp>" and "InactiveDown>" (see ButtonStyle and TitleStyle commands). The bool argument after the key word controls if the designated state is used ("True") or not ("False"). The "ActiveUp" state cannot be deactivated. If no arguments are provided or the given arguments are illegal, the default is restored.
If ActiveDown argument is "False", no different button style for the pressed down buttons used, instead "ActiveUp" state is used even when button is pressed.
If Inactive argument is "False", focused and unfocused windows look similarly, the corresponding "Active" states are always used.
If InactiveDown argument is "False" (only applied when Inactive is "True"), the pressed titles and title buttons in non-focused windows are drawn using "InactiveUp" or "ActiveUp" states depending on the values of the other key words.
31.8.6. ButtonStyle
ButtonStyle > button [state] [style] [-- [!]flag... ]
Sets the button style for a title-bar button. button is the title-bar button number between 0 and 9, or one of "All", "Left", "Right", or "Reset". Button numbering is described in the Mouse command section. If the style and flags are enclosed in parentheses, then multiple state definitions can be specified per line.
state refers to which button state should be set. Button states are defined as follows: "ActiveUp" and "ActiveDown" refer to the un-pressed and pressed states for buttons on active windows; while the "InactiveUp" and "InactiveDown" states denote buttons on inactive windows. The shortcut "Active" denotes both "ActiveUp" and "ActiveDown" states. Shortcut "Inactive" denotes both "InactiveUp" and "InactiveDown" states. The similar state names like just described, but with the "Toggled" prefix are used instead for title buttons which have one of the MwmDecorMax, MwmDecorShade, MwmDecorStick or MwmDecorLayer hints, if the window is maximized, shaded, sticky or placed on specific layer, respectively.
AddToDecor Default
+ ButtonStyle 6 \
Vector 4 [email protected] [email protected] [email protected] [email protected]
+ ButtonStyle 6 ToggledActiveUp \
Vector 4 [email protected] [email protected] [email protected] [email protected]
+ ButtonStyle 6 ToggledActiveDown \
Vector 4 [email protected] 85x25[email protected] [email protected] [email protected]
+ ButtonStyle 6 ToggledInactive \
Vector 4 [email protected] [email protected] [email protected] [email protected]
+ ButtonStyle 6 - MwmDecorShade
Mouse 0 6 N WindowShade
Additionally, the following shortcuts may be used: "AllNormal", "AllToggled", "AllActive", "AllInactive", "AllUp", "AllDown". They are actually different masks for 4 individual states from 8 total. These are supported too: "AllActiveUp", "AllActiveDown", "AllInactiveUp", "AllInactiveDown".
If state is specified, that particular button state is set. If state is omitted, every state is set. Specifying a style destroys the current style (use AddButtonStyle to avoid this).
If style is omitted, then state-dependent flags can be set for the primary button style without destroying the current style. Examples (each line should be considered independent):
ButtonStyle Left -- flat
ButtonStyle All ActiveUp (-- flat) Inactive (-- flat)
The first line sets every state of the left buttons to flat, while the second sets only the "ActiveUp" and "Inactive" states of every button to flat (only flags are changed; the buttons' individual styles are not changed).
If you want to reset all buttons to their defaults:
ButtonStyle Reset
To reset the "ActiveUp" button state of button 1 to the default:
ButtonStyle 1 ActiveUp Default
To reset all button states of button 1 to the default of button number 2:
ButtonStyle 1 Default 2
For any button, multiple state definitions can be given on one line by enclosing the style and flags in parentheses. If only one definition per line is given the parentheses can be omitted.
flags affect the specified state. If a '!' is prefixed to any flag, its behavior is negated. The available state-dependent flags for all styles are described here (the ButtonStyle entry deals with state-independent flags).
Raised causes a raised relief pattern to be drawn.
Sunk causes a sunken relief pattern to be drawn.
Flat inhibits the relief pattern from being drawn.
UseTitleStyle causes the given button state to render the current title style before rendering the buttons' own styles. The Raised, Flat and Sunk TitleStyle flags are ignored since they are redundant in this context.
UseBorderStyle causes the button to inherit the decorated BorderStyle options.
Raised, Sunk and Flat are mutually exclusive, and can be specified for the initial ButtonStyle only. UseTitleStyle and UseBorderStyle are also mutually exclusive (both can be off however). The default is Raised with both UseBorderStyle and UseTitleStyle left unset.
Important
for the "ActiveDown" and "InactiveDown" states: When a button is pressed, the relief is inverted. Because of this, to obtain the raised look in "ActiveDown" or "InactiveDown" states you must specify the opposite of the desired relief (i.e. Sunk for "ActiveDown" or "InactiveDown"). This behavior is consistent, but may seem confusing at first. The same applies to the "Toggled" states.
Button styles are classified as non-destructive, partially destructive, or fully destructive. Non-destructive styles do not affect the image. Partially destructive styles can obscure some or all parts of the underlying image (i.e. Pixmap). Fully destructive styles obscure the entire underlying image (i.e. Solid or one of the gradient styles). Thus, if stacking styles with AddButtonStyle (or AddTitleStyle for title-bars), use care in sequencing styles to minimize redraw.
The available styles are:
Simple, Default, Solid, Colorset, Vector, ?Gradient, Pixmap, AdjustedPixmap, ShrunkPixmap, StretchedPixmap, TiledPixmap, MiniIcon
The description of these styles and their arguments follow:
The Simple style does nothing. There are no arguments, and this style is an example of a non-destructive button style.
The Default style conditionally accepts one argument: a number which specifies the default button number to load. If the style command given is ButtonStyle or AddButtonStyle, the argument is optional (if given, it overrides the current button). If a command other than ButtonStyle or AddButtonStyle is used, the number must be specified.
The Solid style fills the button with a solid color. The relief border color is not affected. The color is specified as a single argument. This style is fully destructive.
The Colorset cs [alpha] style fills the button with the Colorset cs. The optional alpha argument is a percentage between 0 and 100. It causes fvwm to merge the colorset background onto the button using this percentage. If the percentage is 0 the colorset background is hidden and if it is 100 the colorset background is fully applied. The default is 100. So, the destructiveness depends on the alpha argument.
The Vector num X[offsetp]xY[offsetp]@C ... style draws a line pattern. Since this is a standard button style, the keyword Vector is optional, num is a number of point specifications of the form X[offsetp]xY[offsetp]@C ... X and Y are point coordinates inside the button, given in percents (from 0 to 100). An optional absolute offset in pixels, can be given as "+<offset>p" for a positive or "-<offset>p" for a negative offset.
C specifies a line color (0 - the shadow color, 1 - the highlight color, 2 - the background color, 3 - the foreground color, 4 - only move the point, do not draw). The first point color is not used. You can use up to 10000 points in a line pattern. This style is partially destructive.
The specification is a little cumbersome:
ButtonStyle 2 Vector 4 [email protected] [email protected] [email protected] [email protected]
then the button 2 decoration uses a 4-point pattern consisting of a line from (x=50,y=30) to (70,70) in the shadow color (@0), and then to (30,70) in the shadow color, and finally to (50,30) in the highlight color (@1). Is that too confusing? See the fvwm web pages for some examples with screenshots.
A more complex example of Vector:
ButtonStyle 8 Vector 10 [email protected] [email protected] \
[email protected] [email protected] [email protected] [email protected] [email protected] \
[email protected] [email protected] [email protected]
ButtonStyle 0 Vector 10 [email protected] [email protected] \
[email protected] [email protected] [email protected] [email protected] [email protected] \
[email protected] [email protected] [email protected]
The ?Gradient styles denote color gradients. Fill in the question mark with any one of the defined gradient types. Please refer to the Color Gradients section for a description of the gradient syntax. The gradient styles are fully destructive.
The Pixmap style displays a pixmap. A pixmap should be specified as an argument. For example, the following would give button number 2 the same pixmap for all 4 states (2 active and 2 inactive), and button number 4 all different pixmaps.
ButtonStyle 2 Pixmap my_pixmap.xpm
ButtonStyle 4 \
ActiveUp (Pixmap activeup.xpm) \
ActiveDown (Pixmap activedown.xpm) \
Inactive (Pixmap inactiveup.xpm)
ButtonStyle 4 \
InactiveDown Pixmap inactivedown.xpm
The pixmap specification can be given as an absolute or relative pathname (see ImagePath). If the pixmap cannot be found, the button style reverts to Simple. Flags specific to the Pixmap style are Left, Right, Top, and Bottom. These can be used to justify the pixmap (default is centered for both directions). Pixmap transparency is used for the color "None." This style is partially destructive.
The AdjustedPixmap style is similar to the Pixmap style. But the image is resized to exactly fit the button.
The ShrunkPixmap style is similar to the Pixmap style. But if the image is bigger than the button the image is resized to fit into the button.
The StretchedPixmap style is similar to the Pixmap style. But if the image is smaller than the button the image is resized to cover the button.
The TiledPixmap style accepts a pixmap to be tiled as the button background. One pixmap is specified as an argument. Pixmap transparency is not used. This style is fully destructive.
The MiniIcon style draws the window's miniature icon in the button, which is specified with the MiniIcon option of the Style command. This button style accepts no arguments. Example:
Style * MiniIcon mini-bx2.xpm
Style xterm MiniIcon mini-term.xpm
Style Emacs MiniIcon mini-doc.xpm
ButtonStyle 1 MiniIcon
ButtonStyle button - [!]flag...
Sets state-independent flags for the specified button. State-independent flags affect button behavior. Each flag is separated by a space. If a '!' is prefixed to the flag then the behavior is negated. The special flag Clear clears any existing flags.
The following flags are usually used to tell fvwm which buttons should be affected by mwm function hints (see MwmFunctions option of the Style command. This is not done automatically since you might have buttons bound to complex functions, for instance.
MwmDecorMenu should be assigned to title-bar buttons which display a menu. The default assignment is the leftmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden.
MwmDecorMin should be assigned to title-bar buttons which minimize or iconify the window. The default assignment is the second button over from the rightmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden.
MwmDecorMax should be assigned to title-bar buttons which maximize the window. The default assignment is the rightmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden. When the window is maximized, the vector pattern on the button looks pressed in.
MwmDecorShade should be assigned to title-bar buttons which shade the window (see WindowShade command). When the window is shaded, the vector pattern on the button looks pressed in.
MwmDecorStick should be assigned to title-bar buttons which make the window sticky. When the window is sticky, the vector pattern on the button looks pressed in.
The flag MwmDecorLayer layer should be assigned to title-bar buttons which place the window in the layer numbered layer. When the window is on that specific layer, the vector pattern on the button looks pressed in.
31.8.7. ChangeDecor
ChangeDecor decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Changes the decor of a window to decor. decor is "Default" or the name of a decor defined with AddToDecor. If decor is invalid, nothing occurs. If called from somewhere in a window or its border, then that window is affected. If called from the root window the user is allowed to select the target window. ChangeDecor only affects attributes which can be set using the AddToDecor command.
ChangeDecor CustomDecor1
31.8.8. DestroyDecor
DestroyDecor [recreate] decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Deletes the decor defined with AddToDecor, so that subsequent references to it are no longer valid. Windows using this decor revert to the "Default" decor. The optional parameter recreate tells fvwm not to throw away the decor completely but to throw away only its contents. If the decor is created again later, windows do not use it before the UseDecor style is applied again unless the decor was destroyed with the recreate option. The decor named "Default" cannot be destroyed.
DestroyDecor CustomDecor1
31.8.9. TitleStyle
TitleStyle [justification] [Height [num]] [MinHeight [num]]
Sets attributes for the title-bar. Justifications can be Centered, RightJustified or LeftJustified. Height sets the title bar's height to an amount in pixels. MinHeight sets the minimal height in pixels of the title bar. Defaults are Centered, the window's font height and no minimal height. To reset the font height to the default value, omit the num argument after the Height keyword. The MinHeight height is reseted by Height or if given with no argument. Example:
TitleStyle LeftJustified Height 24
TitleStyle [state] [style] [-- [!]flag... ]
Sets the style for the title-bar. See also AddTitleStyle and ButtonStyle state can be one of "ActiveUp", "ActiveDown", "InactiveUp", or "InactiveDown". Shortcuts like "Active" and "Inactive" are allowed. The states with the "Toggled" prefix are allowed too, the title itself does not use "Toggled" states, but these states are used for the buttons with ButtonStyle UseTitleStyle. If state is omitted, then the style is added to every state. If parentheses are placed around the style and flags, then multiple state definitions can be given per line. style can be omitted so that flags can be set while not destroying the current style.
If a '!' is prefixed to any flag, its behavior is negated. Valid flags for each state include Raised, Flat and Sunk (these are mutually exclusive). The default is Raised. See the note in ButtonStyle regarding the "ActiveDown" state. Examples:
TitleStyle ActiveUp HGradient 16 navy black
TitleStyle \
ActiveDown (Solid red -- flat) \
Inactive (TiledPixmap wood.xpm)
TitleStyle \
ActiveUp (-- Flat) \
ActiveDown (-- Raised) \
InactiveUp (-- Flat) \
InactiveDown (-- Sunk)
This sets the "ActiveUp" state to a horizontal gradient, the "ActiveDown" state to solid red, and the "Inactive" states to a tiled wood pixmap. Finally, "ActiveUp" and "InactiveUp" are set to look flat, while "ActiveDown" set to be sunk (the Raised flag for the "ActiveDown" state causes it to appear sunk due to relief inversion), and "InactiveDown" is set to look raised. An example which sets flags for all states:
TitleStyle -- flat
For a flattened look:
TitleStyle -- flat
ButtonStyle All Active (-- flat) Inactive (-- flat)
TitleStyle accepts all the ButtonStyle styles and arguments:
Simple, Default, Solid, Colorset, Vector, ?Gradient, Pixmap, AdjustedPixmap, ShrunkPixmap, StretchedPixmap, TiledPixmap, MiniIcon.
See the ButtonStyle command for a description of all these styles and their arguments.
In addition to these styles TitleStyle accepts a powerful MultiPixmap option. This allows you to specify different pixmaps, colorsets or colors for different parts of the titlebar. Some of them are tiled or stretched to fit a particular space; others are discrete "transition" images. The definable sections are:
Main
The full titlebar
LeftMain
Left of title text
RightMain
Right of title text
UnderText
Underneath title text
LeftOfText
just to the left of the title text
RightOfText
just to the right of the title text
LeftEnd
at the far left end of the titlebar (just after left buttons if any)
RightEnd
at the far right end of the titlebar (just before right buttons if any)
Buttons
under buttons in case of UseTitleStyle
LeftButtons
under left buttons in case of UseTitleStyle
RightButtons
under right buttons in case of UseTitleStyle
None of these are mandatory except for Main (or, if you do not define Main you must define both LeftMain and RightMain). If no Buttons pixmaps are defined and UseTitleStyle is specified for one or more buttons, Main, LeftMain or RightMain are used as appropriate.
The syntax for this style type is:
MultiPixmap section style arg, ...
continuing for whatever you want to define. The style can be either TiledPixmap, AdjustedPixmap, Colorset or Solid. See the ButtonStyle command for the description of these styles. In the case of a transition section, LeftEnd, LeftOfText, RightOfText or RightEnd, AdjustedPixmap only resize the pixmap in the "y" direction. For the Colorset and Solid styles a width of the half of the title bar height is assumed for the transition sections.
An example:
MultiPixmap Main AdjustedPixmap foo.xpm, \
UnderText TiledPixmap bar.xpm, \
Buttons Colorset 2
Note that the old syntax is still supported: if the style is omitted, TiledPixmap is assumed and adding "(stretched)" between the section and the file name implies AdjustedPixmap.
31.8.10. UpdateDecor
UpdateDecor [decor]
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
This command is kept mainly for backward compatibility. Since all elements of a decor are updated immediately when they are changed, this command is mostly useless.
Updates window decorations. decor is an optional argument which specifies the decor to update. If given, only windows which are assigned to that particular decor are updated. This command is useful, for instance, after a ButtonStyle, TitleStyle or BorderStyle (possibly used in conjunction with AddToDecor). Specifying an invalid decor results in all windows being updated. This command is less disturbing than Recapture, but does not affect window style options as Recapture does.
31.8.1. AddButtonStyle
AddButtonStyle button [state] [style] [-- [!]flag... ]
Adds a button style to button. button can be a button number, or one of "All", "Left" or "Right". state can be "ActiveUp", "ActiveDown", "InactiveUp" or "InactiveDown", or "Active" (the same as both "ActiveUp" and "ActiveDown") or "Inactive" (the same as both "InactiveUp" and "InactiveDown") or any of these 6 with "Toggled" prepended. The "Active" states apply to the focused window, the "Inactive" ones apply to all other windows. The "Up" states apply to the non pressed buttons, the "Down" ones apply to pressed buttons. The "Toggled" prefix refers to maximized, shaded or sticky windows that have the corresponding MwmDecor... button style set. Additionally, the following shortcuts may be used: "AllNormal", "AllToggled", "AllActive", "AllInactive", "AllUp", "AllDown". They are actually different masks for 4 individual states from 8 total. These are supported too: "AllActiveUp", "AllActiveDown", "AllInactiveUp", "AllInactiveDown".
If state is omitted, then the style is added to every state. If the style and flags are enclosed in parentheses, then multiple state definitions can be placed on a single line. Flags for additional button styles cannot be changed after definition.
Buttons are drawn in the order of definition, beginning with the most recent button style, followed by those added with AddButtonStyle. To clear the button style stack, change style flags, or for descriptions of available styles and flags, see the ButtonStyle command. Examples:
ButtonStyle 1 Pixmap led.xpm -- Top Left
ButtonStyle 1 ActiveDown HGradient 8 grey black
ButtonStyle All -- UseTitleStyle
AddButtonStyle 1 \
ActiveDown (Pixmap b.xpm -- Top)
AddButtonStyle 1 Vector 4 [email protected] [email protected] [email protected] [email protected]
Initially for this example all button states are set to a pixmap. The second line replaces the "ActiveDown" state with a gradient (it overrides the pixmap assigned to it in the line before, which assigned the same style to every state). Then, the UseTitleStyle flag is set for all buttons, which causes fvwm to draw any styles set with TitleStyle before drawing the buttons. Finally, AddButtonStyle is used to place additional pixmaps for both "ActiveUp" and "ActiveDown" states and a vector button style is drawn on top of all states.
31.8.2. AddTitleStyle
AddTitleStyle [state] [style] [-- [!]flag... ]
Adds a title style to the title-bar. state can be "ActiveUp", "ActiveDown", "InactiveUp" or "InactiveDown", or "Active" (the same as both "ActiveUp" and "ActiveDown") or "Inactive" (the same as both "InactiveUp" and "InactiveDown") or any of these 6 with "Toggled" prepended. If state is omitted, then the style is added to every state. If the style and flags are enclosed in parentheses, then multiple state definitions can be placed on a single line. This command is quite similar to the AddButtonStyle command.
Title-bars are drawn in the order of definition, beginning with the most recent TitleStyle, followed by those added with AddTitleStyle. To clear the title style stack, change style flags, or for the descriptions of available styles and flags, see the TitleStyle and ButtonStyle commands.
31.8.3. AddToDecor
AddToDecor decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Add or divert commands to the decor named decor. A decor is a name given to the set of commands which affect button styles, title-bar styles and border styles. If decor does not exist it is created; otherwise the existing decor is modified. Note: Earlier versions allowed to use the HilightColor, HilightColorset and WindowFont commands in decors. This is no longer possible. Please use the Style command with the Hilight... and Font options.
New decors start out exactly like the "default" decor without any style definitions. A given decor may be applied to a set of windows with the UseDecor option of the Style command. Modifying an existing decor affects all windows which are currently assigned to it.
AddToDecor is similar in usage to the AddToMenu and AddToFunc commands, except that menus and functions are replaced by ButtonStyle, AddButtonStyle, TitleStyle, AddTitleStyle and BorderStyle commands. Decors created with AddToDecor can be manipulated with ChangeDecor, DestroyDecor, UpdateDecor and the Style option.
The following example creates a decor "FlatDecor" and style "FlatStyle". They are distinct entities:
AddToDecor FlatDecor
+ ButtonStyle All Active (-- flat) Inactive (-- flat)
+ TitleStyle -- flat
+ BorderStyle -- HiddenHandles NoInset
Style FlatStyle \
BackColor grey40, HilightFore black, HilightBack grey70
Style xterm UseStyle FlatStyle
An existing window's decor may be reassigned with ChangeDecor. A decor can be destroyed with DestroyDecor.
DestroyDecor FlatDecor
AddToDecor FlatDecor ...
Style FlatStyle UseDecor FlatDecor
and now apply the style again:
Style xterm UseStyle FlatStyle
31.8.4. BorderStyle
BorderStyle state [style] [-- [!]flag... ]
Defines a border style for windows. state can be either "Active" or "Inactive". If state is omitted, then the style is set for both states. If the style and flags are enclosed in parentheses, then multiple state definitions can be specified per line.
style is a subset of the available button styles, and can only be TiledPixmap (uniform pixmaps which match the bevel colors work best this way) or Colorset. If a '!' is prefixed to any flag, the behavior is negated. If style is not specified, then one can change flags without resetting the style.
The HiddenHandles flag hides the corner handle dividing lines on windows with handles (this option has no effect for !Handles windows). By default, HiddenHandles is disabled.
The NoInset flag supplements HiddenHandles. If given, the inner bevel around the window frame is not drawn. If HiddenHandles is not specified, the frame looks a little strange.
Raised causes a raised relief pattern to be drawn (default). Sunk causes a sunken relief pattern to be drawn. Flat inhibits the relief pattern from being drawn.
To decorate the active and inactive window borders with a textured pixmap, one might specify:
BorderStyle Active TiledPixmap marble.xpm
BorderStyle Inactive TiledPixmap granite.xpm
BorderStyle Active -- HiddenHandles NoInset
To clear the style for both states:
BorderStyle Simple
To clear for a single state:
BorderStyle Active Simple
To unset a flag for a given state:
BorderStyle Inactive -- !NoInset
title-bar buttons can inherit the border style with the UseBorderStyle flag (see ButtonStyle).
31.8.5. ButtonState
ButtonState [ActiveDown bool] [Inactive bool] [InactiveDown bool]
The ButtonState command controls which states of the window titles and title buttons are used. The default is to use all four states: "ActiveUp>", "ActiveDown>", "InactiveUp>" and "InactiveDown>" (see ButtonStyle and TitleStyle commands). The bool argument after the key word controls if the designated state is used ("True") or not ("False"). The "ActiveUp" state cannot be deactivated. If no arguments are provided or the given arguments are illegal, the default is restored.
If ActiveDown argument is "False", no different button style for the pressed down buttons used, instead "ActiveUp" state is used even when button is pressed.
If Inactive argument is "False", focused and unfocused windows look similarly, the corresponding "Active" states are always used.
If InactiveDown argument is "False" (only applied when Inactive is "True"), the pressed titles and title buttons in non-focused windows are drawn using "InactiveUp" or "ActiveUp" states depending on the values of the other key words.
31.8.6. ButtonStyle
ButtonStyle > button [state] [style] [-- [!]flag... ]
Sets the button style for a title-bar button. button is the title-bar button number between 0 and 9, or one of "All", "Left", "Right", or "Reset". Button numbering is described in the Mouse command section. If the style and flags are enclosed in parentheses, then multiple state definitions can be specified per line.
state refers to which button state should be set. Button states are defined as follows: "ActiveUp" and "ActiveDown" refer to the un-pressed and pressed states for buttons on active windows; while the "InactiveUp" and "InactiveDown" states denote buttons on inactive windows. The shortcut "Active" denotes both "ActiveUp" and "ActiveDown" states. Shortcut "Inactive" denotes both "InactiveUp" and "InactiveDown" states. The similar state names like just described, but with the "Toggled" prefix are used instead for title buttons which have one of the MwmDecorMax, MwmDecorShade, MwmDecorStick or MwmDecorLayer hints, if the window is maximized, shaded, sticky or placed on specific layer, respectively.
AddToDecor Default
+ ButtonStyle 6 \
Vector 4
+ ButtonStyle 6 ToggledActiveUp \
Vector 4 [email protected] [email protected] [email protected] [email protected]
+ ButtonStyle 6 ToggledActiveDown \
Vector 4 [email protected] 85x25[email protected] [email protected] [email protected]
+ ButtonStyle 6 ToggledInactive \
Vector 4 [email protected] [email protected] [email protected] [email protected]
+ ButtonStyle 6 - MwmDecorShade
Mouse 0 6 N WindowShade
Additionally, the following shortcuts may be used: "AllNormal", "AllToggled", "AllActive", "AllInactive", "AllUp", "AllDown". They are actually different masks for 4 individual states from 8 total. These are supported too: "AllActiveUp", "AllActiveDown", "AllInactiveUp", "AllInactiveDown".
If state is specified, that particular button state is set. If state is omitted, every state is set. Specifying a style destroys the current style (use AddButtonStyle to avoid this).
If style is omitted, then state-dependent flags can be set for the primary button style without destroying the current style. Examples (each line should be considered independent):
ButtonStyle Left -- flat
ButtonStyle All ActiveUp (-- flat) Inactive (-- flat)
The first line sets every state of the left buttons to flat, while the second sets only the "ActiveUp" and "Inactive" states of every button to flat (only flags are changed; the buttons' individual styles are not changed).
If you want to reset all buttons to their defaults:
ButtonStyle Reset
To reset the "ActiveUp" button state of button 1 to the default:
ButtonStyle 1 ActiveUp Default
To reset all button states of button 1 to the default of button number 2:
ButtonStyle 1 Default 2
For any button, multiple state definitions can be given on one line by enclosing the style and flags in parentheses. If only one definition per line is given the parentheses can be omitted.
flags affect the specified state. If a '!' is prefixed to any flag, its behavior is negated. The available state-dependent flags for all styles are described here (the ButtonStyle entry deals with state-independent flags).
Raised causes a raised relief pattern to be drawn.
Sunk causes a sunken relief pattern to be drawn.
Flat inhibits the relief pattern from being drawn.
UseTitleStyle causes the given button state to render the current title style before rendering the buttons' own styles. The Raised, Flat and Sunk TitleStyle flags are ignored since they are redundant in this context.
UseBorderStyle causes the button to inherit the decorated BorderStyle options.
Raised, Sunk and Flat are mutually exclusive, and can be specified for the initial ButtonStyle only. UseTitleStyle and UseBorderStyle are also mutually exclusive (both can be off however). The default is Raised with both UseBorderStyle and UseTitleStyle left unset.
Important
for the "ActiveDown" and "InactiveDown" states: When a button is pressed, the relief is inverted. Because of this, to obtain the raised look in "ActiveDown" or "InactiveDown" states you must specify the opposite of the desired relief (i.e. Sunk for "ActiveDown" or "InactiveDown"). This behavior is consistent, but may seem confusing at first. The same applies to the "Toggled" states.
Button styles are classified as non-destructive, partially destructive, or fully destructive. Non-destructive styles do not affect the image. Partially destructive styles can obscure some or all parts of the underlying image (i.e. Pixmap). Fully destructive styles obscure the entire underlying image (i.e. Solid or one of the gradient styles). Thus, if stacking styles with AddButtonStyle (or AddTitleStyle for title-bars), use care in sequencing styles to minimize redraw.
The available styles are:
Simple, Default, Solid, Colorset, Vector, ?Gradient, Pixmap, AdjustedPixmap, ShrunkPixmap, StretchedPixmap, TiledPixmap, MiniIcon
The description of these styles and their arguments follow:
The Simple style does nothing. There are no arguments, and this style is an example of a non-destructive button style.
The Default style conditionally accepts one argument: a number which specifies the default button number to load. If the style command given is ButtonStyle or AddButtonStyle, the argument is optional (if given, it overrides the current button). If a command other than ButtonStyle or AddButtonStyle is used, the number must be specified.
The Solid style fills the button with a solid color. The relief border color is not affected. The color is specified as a single argument. This style is fully destructive.
The Colorset cs [alpha] style fills the button with the Colorset cs. The optional alpha argument is a percentage between 0 and 100. It causes fvwm to merge the colorset background onto the button using this percentage. If the percentage is 0 the colorset background is hidden and if it is 100 the colorset background is fully applied. The default is 100. So, the destructiveness depends on the alpha argument.
The Vector num X[offsetp]xY[offsetp]@C ... style draws a line pattern. Since this is a standard button style, the keyword Vector is optional, num is a number of point specifications of the form X[offsetp]xY[offsetp]@C ... X and Y are point coordinates inside the button, given in percents (from 0 to 100). An optional absolute offset in pixels, can be given as "+<offset>p" for a positive or "-<offset>p" for a negative offset.
C specifies a line color (0 - the shadow color, 1 - the highlight color, 2 - the background color, 3 - the foreground color, 4 - only move the point, do not draw). The first point color is not used. You can use up to 10000 points in a line pattern. This style is partially destructive.
The specification is a little cumbersome:
ButtonStyle 2 Vector 4 [email protected] [email protected] [email protected] [email protected]
then the button 2 decoration uses a 4-point pattern consisting of a line from (x=50,y=30) to (70,70) in the shadow color (@0), and then to (30,70) in the shadow color, and finally to (50,30) in the highlight color (@1). Is that too confusing? See the fvwm web pages for some examples with screenshots.
A more complex example of Vector:
ButtonStyle 8 Vector 10 [email protected] [email protected] \
[email protected] [email protected] [email protected] [email protected] [email protected] \
[email protected] [email protected] [email protected]
ButtonStyle 0 Vector 10 [email protected] [email protected] \
[email protected] [email protected] [email protected] [email protected] [email protected] \
[email protected] [email protected] [email protected]
The ?Gradient styles denote color gradients. Fill in the question mark with any one of the defined gradient types. Please refer to the Color Gradients section for a description of the gradient syntax. The gradient styles are fully destructive.
The Pixmap style displays a pixmap. A pixmap should be specified as an argument. For example, the following would give button number 2 the same pixmap for all 4 states (2 active and 2 inactive), and button number 4 all different pixmaps.
ButtonStyle 2 Pixmap my_pixmap.xpm
ButtonStyle 4 \
ActiveUp (Pixmap activeup.xpm) \
ActiveDown (Pixmap activedown.xpm) \
Inactive (Pixmap inactiveup.xpm)
ButtonStyle 4 \
InactiveDown Pixmap inactivedown.xpm
The pixmap specification can be given as an absolute or relative pathname (see ImagePath). If the pixmap cannot be found, the button style reverts to Simple. Flags specific to the Pixmap style are Left, Right, Top, and Bottom. These can be used to justify the pixmap (default is centered for both directions). Pixmap transparency is used for the color "None." This style is partially destructive.
The AdjustedPixmap style is similar to the Pixmap style. But the image is resized to exactly fit the button.
The ShrunkPixmap style is similar to the Pixmap style. But if the image is bigger than the button the image is resized to fit into the button.
The StretchedPixmap style is similar to the Pixmap style. But if the image is smaller than the button the image is resized to cover the button.
The TiledPixmap style accepts a pixmap to be tiled as the button background. One pixmap is specified as an argument. Pixmap transparency is not used. This style is fully destructive.
The MiniIcon style draws the window's miniature icon in the button, which is specified with the MiniIcon option of the Style command. This button style accepts no arguments. Example:
Style * MiniIcon mini-bx2.xpm
Style xterm MiniIcon mini-term.xpm
Style Emacs MiniIcon mini-doc.xpm
ButtonStyle 1 MiniIcon
ButtonStyle button - [!]flag...
Sets state-independent flags for the specified button. State-independent flags affect button behavior. Each flag is separated by a space. If a '!' is prefixed to the flag then the behavior is negated. The special flag Clear clears any existing flags.
The following flags are usually used to tell fvwm which buttons should be affected by mwm function hints (see MwmFunctions option of the Style command. This is not done automatically since you might have buttons bound to complex functions, for instance.
MwmDecorMenu should be assigned to title-bar buttons which display a menu. The default assignment is the leftmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden.
MwmDecorMin should be assigned to title-bar buttons which minimize or iconify the window. The default assignment is the second button over from the rightmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden.
MwmDecorMax should be assigned to title-bar buttons which maximize the window. The default assignment is the rightmost button. When a window with the MwmFunctions Style option requests not to show this button, it is hidden. When the window is maximized, the vector pattern on the button looks pressed in.
MwmDecorShade should be assigned to title-bar buttons which shade the window (see WindowShade command). When the window is shaded, the vector pattern on the button looks pressed in.
MwmDecorStick should be assigned to title-bar buttons which make the window sticky. When the window is sticky, the vector pattern on the button looks pressed in.
The flag MwmDecorLayer layer should be assigned to title-bar buttons which place the window in the layer numbered layer. When the window is on that specific layer, the vector pattern on the button looks pressed in.
31.8.7. ChangeDecor
ChangeDecor decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Changes the decor of a window to decor. decor is "Default" or the name of a decor defined with AddToDecor. If decor is invalid, nothing occurs. If called from somewhere in a window or its border, then that window is affected. If called from the root window the user is allowed to select the target window. ChangeDecor only affects attributes which can be set using the AddToDecor command.
ChangeDecor CustomDecor1
31.8.8. DestroyDecor
DestroyDecor [recreate] decor
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
Deletes the decor defined with AddToDecor, so that subsequent references to it are no longer valid. Windows using this decor revert to the "Default" decor. The optional parameter recreate tells fvwm not to throw away the decor completely but to throw away only its contents. If the decor is created again later, windows do not use it before the UseDecor style is applied again unless the decor was destroyed with the recreate option. The decor named "Default" cannot be destroyed.
DestroyDecor CustomDecor1
31.8.9. TitleStyle
TitleStyle [justification] [Height [num]] [MinHeight [num]]
Sets attributes for the title-bar. Justifications can be Centered, RightJustified or LeftJustified. Height sets the title bar's height to an amount in pixels. MinHeight sets the minimal height in pixels of the title bar. Defaults are Centered, the window's font height and no minimal height. To reset the font height to the default value, omit the num argument after the Height keyword. The MinHeight height is reseted by Height or if given with no argument. Example:
TitleStyle LeftJustified Height 24
TitleStyle [state] [style] [-- [!]flag... ]
Sets the style for the title-bar. See also AddTitleStyle and ButtonStyle state can be one of "ActiveUp", "ActiveDown", "InactiveUp", or "InactiveDown". Shortcuts like "Active" and "Inactive" are allowed. The states with the "Toggled" prefix are allowed too, the title itself does not use "Toggled" states, but these states are used for the buttons with ButtonStyle UseTitleStyle. If state is omitted, then the style is added to every state. If parentheses are placed around the style and flags, then multiple state definitions can be given per line. style can be omitted so that flags can be set while not destroying the current style.
If a '!' is prefixed to any flag, its behavior is negated. Valid flags for each state include Raised, Flat and Sunk (these are mutually exclusive). The default is Raised. See the note in ButtonStyle regarding the "ActiveDown" state. Examples:
TitleStyle ActiveUp HGradient 16 navy black
TitleStyle \
ActiveDown (Solid red -- flat) \
Inactive (TiledPixmap wood.xpm)
TitleStyle \
ActiveUp (-- Flat) \
ActiveDown (-- Raised) \
InactiveUp (-- Flat) \
InactiveDown (-- Sunk)
This sets the "ActiveUp" state to a horizontal gradient, the "ActiveDown" state to solid red, and the "Inactive" states to a tiled wood pixmap. Finally, "ActiveUp" and "InactiveUp" are set to look flat, while "ActiveDown" set to be sunk (the Raised flag for the "ActiveDown" state causes it to appear sunk due to relief inversion), and "InactiveDown" is set to look raised. An example which sets flags for all states:
TitleStyle -- flat
For a flattened look:
TitleStyle -- flat
ButtonStyle All Active (-- flat) Inactive (-- flat)
TitleStyle accepts all the ButtonStyle styles and arguments:
Simple, Default, Solid, Colorset, Vector, ?Gradient, Pixmap, AdjustedPixmap, ShrunkPixmap, StretchedPixmap, TiledPixmap, MiniIcon.
See the ButtonStyle command for a description of all these styles and their arguments.
In addition to these styles TitleStyle accepts a powerful MultiPixmap option. This allows you to specify different pixmaps, colorsets or colors for different parts of the titlebar. Some of them are tiled or stretched to fit a particular space; others are discrete "transition" images. The definable sections are:
Main
The full titlebar
LeftMain
Left of title text
RightMain
Right of title text
UnderText
Underneath title text
LeftOfText
just to the left of the title text
RightOfText
just to the right of the title text
LeftEnd
at the far left end of the titlebar (just after left buttons if any)
RightEnd
at the far right end of the titlebar (just before right buttons if any)
Buttons
under buttons in case of UseTitleStyle
LeftButtons
under left buttons in case of UseTitleStyle
RightButtons
under right buttons in case of UseTitleStyle
None of these are mandatory except for Main (or, if you do not define Main you must define both LeftMain and RightMain). If no Buttons pixmaps are defined and UseTitleStyle is specified for one or more buttons, Main, LeftMain or RightMain are used as appropriate.
The syntax for this style type is:
MultiPixmap section style arg, ...
continuing for whatever you want to define. The style can be either TiledPixmap, AdjustedPixmap, Colorset or Solid. See the ButtonStyle command for the description of these styles. In the case of a transition section, LeftEnd, LeftOfText, RightOfText or RightEnd, AdjustedPixmap only resize the pixmap in the "y" direction. For the Colorset and Solid styles a width of the half of the title bar height is assumed for the transition sections.
An example:
MultiPixmap Main AdjustedPixmap foo.xpm, \
UnderText TiledPixmap bar.xpm, \
Buttons Colorset 2
Note that the old syntax is still supported: if the style is omitted, TiledPixmap is assumed and adding "(stretched)" between the section and the file name implies AdjustedPixmap.
31.8.10. UpdateDecor
UpdateDecor [decor]
This command is deprecated and will be removed in the future. There are plans to replace it with a more flexible solution in fvwm-3.0.
This command is kept mainly for backward compatibility. Since all elements of a decor are updated immediately when they are changed, this command is mostly useless.
Updates window decorations. decor is an optional argument which specifies the decor to update. If given, only windows which are assigned to that particular decor are updated. This command is useful, for instance, after a ButtonStyle, TitleStyle or BorderStyle (possibly used in conjunction with AddToDecor). Specifying an invalid decor results in all windows being updated. This command is less disturbing than Recapture, but does not affect window style options as Recapture does.