Gauge direction (#326)

Add `gauge` with all the different directions.

Co-authored-by: Aleksandar Brakmic <13668697+brakmic-aleksandar@users.noreply.github.com>
This commit is contained in:
Arthur Sonzogni
2022-02-06 19:17:21 +01:00
committed by GitHub
parent 7c3ca1beb5
commit 8ba3698437
7 changed files with 369 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ using Decorator = std::function<Element(Element)>;
using GraphFunction = std::function<std::vector<int>(int, int)>;
enum BorderStyle { LIGHT, HEAVY, DOUBLE, ROUNDED, EMPTY };
enum class GaugeDirection { Left, Up, Right, Down };
// Pipe elements into decorator togethers.
// For instance the next lines are equivalents:
@@ -42,6 +43,11 @@ Element separatorStyled(BorderStyle);
Element separator(Pixel);
Element separatorCharacter(std::string);
Element gauge(float ratio);
Element gaugeLeft(float ratio);
Element gaugeRight(float ratio);
Element gaugeUp(float ratio);
Element gaugeDown(float ratio);
Element gaugeDirection(float ratio, GaugeDirection);
Element border(Element);
Element borderLight(Element);
Element borderHeavy(Element);