Fixed clicking on a log line being unresponsive
Happens when having 2 repositories with commits in common (same SHA). Instead of making fast clickable being based only on the hash, take also in consideration the viewmodel to differentiate between tabs
This commit is contained in:
parent
1d98491f71
commit
bf6afc82c6
2 changed files with 3 additions and 3 deletions
|
@ -42,10 +42,10 @@ fun Modifier.handOnHover(): Modifier {
|
|||
// TODO Try to restore hover that was shown with clickable modifier
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
fun Modifier.fastClickable(key: Any = Unit, onClick: () -> Unit) =
|
||||
fun Modifier.fastClickable(key: Any = Unit, key2: Any = Unit, onClick: () -> Unit) =
|
||||
this.handOnHover()
|
||||
.hoverBackground()
|
||||
.pointerInput(key) {
|
||||
.pointerInput(key, key2) {
|
||||
while (true) {
|
||||
val lastMouseEvent = awaitPointerEventScope { awaitFirstDownEvent() }
|
||||
val mouseEvent = lastMouseEvent.awtEventOrNull
|
||||
|
|
|
@ -751,7 +751,7 @@ fun CommitLine(
|
|||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fastClickable(graphNode) { onRevCommitSelected() }
|
||||
.fastClickable(graphNode, logViewModel) { onRevCommitSelected() }
|
||||
.padding(start = graphWidth)
|
||||
.height(LINE_HEIGHT.dp)
|
||||
.backgroundIf(isSelected, MaterialTheme.colors.backgroundSelected)
|
||||
|
|
Loading…
Reference in a new issue