I’m trying to get rid of MaterialTheme, but as soo...
# compose-desktop
o
I’m trying to get rid of MaterialTheme, but as soon as I remove it, I get this:
Copy code
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: LayoutNode@108e4651 children: 1 measurePolicy: androidx.compose.foundation.Scrollbar_desktopKt$verticalMeasurePolicy$1@7d30d0b0 is not ready. layoutState is NeedsRemeasure
Build 0.4.0-build173 Any ideas?
j
o
Caused by
VerticalScrollbar
in my case, but can’t repro easily 😞 If I remove the scroll bar, exception goes away
i
You can try to disable indication. You need to wrap root Composable to this:
Copy code
CompositionLocalProvider(LocalIndication provides NoIndication) {
    ...
}
Where `NoIndication`:
Copy code
private object NoIndication : Indication {
    private object NoIndicationInstance : IndicationInstance {
        override fun ContentDrawScope.drawIndication() {
            drawContent()
        }
    }

    @Composable
    override fun rememberUpdatedInstance(interactionSource: InteractionSource): IndicationInstance {
        return NoIndicationInstance
    }
}
o
@Igor Demin I will try, thanks. Shouldn’t DesktopTheme set this up too?
i
DesktopTheme
extends
MaterialTheme
, it defines style for desktop-only components like scrollbars, so it shouldn't override indication. P.S. We haven't yet figured out how styling should work on desktop, behavior can change in the future
o
@Igor Demin thanks, providing no indication helps with exception!
There is
DesktopMaterialTheme
and
DesktopTheme
, so the latter don’t extend material theme
Also, is it possible to split desktop and desktop-material, so I can get rid of
androidx.compose.material
package? I’m building my own theme, and would like to avoid depending on material stuff.
i
the latter don’t extend material theme
I mean purpose of
DesktopTheme
is to "extend" styles defined in the other common themes like
MaterialTheme
, not "override" them.
Also, is it possible to split desktop and desktop-material, so I can get rid of 
androidx.compose.material
 package? I’m building my own theme, and would like to avoid depending on material stuff.
Maybe we can split. I filled the issue
so I can get rid of 
androidx.compose.material
For now you can exclude it explicitly:
Copy code
implementation(compose.desktop.currentOs) {
    exclude(group = "org.jetbrains.compose.material")
}
🙏 1