xmonad-contrib-0.8.1: Third party extensions for xmonadSource codeContentsIndex
XMonad.Layout.Decoration
Portabilityunportable
Stabilityunstable
Maintainerandrea.rossato@unibz.it
Contents
Usage:
Description
A layout modifier and a class for easily creating decorated layouts.
Synopsis
decoration :: (DecorationStyle ds a, Shrinker s) => s -> Theme -> ds a -> l a -> ModifiedLayout (Decoration ds s) l a
data Theme = Theme {
activeColor :: String
inactiveColor :: String
urgentColor :: String
activeBorderColor :: String
inactiveBorderColor :: String
urgentBorderColor :: String
activeTextColor :: String
inactiveTextColor :: String
urgentTextColor :: String
fontName :: String
decoWidth :: Dimension
decoHeight :: Dimension
}
defaultTheme :: Theme
data Decoration ds s a
data DecorationMsg = SetTheme Theme
class (Read (ds a), Show (ds a), Eq a) => DecorationStyle ds a where
describeDeco :: ds a -> String
shrink :: ds a -> Rectangle -> Rectangle -> Rectangle
decorationEventHook :: ds a -> DecorationState -> Event -> X ()
decorationMouseFocusHook :: ds a -> DecorationState -> Event -> X ()
decorationMouseDragHook :: ds a -> DecorationState -> Event -> X ()
pureDecoration :: ds a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe Rectangle
decorate :: ds a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle)
data DefaultDecoration a = DefaultDecoration
class (Read s, Show s) => Shrinker s where
shrinkIt :: s -> String -> [String]
data DefaultShrinker
shrinkText :: DefaultShrinker
data CustomShrink = CustomShrink
isInStack :: Eq a => Stack a -> a -> Bool
isVisible :: Rectangle -> [Rectangle] -> Bool
isInvisible :: Rectangle -> [Rectangle] -> Bool
isWithin :: Rectangle -> Rectangle -> Bool
fi :: (Integral a, Num b) => a -> b
module XMonad.Layout.LayoutModifier
Usage:

This module is intended for layout developers, who want to decorate their layouts. End users will not find here very much for them.

For examples of DecorationStyle instances you can have a look at XMonad.Layout.SimpleDecoration, XMonad.Layout.Tabbed, XMonad.Layout.DwmStyle, or XMonad.Layout.TabBarDecoration.

decoration :: (DecorationStyle ds a, Shrinker s) => s -> Theme -> ds a -> l a -> ModifiedLayout (Decoration ds s) l aSource

A layout modifier that, with a Shrinker, a Theme, a DecorationStyle, and a layout, will decorate this layout according to the decoration style provided.

For some usage examples see XMonad.Layout.DecorationMadness.

data Theme Source

A Theme is a record of colors, font etc., to customize a DecorationStyle.

For a collection of Themes see XMonad.Util.Themes

Constructors
Theme
activeColor :: StringColor of the active window
inactiveColor :: StringColor of the inactive window
urgentColor :: StringColor of the urgent window
activeBorderColor :: StringColor of the border of the active window
inactiveBorderColor :: StringColor of the border of the inactive window
urgentBorderColor :: StringColor of the border of the urgent window
activeTextColor :: StringColor of the text of the active window
inactiveTextColor :: StringColor of the text of the inactive window
urgentTextColor :: StringColor of the text of the urgent window
fontName :: StringFont name
decoWidth :: DimensionMaximum width of the decorations (if supported by the DecorationStyle)
decoHeight :: DimensionHeight of the decorations
show/hide Instances
defaultTheme :: ThemeSource
The default xmonad Theme.
data Decoration ds s a Source
The Decoration LayoutModifier. This data type is an instance of the LayoutModifier class. This data type will be passed, together with a layout, to the ModifiedLayout type constructor to modify the layout by adding decorations according to a DecorationStyle.
show/hide Instances
(DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration ds s) Window
(Read s, Read (ds a)) => Read (Decoration ds s a)
(Show s, Show (ds a)) => Show (Decoration ds s a)
data DecorationMsg Source
A Decoration layout modifier will handle SetTheme, a message to dynamically change the decoration Theme.
Constructors
SetTheme Theme
show/hide Instances
class (Read (ds a), Show (ds a), Eq a) => DecorationStyle ds a whereSource
The DecorationStyle class, defines methods used in the implementation of the Decoration LayoutModifier instance. A type instance of this class is passed to the Decoration type in order to decorate a layout, by using these methods.
Methods
describeDeco :: ds a -> StringSource
The description that the Decoration modifier will display.
shrink :: ds a -> Rectangle -> Rectangle -> RectangleSource
Shrink the window's rectangle when applying a decoration.
decorationEventHook :: ds a -> DecorationState -> Event -> X ()Source
The decoration event hook, where the decorationMouseFocusHook and decorationMouseDragHook are called. If you reimplement it those methods will not be called.
decorationMouseFocusHook :: ds a -> DecorationState -> Event -> X ()Source
This method is called when the user clicks the pointer over the decoration.
decorationMouseDragHook :: ds a -> DecorationState -> Event -> X ()Source
This method is called when the user starts grabbing the decoration.
pureDecoration :: ds a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> Maybe RectangleSource
The pure version of the main method, decorate.
decorate :: ds a -> Dimension -> Dimension -> Rectangle -> Stack a -> [(a, Rectangle)] -> (a, Rectangle) -> X (Maybe Rectangle)Source
Given the theme's decoration width and height, the screen rectangle, the windows stack, the list of windows and rectangles returned by the underlying layout and window to be decorated, tupled with its rectangle, produce a Just Rectangle or Nothing if the window is not to be decorated.
show/hide Instances
data DefaultDecoration a Source
The default DecorationStyle, with just the default methods' implementations.
Constructors
DefaultDecoration
show/hide Instances
class (Read s, Show s) => Shrinker s whereSource
Methods
shrinkIt :: s -> String -> [String]Source
show/hide Instances
data DefaultShrinker Source
show/hide Instances
shrinkText :: DefaultShrinkerSource
data CustomShrink Source
Constructors
CustomShrink
show/hide Instances
isInStack :: Eq a => Stack a -> a -> BoolSource
True if the window is in the Stack. The Window comes second to facilitate list processing, even though w `isInStack` s won't work...;)
isVisible :: Rectangle -> [Rectangle] -> BoolSource
Given a Rectangle and a list of Rectangles is True if the Rectangle is not completely contained by any Rectangle of the list.
isInvisible :: Rectangle -> [Rectangle] -> BoolSource
The contrary of isVisible.
isWithin :: Rectangle -> Rectangle -> BoolSource
True is the first Rectangle is totally within the second Rectangle.
fi :: (Integral a, Num b) => a -> bSource
Short-hand for fromIntegral
module XMonad.Layout.LayoutModifier
Produced by Haddock version 2.4.2