Removed delay when clicking on a branch in the side panel
This commit is contained in:
parent
d7f69f69ff
commit
7ce7285d70
1 changed files with 6 additions and 6 deletions
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
package com.jetpackduba.gitnuro.ui.components
|
package com.jetpackduba.gitnuro.ui.components
|
||||||
|
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.*
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.combinedClickable
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.material.Icon
|
import androidx.compose.material.Icon
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
|
@ -17,6 +15,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.unit.Dp
|
import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.jetpackduba.gitnuro.extensions.backgroundIf
|
import com.jetpackduba.gitnuro.extensions.backgroundIf
|
||||||
|
import com.jetpackduba.gitnuro.extensions.onDoubleClick
|
||||||
import com.jetpackduba.gitnuro.theme.backgroundSelected
|
import com.jetpackduba.gitnuro.theme.backgroundSelected
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ fun SideMenuSubentry(
|
||||||
iconResourcePath: String,
|
iconResourcePath: String,
|
||||||
isSelected: Boolean,
|
isSelected: Boolean,
|
||||||
extraPadding: Dp = 0.dp,
|
extraPadding: Dp = 0.dp,
|
||||||
onClick: (() -> Unit)? = null,
|
onClick: () -> Unit,
|
||||||
onDoubleClick: (() -> Unit)? = null,
|
onDoubleClick: (() -> Unit)? = null,
|
||||||
additionalInfo: @Composable () -> Unit = {}
|
additionalInfo: @Composable () -> Unit = {}
|
||||||
) {
|
) {
|
||||||
|
@ -37,9 +36,10 @@ fun SideMenuSubentry(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.height(ENTRY_HEIGHT.dp)
|
.height(ENTRY_HEIGHT.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.clickable { onClick() }
|
||||||
.run {
|
.run {
|
||||||
if (onClick != null)
|
if (onDoubleClick != null)
|
||||||
combinedClickable(onClick = onClick, onDoubleClick = onDoubleClick)
|
this.onDoubleClick(onDoubleClick)
|
||||||
else
|
else
|
||||||
this
|
this
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue