Skip to content

Commit

Permalink
don't close overlay form when tabbing in from another app (fix #5804)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Aug 18, 2024
1 parent a6c49bc commit 9a73dc0
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class MainFragment :

private var wasFollowingPosition: Boolean? = null
private var wasNavigationMode: Boolean? = null
private var selectedOverlay: Overlay? = null

private var windowInsets: Insets? = null

Expand Down Expand Up @@ -291,6 +292,13 @@ class MainFragment :
observe(controlsViewModel.selectedOverlay) { overlay ->
val iconRes = overlay?.icon ?: R.drawable.ic_overlay_black_24dp
binding.overlaysButton.setImageResource(iconRes)
if (selectedOverlay != overlay) {
val f = bottomSheetFragment
if (f is IsShowingElement) {
closeBottomSheet()
}
}
selectedOverlay = overlay
}
observe(controlsViewModel.isTeamMode) { isTeamMode ->
if (isTeamMode) {
Expand All @@ -309,11 +317,6 @@ class MainFragment :
val isCreateNodeEnabled = overlay?.isCreateNodeEnabled == true
binding.createButton.isGone = !isCreateNodeEnabled
binding.crosshairView.isGone = !isCreateNodeEnabled

val f = bottomSheetFragment
if (f is IsShowingElement) {
closeBottomSheet()
}
}
observe(editHistoryViewModel.editItems) { editItems ->
if (editItems.isEmpty()) closeEditHistorySidebar()
Expand Down

0 comments on commit 9a73dc0

Please sign in to comment.