Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10dc16e9 authored by Graciela Putri's avatar Graciela Putri Committed by Automerger Merge Worker
Browse files

Merge "Allow SearchBox title to scale to system font size" into udc-qpr-dev am: 2e5c0b58

parents 7bef96b8 2e5c0b58
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -253,6 +253,7 @@ private fun SingleRowTopAppBar(
            hideTitleSemantics = false,
            hideTitleSemantics = false,
            navigationIcon = navigationIcon,
            navigationIcon = navigationIcon,
            actions = actionsRow,
            actions = actionsRow,
            titleScaleDisabled = false,
        )
        )
    }
    }
}
}
@@ -426,6 +427,7 @@ private fun TwoRowsTopAppBar(
 * accessibility services at the same time, when animating between collapsed / expanded states.
 * accessibility services at the same time, when animating between collapsed / expanded states.
 * @param navigationIcon a navigation icon [Composable]
 * @param navigationIcon a navigation icon [Composable]
 * @param actions actions [Composable]
 * @param actions actions [Composable]
 * @param titleScaleDisabled whether the title font scaling is disabled. Default is disabled.
 */
 */
@Composable
@Composable
private fun TopAppBarLayout(
private fun TopAppBarLayout(
@@ -443,6 +445,7 @@ private fun TopAppBarLayout(
    hideTitleSemantics: Boolean,
    hideTitleSemantics: Boolean,
    navigationIcon: @Composable () -> Unit,
    navigationIcon: @Composable () -> Unit,
    actions: @Composable () -> Unit,
    actions: @Composable () -> Unit,
    titleScaleDisabled: Boolean = true,
) {
) {
    Layout(
    Layout(
        {
        {
@@ -466,9 +469,12 @@ private fun TopAppBarLayout(
                ProvideTextStyle(value = titleTextStyle) {
                ProvideTextStyle(value = titleTextStyle) {
                    CompositionLocalProvider(
                    CompositionLocalProvider(
                        LocalContentColor provides titleContentColor,
                        LocalContentColor provides titleContentColor,
                        // Disable the title font scaling by only passing the density but not the
                        LocalDensity provides with(LocalDensity.current) {
                        // font scale.
                          Density(
                        LocalDensity provides Density(density = LocalDensity.current.density),
                              density = density,
                              fontScale = if (titleScaleDisabled) 1f else fontScale,
                          )
                        },
                        content = title
                        content = title
                    )
                    )
                }
                }