Fixed header drag in log being too fast in hight density displays
This commit is contained in:
parent
5a4f67bad6
commit
de64d43c15
@ -1,48 +0,0 @@
|
|||||||
package com.jetpackduba.gitnuro.ui.components
|
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.graphics.painter.Painter
|
|
||||||
import com.jetpackduba.gitnuro.ui.context_menu.ContextMenu
|
|
||||||
import com.jetpackduba.gitnuro.ui.context_menu.ContextMenuElement
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun <T> SideMenuPanel(
|
|
||||||
title: String,
|
|
||||||
icon: Painter? = null,
|
|
||||||
items: List<T>,
|
|
||||||
isExpanded: Boolean = false,
|
|
||||||
onExpand: () -> Unit,
|
|
||||||
itemContent: @Composable (T) -> Unit,
|
|
||||||
headerHoverIcon: @Composable (() -> Unit)? = null,
|
|
||||||
contextItems: () -> List<ContextMenuElement> = { emptyList() },
|
|
||||||
) {
|
|
||||||
VerticalExpandable(
|
|
||||||
isExpanded = isExpanded,
|
|
||||||
onExpand = onExpand,
|
|
||||||
header = {
|
|
||||||
ContextMenu(
|
|
||||||
items = contextItems
|
|
||||||
) {
|
|
||||||
SideMenuHeader(
|
|
||||||
text = title,
|
|
||||||
icon = icon,
|
|
||||||
itemsCount = items.count(),
|
|
||||||
hoverIcon = headerHoverIcon,
|
|
||||||
isExpanded = isExpanded,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
) {
|
|
||||||
for (item in items) {
|
|
||||||
itemContent(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -595,7 +595,7 @@ fun GraphHeader(
|
|||||||
SimpleDividerLog(
|
SimpleDividerLog(
|
||||||
modifier = Modifier.draggable(
|
modifier = Modifier.draggable(
|
||||||
rememberDraggableState {
|
rememberDraggableState {
|
||||||
onPaddingChange(it * density) // Multiply by density for screens with scaling > 1
|
onPaddingChange(it / density) // Divide by density for screens with scaling > 1
|
||||||
}, Orientation.Horizontal
|
}, Orientation.Horizontal
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user