Add title attribute to log title bar

This commit is contained in:
theit8514 2021-12-26 17:33:15 -05:00
parent d99b03d12e
commit 169d3e6c77

@ -140,10 +140,10 @@ function LogWindow(props: IProps): React.ReactElement {
rerender(); rerender();
} }
function title(): string { function title(full = false): string {
const maxLength = 30; const maxLength = 30;
const t = `${script.filename} ${script.args.map((x: any): string => `${x}`).join(" ")}`; const t = `${script.filename} ${script.args.map((x: any): string => `${x}`).join(" ")}`;
if (t.length <= maxLength) { if (full || t.length <= maxLength) {
return t; return t;
} }
return t.slice(0, maxLength - 3) + "..."; return t.slice(0, maxLength - 3) + "...";
@ -185,7 +185,7 @@ function LogWindow(props: IProps): React.ReactElement {
}} }}
> >
<Box className="drag" display="flex" alignItems="center"> <Box className="drag" display="flex" alignItems="center">
<Typography color="primary" variant="h6"> <Typography color="primary" variant="h6" title={title(true)}>
{title()} {title()}
</Typography> </Typography>