diff options
Diffstat (limited to 'src/Xmobar/X11')
-rw-r--r-- | src/Xmobar/X11/Boxes.hs | 5 | ||||
-rw-r--r-- | src/Xmobar/X11/CairoDraw.hs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Xmobar/X11/Boxes.hs b/src/Xmobar/X11/Boxes.hs index c0eeeed..87a081f 100644 --- a/src/Xmobar/X11/Boxes.hs +++ b/src/Xmobar/X11/Boxes.hs @@ -18,6 +18,10 @@ module Xmobar.X11.Boxes (boxLines, borderRect) where import Xmobar.Run.Parsers import Xmobar.Config.Types +-- | Computes the coordinates of a list of lines representing a Box. +-- The Box is to be positioned between x0 and x1, with height ht, and drawn +-- with line width lw. The returned lists are coordinates of the beginning +-- and end of each line. boxLines :: Box -> Double -> Double -> Double -> [(Double, Double, Double, Double)] boxLines (Box bd offset lw _ margins) ht x0 x1 = case bd of @@ -39,6 +43,7 @@ boxLines (Box bd offset lw _ margins) ht x0 x1 = rleft = (xmin, ymin + p0, xmin, ymax + p1) rright = (xmax, ymin + p0, xmax, ymax + p1) +-- | Computes the rectangle (x, y, width, height) for the given Border. borderRect :: Border -> Double -> Double -> (Double, Double, Double, Double) borderRect bdr w h = case bdr of diff --git a/src/Xmobar/X11/CairoDraw.hs b/src/Xmobar/X11/CairoDraw.hs index b90b2f8..b7ecd34 100644 --- a/src/Xmobar/X11/CairoDraw.hs +++ b/src/Xmobar/X11/CairoDraw.hs @@ -35,12 +35,10 @@ import qualified Graphics.Rendering.Pango as P import Xmobar.Run.Parsers (Segment , Widget(..) , Box (..) - , BoxMargins (..) - , BoxBorder (..) - , BoxOffset (..) , TextRenderInfo (..) , colorComponents) import Xmobar.Config.Types +import Xmobar.Config.Parse (indexedFont, indexedOffset) import Xmobar.Text.Pango (fixXft) import Xmobar.X11.Types import Xmobar.X11.Boxes (boxLines, borderRect) |