diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt index c71c345..836598d 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/RepositoryOpen.kt @@ -252,8 +252,8 @@ fun MainContentView( val rebaseInteractiveState by tabViewModel.rebaseInteractiveState.collectAsState() val density = LocalDensity.current.density - var firstWidth by remember { mutableStateOf(180f) } - var thirdWidth by remember { mutableStateOf(360f) } + var firstWidth by remember(tabViewModel) { mutableStateOf(tabViewModel.firstPaneWidth) } + var thirdWidth by remember(tabViewModel) { mutableStateOf(tabViewModel.thirdPaneWidth) } TripleVerticalSplitPanel( modifier = Modifier.fillMaxSize(), @@ -370,6 +370,7 @@ fun MainContentView( if (newWidth > 150) { firstWidth = newWidth + tabViewModel.firstPaneWidth = firstWidth } }, onThirdSizeDrag = { @@ -377,6 +378,7 @@ fun MainContentView( if (newWidth > 150) { thirdWidth = newWidth + tabViewModel.thirdPaneWidth = thirdWidth } }, ) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt index 44bee41..b725855 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/viewmodels/TabViewModel.kt @@ -70,6 +70,8 @@ class TabViewModel @Inject constructor( private val tabsManager: TabsManager, private val tabScope: CoroutineScope, ) { + var firstPaneWidth = 220f + var thirdPaneWidth = 360f var initialPath: String? = null // Stores the path that should be opened when the tab is selected val errorsManager: ErrorsManager = tabState.errorsManager val selectedItem: StateFlow = tabState.selectedItem