diff --git a/src/consts.typ b/src/consts.typ index 6ef5240..bac5d0c 100644 --- a/src/consts.typ +++ b/src/consts.typ @@ -15,4 +15,6 @@ #let COLLECTIONS-DY = 3 #let QUEUE-PAD = (5pt, 3pt) -#let COL-DESTRUCTION = rgb("#A80238") \ No newline at end of file +#let COL-DESTRUCTION = rgb("#A80238") +#let COL-GRP-NAME = rgb("#EEEEEE") +#let COL-SEP-NAME = rgb("#EEEEEE") \ No newline at end of file diff --git a/src/group.typ b/src/group.typ index 4c20f89..0598beb 100644 --- a/src/group.typ +++ b/src/group.typ @@ -1,4 +1,5 @@ #import "@preview/cetz:0.2.2": draw +#import "consts.typ": * #let _grp(name, desc: none, type: "default", elmts) = { return (( @@ -12,7 +13,8 @@ #let render(x0, x1, y0, y1, group) = { let shapes = () - let m = measure(box(group.name)) + let name = text(group.name, weight: "bold") + let m = measure(box(name)) let w = m.width / 1pt + 15 let h = m.height / 1pt + 6 shapes += draw.rect( @@ -20,7 +22,7 @@ (x1, y1) ) shapes += draw.merge-path( - fill: gray.lighten(20%), + fill: COL-GRP-NAME, close: true, { draw.line( @@ -34,7 +36,7 @@ ) shapes += draw.content( (x0, y0), - group.name, + name, anchor: "north-west", padding: (left: 5pt, right: 10pt, top: 3pt, bottom: 3pt) ) diff --git a/src/separator.typ b/src/separator.typ index eed197a..9669cad 100644 --- a/src/separator.typ +++ b/src/separator.typ @@ -26,17 +26,26 @@ let xr = cx + w / 2 y -= h / 2 - shapes += draw.line((x0, y), (xl, y)) - shapes += draw.line((xr, y), (x1, y)) + shapes += draw.rect( + (x0, y), + (x1, y - 3), + stroke: none, + fill: white + ) + shapes += draw.line((x0, y), (x1, y)) + //shapes += draw.line((x0, y), (xl, y)) + //shapes += draw.line((xr, y), (x1, y)) y -= 3 - shapes += draw.line((x0, y), (xl, y)) - shapes += draw.line((xr, y), (x1, y)) + shapes += draw.line((x0, y), (x1, y)) + //shapes += draw.line((x0, y), (xl, y)) + //shapes += draw.line((xr, y), (x1, y)) shapes += draw.content( ((x0 + x1) / 2, y + 1.5), elmt.name, anchor: "center", padding: (5pt, 3pt), - frame: "rect" + frame: "rect", + fill: COL-SEP-NAME ) y -= h / 2 y -= Y-SPACE