Skip to content

Commit

Permalink
update the colors for the dropdown button
Browse files Browse the repository at this point in the history
  • Loading branch information
frett committed Sep 16, 2024
1 parent 783ff3c commit 68d5b53
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.cru.godtools.ui.dashboard.common

import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import org.cru.godtools.base.ui.theme.GodToolsTheme

internal val dropdownButtonColors @Composable get() = ButtonDefaults.elevatedButtonColors(
containerColor = when {
GodToolsTheme.isLightColorSchemeActive -> MaterialTheme.colorScheme.background
else -> Color.Unspecified
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import org.cru.godtools.R
import org.cru.godtools.base.LocalAppLanguage
import org.cru.godtools.base.ui.theme.GodToolsTheme
import org.cru.godtools.base.ui.util.getToolCategoryName
import org.cru.godtools.ui.dashboard.common.dropdownButtonColors
import org.cru.godtools.ui.languages.LanguageName
import org.jetbrains.annotations.VisibleForTesting

Expand Down Expand Up @@ -91,6 +92,7 @@ internal fun CategoryFilter(filters: ToolsScreen.Filters, modifier: Modifier = M

ElevatedButton(
onClick = { expanded = !expanded },
colors = dropdownButtonColors,
modifier = modifier.semantics { role = Role.DropdownList }
) {
Text(
Expand Down Expand Up @@ -149,6 +151,7 @@ internal fun LanguageFilter(filters: ToolsScreen.Filters, modifier: Modifier = M

ElevatedButton(
onClick = { eventSink(ToolsScreen.FiltersEvent.ToggleLanguagesMenu) },
colors = dropdownButtonColors,
modifier = modifier.semantics { role = Role.DropdownList }
) {
Text(
Expand Down

0 comments on commit 68d5b53

Please sign in to comment.