diff options
author | jao <jao@gnu.org> | 2022-09-16 17:00:07 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-16 17:00:52 +0100 |
commit | 98438363998a992ded2318d51a614c616a365f6d (patch) | |
tree | 3bdb826e156c63a4299bbadfb87fcb9c030850b8 /src/Xmobar/X11/Boxes.hs | |
parent | 684fee419fb6ee35efd28c196b0c520d800fffa9 (diff) | |
download | xmobar-98438363998a992ded2318d51a614c616a365f6d.tar.gz xmobar-98438363998a992ded2318d51a614c616a365f6d.tar.bz2 |
little clean-ups
Diffstat (limited to 'src/Xmobar/X11/Boxes.hs')
-rw-r--r-- | src/Xmobar/X11/Boxes.hs | 5 |
1 files changed, 5 insertions, 0 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 |