@ -23,7 +23,9 @@ import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.WindowState
import androidx.compose.ui.window.singleWindowApplication
import androidx.compose.ui.window.singleWindowApplication
import org.jetbrains.compose.splitpane.ExperimentalSplitPaneApi
import org.jetbrains.compose.splitpane.ExperimentalSplitPaneApi
import org.jetbrains.compose.splitpane.HorizontalSplitPane
import org.jetbrains.compose.splitpane.HorizontalSplitPane
@ -36,8 +38,12 @@ private fun Modifier.cursorForHorizontalResize(): Modifier =
@OptIn ( ExperimentalSplitPaneApi :: class )
@OptIn ( ExperimentalSplitPaneApi :: class )
fun main ( ) = singleWindowApplication (
fun main ( ) = singleWindowApplication (
state = WindowState (
size = DpSize ( 800. dp , 700. dp )
) ,
title = " SplitPane demo "
title = " SplitPane demo "
) {
) {
MaterialTheme {
MaterialTheme {
val splitterState = rememberSplitPaneState ( )
val splitterState = rememberSplitPaneState ( )
val hSplitterState = rememberSplitPaneState ( )
val hSplitterState = rememberSplitPaneState ( )
@ -53,6 +59,13 @@ fun main() = singleWindowApplication(
Text ( if ( hSplitterState . moveEnabled ) " Freeze H " else " Unfreeze H " )
Text ( if ( hSplitterState . moveEnabled ) " Freeze H " else " Unfreeze H " )
}
}
Button ( onClick = { splitterState . firstVisible = ! splitterState . firstVisible } ) {
Text ( if ( splitterState . firstVisible ) " Hide V First " else " Show V First " )
}
Button ( onClick = { hSplitterState . firstVisible = ! hSplitterState . firstVisible } ) {
Text ( if ( hSplitterState . firstVisible ) " Hide H First " else " Show H First " )
}
OutlinedTextField ( value = delta , onValueChange = { delta = it } , label = { Text ( " Delta " ) } )
OutlinedTextField ( value = delta , onValueChange = { delta = it } , label = { Text ( " Delta " ) } )
Button ( onClick = { delta . toFloatOrNull ( ) ?. let { splitterState . dispatchRawMovement ( it ) } } ) {
Button ( onClick = { delta . toFloatOrNull ( ) ?. let { splitterState . dispatchRawMovement ( it ) } } ) {
Text ( " Add delta V " )
Text ( " Add delta V " )