taffybar-4.0.1: A desktop bar similar to xmobar, but with more GUI

Copyright | (c) Ivan Malison
License | BSD3-style (see LICENSE)
Maintainer | Ivan Malison <IvanMalison@gmail.com>
Stability | unstable
Portability | unportable
Safe Haskell | Safe-Inferred
Language | Haskell2010

System.Taffybar.Widget.Util

Description

Utility functions to facilitate building GTK interfaces.

Synopsis

- onClick :: [EventType] -> IO a -> EventButton -> IO Bool
- attachPopup :: (IsWidget w, IsWindow wnd) => w -> Text -> wnd -> IO ()
- displayPopup :: (IsWidget w, IsWidget wnd, IsWindow wnd) => w -> wnd -> IO ()
- widgetGetAllocatedSize :: (IsWidget self, MonadIO m) => self -> m (Int, Int)
- colorize :: String -> String -> String -> String
- backgroundLoop :: IO a -> IO ()
- drawOn :: IsWidget object => object -> IO () -> IO object
- widgetSetClassGI :: (IsWidget b, MonadIO m) => b -> Text -> m b
- themeLoadFlags :: [IconLookupFlags]
- getImageForDesktopEntry :: Int32 -> DesktopEntry -> IO (Maybe Pixbuf)
- getImageForMaybeIconName :: Maybe Text -> Int32 -> IO (Maybe Pixbuf)
- getImageForIconName :: Text -> Int32 -> IO (Maybe Pixbuf)
- loadPixbufByName :: Int32 -> Text -> IO (Maybe Pixbuf)
- alignCenter :: (IsWidget o, MonadIO m) => o -> m ()
- vFillCenter :: (IsWidget o, MonadIO m) => o -> m ()
- pixbufNewFromFileAtScaleByHeight :: Int32 -> String -> IO (Either String Pixbuf)
- loadIcon :: Int32 -> String -> IO (Either String Pixbuf)
- setMinWidth :: (IsWidget w, MonadIO m) => Int -> w -> m w
- addClassIfMissing :: (IsDescendantOf Widget a, MonadIO m, GObject a) => Text -> a -> m ()
- removeClassIfPresent :: (IsDescendantOf Widget a, MonadIO m, GObject a) => Text -> a -> m ()
- buildPadBox :: MonadIO m => Widget -> m Widget
- buildContentsBox :: MonadIO m => Widget -> m Widget

# Documentation

onClick Source #

Arguments

:: [EventType] | Types of button clicks to listen to.
-> IO a | Action to execute.
-> EventButton |
-> IO Bool |

Execute the given action as a response to any of the given types of mouse button clicks.

attachPopup Source #

Arguments

:: (IsWidget w, IsWindow wnd) |
=> w | The widget to set as popup.
-> Text | The title of the popup.
-> wnd | The window to attach the popup to.
-> IO () |

Attach the given widget as a popup with the given title to the given window. The newly attached popup is not shown initially. Use the `displayPopup` function to display it.

displayPopup Source #

Arguments

:: (IsWidget w, IsWidget wnd, IsWindow wnd) |
=> w | The popup widget.
-> wnd | The window the widget was attached to.
-> IO () |

Display the given popup widget (previously prepared using the `attachPopup` function) immediately beneath (or above) the given window.

widgetGetAllocatedSize :: (IsWidget self, MonadIO m) => self -> m (Int, Int) Source #

colorize Source #

Arguments

:: String | Foreground color.
-> String | Background color.
-> String | Contents.
-> String |

Creates markup with the given foreground and background colors and the given contents.

backgroundLoop :: IO a -> IO () Source #

drawOn :: IsWidget object => object -> IO () -> IO object Source #

widgetSetClassGI :: (IsWidget b, MonadIO m) => b -> Text -> m b Source #

themeLoadFlags :: [IconLookupFlags] Source #

getImageForDesktopEntry :: Int32 -> DesktopEntry -> IO (Maybe Pixbuf) Source #

getImageForMaybeIconName :: Maybe Text -> Int32 -> IO (Maybe Pixbuf) Source #

getImageForIconName :: Text -> Int32 -> IO (Maybe Pixbuf) Source #

loadPixbufByName :: Int32 -> Text -> IO (Maybe Pixbuf) Source #

alignCenter :: (IsWidget o, MonadIO m) => o -> m () Source #

vFillCenter :: (IsWidget o, MonadIO m) => o -> m () Source #

pixbufNewFromFileAtScaleByHeight :: Int32 -> String -> IO (Either String Pixbuf) Source #

loadIcon :: Int32 -> String -> IO (Either String Pixbuf) Source #

setMinWidth :: (IsWidget w, MonadIO m) => Int -> w -> m w Source #

addClassIfMissing :: (IsDescendantOf Widget a, MonadIO m, GObject a) => Text -> a -> m () Source #

removeClassIfPresent :: (IsDescendantOf Widget a, MonadIO m, GObject a) => Text -> a -> m () Source #

buildPadBox :: MonadIO m => Widget -> m Widget Source #

Wrap a widget with two container boxes. The inner box will have the class "inner-pad", and the outer box will have the class "outer-pad". These boxes can be used to add padding between the outline of the widget and its contents, or for the purpose of displaying a different background behind the widget.

buildContentsBox :: MonadIO m => Widget -> m Widget Source #