From 9b1f3bdd97727fbc5ea36d290049d3493236acee Mon Sep 17 00:00:00 2001 From: Noah Bond Date: Tue, 14 Mar 2023 14:44:14 -0700 Subject: [PATCH] Bug 1820897 - Disable the private theme from being used in the Composified Tabs Tray --- .../org/mozilla/fenix/tabstray/TabsTray.kt | 19 ++++++++----------- .../fenix/tabstray/TabsTrayFragment.kt | 3 ++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/tabstray/TabsTray.kt b/app/src/main/java/org/mozilla/fenix/tabstray/TabsTray.kt index ead53ab533..212ad5cd05 100644 --- a/app/src/main/java/org/mozilla/fenix/tabstray/TabsTray.kt +++ b/app/src/main/java/org/mozilla/fenix/tabstray/TabsTray.kt @@ -27,7 +27,6 @@ import mozilla.components.lib.state.ext.observeAsComposableState import org.mozilla.fenix.compose.Divider import org.mozilla.fenix.compose.annotation.LightDarkPreview import org.mozilla.fenix.theme.FirefoxTheme -import org.mozilla.fenix.theme.Theme /** * Top-level UI for displaying the Tabs Tray feature. @@ -76,16 +75,14 @@ fun TabsTray( ) { position -> when (Page.positionToPage(position)) { Page.NormalTabs -> { - FirefoxTheme(theme = Theme.getTheme(allowPrivateTheme = false)) { - if (displayTabsInGrid) { - TabGrid( - tabs = normalTabs, - ) - } else { - TabList( - tabs = normalTabs, - ) - } + if (displayTabsInGrid) { + TabGrid( + tabs = normalTabs, + ) + } else { + TabList( + tabs = normalTabs, + ) } } Page.PrivateTabs -> { diff --git a/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayFragment.kt b/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayFragment.kt index 14ba8594aa..20f13e4304 100644 --- a/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayFragment.kt @@ -61,6 +61,7 @@ import org.mozilla.fenix.tabstray.ext.make import org.mozilla.fenix.tabstray.ext.showWithTheme import org.mozilla.fenix.tabstray.syncedtabs.SyncedTabsIntegration import org.mozilla.fenix.theme.FirefoxTheme +import org.mozilla.fenix.theme.Theme import org.mozilla.fenix.theme.ThemeManager import org.mozilla.fenix.utils.allowUndo import kotlin.math.max @@ -205,7 +206,7 @@ class TabsTrayFragment : AppCompatDialogFragment() { ) tabsTrayComposeBinding.root.setContent { - FirefoxTheme { + FirefoxTheme(theme = Theme.getTheme(allowPrivateTheme = false)) { TabsTray( tabsTrayStore = tabsTrayStore, displayTabsInGrid = requireContext().settings().gridTabView,