diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Let a commit's labels wrap apart from its subject
The labels sat flush against the subject's last word, which made the
two one unbreakable run, so a narrow cell stranded a word on its own
line. A space now precedes each label and carries its gap, and a line
that breaks there drops it, so a wrapped label starts flush.
Diffstat (limited to '')
| -rw-r--r-- | assets/cgit.css | 19 | |
| -rw-r--r-- | source/ui-log.c | 6 |
2 files changed, 19 insertions, 6 deletions
diff --git a/assets/cgit.css b/assets/cgit.css index fb2adfc..9e928f8 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -1119,6 +1119,10 @@ div#cgit .footer a:hover { text-decoration: underline; } +div#cgit span.decoration { + word-spacing: 0.23em; +} + div#cgit a.branch-deco, div#cgit a.tag-deco, div#cgit a.tag-annotated-deco, @@ -1129,7 +1133,7 @@ div#cgit a.deco { div#cgit a.branch-deco { color: var(--deco-fg); - margin: 0 0.5em; + margin: 0 0.5em 0 0; padding: 0 0.25em; background-color: var(--branch-bg); border: solid 1px var(--branch-bd); @@ -1138,7 +1142,7 @@ div#cgit a.branch-deco { div#cgit a.tag-deco { color: var(--deco-fg); - margin: 0 0.5em; + margin: 0 0.5em 0 0; padding: 0 0.25em; background-color: var(--tag-bg); border: solid 1px var(--tag-bd); @@ -1147,7 +1151,7 @@ div#cgit a.tag-deco { div#cgit a.tag-annotated-deco { color: var(--deco-fg); - margin: 0 0.5em; + margin: 0 0.5em 0 0; padding: 0 0.25em; background-color: var(--tag-ann-bg); border: solid 1px var(--tag-ann-bd); @@ -1156,7 +1160,7 @@ div#cgit a.tag-annotated-deco { div#cgit a.remote-deco { color: var(--deco-fg); - margin: 0 0.5em; + margin: 0 0.5em 0 0; padding: 0 0.25em; background-color: var(--remote-bg); border: solid 1px var(--remote-bd); @@ -1165,7 +1169,7 @@ div#cgit a.remote-deco { div#cgit a.deco { color: var(--deco-fg); - margin: 0 0.5em; + margin: 0 0.5em 0 0; padding: 0 0.25em; background-color: var(--head-bg); border: solid 1px var(--head-bd); @@ -1177,10 +1181,13 @@ div#cgit div.commit-subject a.tag-deco, div#cgit div.commit-subject a.tag-annotated-deco, div#cgit div.commit-subject a.remote-deco, div#cgit div.commit-subject a.deco { - margin-left: 1em; font-size: 80%; } +div#cgit div.commit-subject span.decoration { + word-spacing: 0.55em; +} + div#cgit table.stats { border: solid 1px var(--border-strong); display: block; diff --git a/source/ui-log.c b/source/ui-log.c index 2812246..a01ef4e 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -428,14 +428,18 @@ void cgit_print_commit_decorations(struct commit *commit) int is_annotated = 0; buf = prettify_refname(deco->name); + // The space ahead of each label is where a narrow cell may break + // the line, and the stylesheet widens it into the gap. switch (deco->type) { case DECORATION_NONE: break; case DECORATION_REF_LOCAL: + html(" "); cgit_log_link(buf, NULL, "branch-deco", buf, NULL, ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0); break; case DECORATION_REF_TAG: + html(" "); if (!refs_read_ref(get_main_ref_store(the_repository), deco->name, &oid_tag) && !peel_object(the_repository, &oid_tag, &peeled, PEEL_OBJECT_VERIFY_TAGGED_OBJECT_TYPE)) @@ -445,12 +449,14 @@ void cgit_print_commit_decorations(struct commit *commit) case DECORATION_REF_REMOTE: if (!ctx.repo->enable_remote_branches) break; + html(" "); cgit_log_link( buf, NULL, "remote-deco", NULL, oid_to_hex(&commit->object.oid), ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg, 0 ); break; default: + html(" "); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); break; |
