From 5e562b89e2b25f0b8f3e7d44ee7d793358027b93 Mon Sep 17 00:00:00 2001 From: Fabian Norlin Date: Tue, 7 Oct 2025 15:08:48 +0200 Subject: [PATCH] Fixed bug that did tabs "leak through" other tabs so you could click on them without seeing them. --- .../commonMain/kotlin/app/klottr/KlottrAppShell.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared/src/commonMain/kotlin/app/klottr/KlottrAppShell.kt b/shared/src/commonMain/kotlin/app/klottr/KlottrAppShell.kt index 760869f..0d22e46 100644 --- a/shared/src/commonMain/kotlin/app/klottr/KlottrAppShell.kt +++ b/shared/src/commonMain/kotlin/app/klottr/KlottrAppShell.kt @@ -80,6 +80,7 @@ import androidx.compose.ui.draw.alpha import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.semantics.contentDescription import androidx.compose.ui.semantics.semantics @@ -411,6 +412,8 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "home") 1f else 0f) .zIndex(if (selectedTab == "home") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv + ) { // Återanvänd gamla layoutens lista med fynd val foundList = remember(foundRefresh, forceEmptyFound) { @@ -495,6 +498,8 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "layers") 1f else 0f) .zIndex(if (selectedTab == "layers") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv + ) { // Samma innehåll som SettingsScreen men reducerat till endast lagren Column( @@ -581,6 +586,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "nearby") 1f else 0f) .zIndex(if (selectedTab == "nearby") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { var nearbySplit by rememberSaveable { mutableStateOf(0.5f) } @@ -724,6 +730,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "menu") 1f else 0f) .zIndex(if (selectedTab == "menu") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { Column( modifier = Modifier @@ -769,6 +776,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "account") 1f else 0f) .zIndex(if (selectedTab == "account") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { LaunchedEffect(selectedTab, loggedIn) { if (selectedTab != "account") return@LaunchedEffect @@ -879,6 +887,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "mynotes") 1f else 0f) .zIndex(if (selectedTab == "mynotes") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { // Ladda mina klotter när fliken blir aktiv (och när login ändras) LaunchedEffect(selectedTab, loggedIn, currentUserId) { @@ -1049,6 +1058,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "about") 1f else 0f) .zIndex(if (selectedTab == "about") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { AboutScreen( modifier = Modifier @@ -1062,6 +1072,7 @@ fun KlottrAppShell( .fillMaxSize() .alpha(if (selectedTab == "settings") 1f else 0f) .zIndex(if (selectedTab == "settings") 1f else 0f) + .pointerInput(selectedTab) { } // 👈 blockerar klick när fliken inte är aktiv ) { SettingsScreen( onlyNew = onlyNew,