From d45ab5ffdfeca56c491a5aad79d96c1ffa2b44bc Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 9 Aug 2020 17:04:58 +0100 Subject: A bit of documentation for --- readme.md | 17 +++++++++++++++++ src/Xmobar/X11/Draw.hs | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index cc640af..69d26e5 100644 --- a/readme.md +++ b/readme.md @@ -272,6 +272,23 @@ For the output template: for XFT fonts. `string` will have a background matching the bar's height. +- `string` will print string surrounded by a box in the + foreground color. The `box` tag accepts several optional arguments + to tailor its looks: + - `type`: `Top`, `Bottom`, `HBoth` (a single line above or below + string, or both), `Left`, `Right`, `VBoth` (single vertical + lines), `Full` (a rectangle, the default). + - `color`: the color of the box lines. + - `width`: the width of the box lines. + - `offset`: an alignment char (L, C or R) followed by the amount of + pixels to offset the box lines; the alignment denotes the position + of the resulting line, with L/R meaning top/bottom for the + vertical lines, and left/right for horizontal ones. + + For example, a box underlining its text with a line of with 2 and a + margin of 3 pixels either side would be: + string + - `string` will print `string` with the first font from `additionalFonts`. The index `0` corresponds to the standard font. diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs index 168c551..5805b5a 100644 --- a/src/Xmobar/X11/Draw.hs +++ b/src/Xmobar/X11/Draw.hs @@ -206,4 +206,4 @@ drawBoxBorder d dr gc pos (BoxOffset alg offset) ht (x1,x2) lw (BoxMargins mt mr drawLine d dr gc (x1 + p1) (ht - lc') (x2 + p2) (ht - lc') BBLeft -> drawLine d dr gc (x1 - 1 + ml) p1 (x1 - 1 + ml) (ht + p2) BBRight -> drawLine d dr gc (x2 + lc - 1 - mr) p1 (x2 + lc - 1 - mr) (ht + p2) - _ -> error "unreachable code" \ No newline at end of file + _ -> error "unreachable code" -- cgit v1.2.3