Copyright | 2023 Ilya Portnov |
---|---|
License | BSD-style (see xmonad/LICENSE) |
Maintainer | portnov84@rambler.ru |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
This module contains data types and utilities to deal with decoration widgets. A widget is anything that is displayed on window decoration, and, optionally, can react on clicks. Examples of widgets are usual window buttons (minimize, maximize, close), window icon and window title.
Synopsis
- data StandardCommand
- class DecorationWidget widget => TextWidget widget where
- data GenericWidget cmd
- = TitleWidget
- | WindowIcon {
- swCommand :: !cmd
- | GenericWidget {
- swCheckedText :: !String
- swUncheckedText :: !String
- swCommand :: !cmd
- type StandardWidget = GenericWidget StandardCommand
- isWidgetChecked :: DecorationWidget widget => widget -> Window -> X Bool
- titleW :: StandardWidget
- toggleStickyW :: StandardWidget
- minimizeW :: StandardWidget
- maximizeW :: StandardWidget
- closeW :: StandardWidget
- dwmpromoteW :: StandardWidget
- moveToNextGroupW :: StandardWidget
- moveToPrevGroupW :: StandardWidget
Data types
data StandardCommand Source #
Standard window commands.
One can extend this list by simply doing
data MyWindowCommand = Std StandardCommand | SomeFancyCommand
instance WindowCommand MyWindowCommand where ...
type MyWidget = GenericWidget MyWindowCommand
FocusWindow | Focus the window |
FocusUp | Move focus to previous window |
FocusDown | Move focus to following window |
MoveToNextGroup | Move the window to the next group (see XMonad.Layout.Groups) |
MoveToPrevGroup | Move the window to the previous group |
DwmPromote | Execute |
ToggleSticky | Make window sticky or unstick it (see XMonad.Actions.CopyWindow) |
ToggleMaximize | Maximize or restore window (see XMonad.Layout.Maximize) |
Minimize | Minimize window (see XMonad.Actions.Minimize) |
CloseWindow | Close the window |
GridWindowMenu | Show window menu via XMonad.Actions.GridSelect (see XMonad.Actions.WindowMenu) |
Instances
Read StandardCommand Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets | |
Show StandardCommand Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets showsPrec :: Int -> StandardCommand -> ShowS # show :: StandardCommand -> String # showList :: [StandardCommand] -> ShowS # | |
Default StandardCommand Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets def :: StandardCommand # | |
Eq StandardCommand Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets (==) :: StandardCommand -> StandardCommand -> Bool # (/=) :: StandardCommand -> StandardCommand -> Bool # | |
WindowCommand StandardCommand Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets executeWindowCommand :: StandardCommand -> Window -> X Bool Source # isCommandChecked :: StandardCommand -> Window -> X Bool Source # | |
TextWidget StandardWidget Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets widgetString :: forall (engine :: Type -> Type -> Type). DrawData engine StandardWidget -> StandardWidget -> X String Source # |
class DecorationWidget widget => TextWidget widget where Source #
Type class for widgets that can be displayed as
text fragments by TextDecoration
engine.
widgetString :: forall (engine :: Type -> Type -> Type). DrawData engine widget -> widget -> X String Source #
Instances
TextWidget StandardWidget Source # | |
Defined in XMonad.Layout.DecorationEx.Widgets widgetString :: forall (engine :: Type -> Type -> Type). DrawData engine StandardWidget -> StandardWidget -> X String Source # |
data GenericWidget cmd Source #
Generic data type for decoration widgets.
TitleWidget | Window title (just text label) |
WindowIcon | Window icon with some associated command | Other widgets |
| |
GenericWidget | |
|
Instances
type StandardWidget = GenericWidget StandardCommand Source #
Generic widget type specialized for StandardCommand
Utility functions
isWidgetChecked :: DecorationWidget widget => widget -> Window -> X Bool Source #
Check if the widget should be displayed in checked
state.
Presets for standard widgets
titleW :: StandardWidget Source #
Widget for window title
toggleStickyW :: StandardWidget Source #
Widget for ToggleSticky command.
minimizeW :: StandardWidget Source #
Widget for Minimize command
maximizeW :: StandardWidget Source #
Widget for ToggleMaximize command
closeW :: StandardWidget Source #
Widget for CloseWindow command