diff options
author | bptato <nincsnevem662@gmail.com> | 2021-11-14 12:57:50 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-11-14 13:00:34 +0100 |
commit | 60b583516262be8754c6563ed9253b8964bef5d8 (patch) | |
tree | d77fabc0eb4b8ce4432b45a1845999c9a0698e40 /src/io/cell.nim | |
parent | a6099512e42cc95cf6276ab784afd70febdd43b7 (diff) | |
download | chawan-60b583516262be8754c6563ed9253b8964bef5d8.tar.gz |
Initial implementation of CSS :hover
Diffstat (limited to 'src/io/cell.nim')
-rw-r--r-- | src/io/cell.nim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/io/cell.nim b/src/io/cell.nim index 67b7361c..d757c2de 100644 --- a/src/io/cell.nim +++ b/src/io/cell.nim @@ -5,6 +5,7 @@ import sugar import types/color import utils/twtstr +import html/dom type Formatting* = object @@ -18,6 +19,7 @@ type Cell* = object of RootObj formatting*: Formatting + nodes*: seq[Node] FlexibleCell* = object of Cell rune*: Rune @@ -38,6 +40,9 @@ func width*(line: FlexibleLine): int = for c in line: result += c.rune.width() +func width*(cell: FixedCell): int = + return cell.runes.width() + func newFormatting*(): Formatting = return Formatting(fgcolor: defaultColor, bgcolor: defaultColor) |