From 4c4fe3f5110adf4a5ae8dcb47a8aec02eafc9def Mon Sep 17 00:00:00 2001 From: Isira Seneviratne Date: Mon, 16 Sep 2024 16:28:49 +0530 Subject: [PATCH] Add scrollbar color scheme --- .../org/schabi/newpipe/ui/components/about/AboutTab.kt | 3 ++- .../org/schabi/newpipe/ui/components/about/LicenseTab.kt | 3 ++- app/src/main/java/org/schabi/newpipe/ui/theme/Theme.kt | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/about/AboutTab.kt b/app/src/main/java/org/schabi/newpipe/ui/components/about/AboutTab.kt index 4041c6cfd6c..5298eeb18a6 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/about/AboutTab.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/about/AboutTab.kt @@ -24,6 +24,7 @@ import androidx.compose.ui.unit.dp import my.nanihadesuka.compose.ColumnScrollbar import org.schabi.newpipe.BuildConfig import org.schabi.newpipe.R +import org.schabi.newpipe.ui.theme.NewPipeScrollbarSettings import org.schabi.newpipe.util.external_communication.ShareUtils private val ABOUT_ITEMS = listOf( @@ -58,7 +59,7 @@ private class AboutData( fun AboutTab() { val scrollState = rememberScrollState() - ColumnScrollbar(state = scrollState) { + ColumnScrollbar(state = scrollState, settings = NewPipeScrollbarSettings) { Column( modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/org/schabi/newpipe/ui/components/about/LicenseTab.kt b/app/src/main/java/org/schabi/newpipe/ui/components/about/LicenseTab.kt index cec68370329..0b1d3387997 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/components/about/LicenseTab.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/components/about/LicenseTab.kt @@ -15,13 +15,14 @@ import androidx.compose.ui.unit.dp import com.mikepenz.aboutlibraries.ui.compose.m3.LibrariesContainer import my.nanihadesuka.compose.LazyColumnScrollbar import org.schabi.newpipe.R +import org.schabi.newpipe.ui.theme.NewPipeScrollbarSettings @Composable @NonRestartableComposable fun LicenseTab() { val lazyListState = rememberLazyListState() - LazyColumnScrollbar(state = lazyListState) { + LazyColumnScrollbar(state = lazyListState, settings = NewPipeScrollbarSettings) { LibrariesContainer( modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/org/schabi/newpipe/ui/theme/Theme.kt b/app/src/main/java/org/schabi/newpipe/ui/theme/Theme.kt index 846794d725c..609f096c087 100644 --- a/app/src/main/java/org/schabi/newpipe/ui/theme/Theme.kt +++ b/app/src/main/java/org/schabi/newpipe/ui/theme/Theme.kt @@ -5,6 +5,8 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.darkColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import my.nanihadesuka.compose.ScrollbarSettings private val LightColors = lightColorScheme( primary = md_theme_light_primary, @@ -70,6 +72,11 @@ private val DarkColors = darkColorScheme( scrim = md_theme_dark_scrim, ) +val NewPipeScrollbarSettings = ScrollbarSettings( + thumbSelectedColor = md_theme_dark_primary, + thumbUnselectedColor = Color.Red +) + @Composable fun AppTheme(useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { MaterialTheme(