ui-log: show commit message in tooltip

... now that we have the ellipsis to indicate it is available.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2024-08-05 00:25:49 +02:00
parent 1fa22df950
commit a9b646471d
2 changed files with 23 additions and 2 deletions

View File

@ -687,6 +687,24 @@ div#cgit span.msg-avail {
border-radius: 5px; border-radius: 5px;
} }
div#cgit span.msg-avail span.msg-tooltip {
color: #000;
margin: 0px 0.5em;
padding: 0px 0.25em;
background-color: #f0f0f0;
border: solid 1px #777777;
border-radius: 5px;
box-shadow: 2px 2px 7px rgba(100,100,100,0.75);
visibility: hidden;
position: absolute;
white-space: pre;
z-index: 1;
}
div#cgit span.msg-avail:hover span.msg-tooltip {
visibility: visible;
}
div#cgit a.branch-deco { div#cgit a.branch-deco {
color: #000; color: #000;
margin: 0px 0.5em; margin: 0px 0.5em;

View File

@ -243,8 +243,11 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
} }
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
oid_to_hex(&commit->object.oid), ctx.qry.vpath); oid_to_hex(&commit->object.oid), ctx.qry.vpath);
if (!ctx.qry.showmsg && info->msg && *(info->msg)) if (!ctx.qry.showmsg && info->msg && *(info->msg)) {
html("<span class='msg-avail'>...</span>"); html("<span class='msg-avail'>...<span class='msg-tooltip'>");
html_txt(info->msg);
html("</span></span>");
}
show_commit_decorations(commit); show_commit_decorations(commit);
html("</td><td>"); html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");