Pane size is saved in-memory to preserve it when switching between tabs
This commit is contained in:
parent
bc862b4635
commit
76a8422ac6
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
@ -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<SelectedItem> = tabState.selectedItem
|
||||
|
|
Loading…
Reference in a new issue