From ff2ddd90a23d70e8e645e610486320876536a305 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 6 Dec 2022 10:24:44 -0800 Subject: [PATCH] can click on linetext to select them --- src/main.tsx | 8 +++++++- src/sh2.less | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 45b6f9c8d..bacc25fad 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -159,13 +159,19 @@ class LineAvatar extends React.Component<{line : LineType, cmd : Cmd}, {}> { @mobxReact.observer class LineText extends React.Component<{sw : ScreenWindow, line : LineType}, {}> { + @boundMethod + clickHandler() { + let {line} = this.props; + GlobalCommandRunner.swSelectLine(String(line.linenum)); + } + render() { let {sw, line} = this.props; let formattedTime = getLineDateStr(line.ts); let isSelected = (sw.selectedLine.get() == line.linenum); let isFocused = (sw.focusType.get() == "cmd"); return ( -
+
S diff --git a/src/sh2.less b/src/sh2.less index 31cb1f259..c040c1f84 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -390,7 +390,7 @@ html, body, #main { flex-direction: column; scroll-margin-bottom: 20px; position: relative; - + .avatar { cursor: pointer; } @@ -526,6 +526,11 @@ html, body, #main { border-top: none; } + &:hover .focus-indicator { + display: block; + background-color: #222; + } + .focus-indicator { position: absolute; display: none;