@@ -5,8 +5,9 @@ import androidx.compose.runtime.getValue
5
5
import androidx.compose.runtime.mutableIntStateOf
6
6
import androidx.compose.runtime.remember
7
7
import androidx.compose.runtime.setValue
8
- import com.jakewharton.mosaic.LocalTerminal
8
+ import com.jakewharton.mosaic.LocalTerminalState
9
9
import com.jakewharton.mosaic.layout.background
10
+ import com.jakewharton.mosaic.layout.fillMaxSize
10
11
import com.jakewharton.mosaic.layout.fillMaxWidth
11
12
import com.jakewharton.mosaic.layout.height
12
13
import com.jakewharton.mosaic.layout.onKeyEvent
@@ -21,11 +22,11 @@ import com.jakewharton.mosaic.ui.TextStyle
21
22
22
23
@Composable
23
24
fun App (viewModel : ViewModel ) {
24
- val terminal = LocalTerminal .current
25
+ val terminal = LocalTerminalState .current
25
26
val selectedLine by viewModel.selectedLine.collectAsState()
26
27
val content by viewModel.content.collectAsState()
27
28
// subtraction of one is necessary, because there is a line with a cursor at the bottom, which moves up all the content
28
- val height = terminal.size.height - 1
29
+ val height = terminal.size.rows - 1
29
30
var offset by remember { mutableIntStateOf(0 ) }
30
31
LaunchedEffect (selectedLine.first) {
31
32
if (selectedLine.first < offset) {
@@ -40,7 +41,7 @@ fun App(viewModel: ViewModel) {
40
41
41
42
Box (
42
43
Modifier
43
- .width(terminal.size.width )
44
+ .width(terminal.size.columns )
44
45
.height(height)
45
46
.onKeyEvent { event -> viewModel.onKeyEvent(event) }
46
47
) {
0 commit comments