summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/X11
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-16 17:00:07 +0100
committerjao <jao@gnu.org>2022-09-16 17:00:52 +0100
commit98438363998a992ded2318d51a614c616a365f6d (patch)
tree3bdb826e156c63a4299bbadfb87fcb9c030850b8 /src/Xmobar/X11
parent684fee419fb6ee35efd28c196b0c520d800fffa9 (diff)
downloadxmobar-98438363998a992ded2318d51a614c616a365f6d.tar.gz
xmobar-98438363998a992ded2318d51a614c616a365f6d.tar.bz2
little clean-ups
Diffstat (limited to 'src/Xmobar/X11')
-rw-r--r--src/Xmobar/X11/Boxes.hs5
-rw-r--r--src/Xmobar/X11/CairoDraw.hs4
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)