add scrollbar to settings

This commit is contained in:
AmirHossein Abdolmotallebi 2024-09-13 06:50:03 +03:30
parent a901ff9d21
commit 0a13a72287

View File

@ -23,6 +23,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.channels.ticker
@Composable
private fun SideBar(
@ -114,9 +115,12 @@ fun SettingsPage(
sideBarWidth = (sideBarWidth + it).coerceIn(150.dp..300.dp)
}
AnimatedContent(currentConfigurables) { configurables ->
val scrollState = rememberScrollState()
val scrollbarAdapter = rememberScrollbarAdapter(scrollState)
Box {
Column(
Modifier
.verticalScroll(rememberScrollState())
.verticalScroll(scrollState)
.padding(16.dp)
) {
for (cfg in configurables) {
@ -131,6 +135,14 @@ fun SettingsPage(
// Divider()
}
}
VerticalScrollbar(
adapter = scrollbarAdapter,
modifier = Modifier
.align(Alignment.CenterEnd)
.padding(vertical = 16.dp)
.padding(end = 2.dp),
)
}
}
}