Skip to content

Commit

Permalink
Improve missing composition local error
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Nov 1, 2023
1 parent 0a085ce commit 90c92ca
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public class DecoratedWindowMetrics(public val borderWidth: Dp) {
}

public val LocalDecoratedWindowStyle: ProvidableCompositionLocal<DecoratedWindowStyle> =
staticCompositionLocalOf<DecoratedWindowStyle> { error("No DecoratedWindowStyle provided") }
staticCompositionLocalOf<DecoratedWindowStyle> { error("No DecoratedWindowStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ public class TitleBarIcons(
}

public val LocalTitleBarStyle: ProvidableCompositionLocal<TitleBarStyle> =
staticCompositionLocalOf<TitleBarStyle> { error("No TitleBarStyle provided") }
staticCompositionLocalOf<TitleBarStyle> { error("No TitleBarStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ public class OutlineColors(
}

public val LocalGlobalColors: ProvidableCompositionLocal<GlobalColors> =
staticCompositionLocalOf<GlobalColors> { error("No GlobalColors provided") }
staticCompositionLocalOf<GlobalColors> { error("No GlobalColors provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class GlobalMetrics(
}

public val LocalGlobalMetrics: ProvidableCompositionLocal<GlobalMetrics> =
staticCompositionLocalOf<GlobalMetrics> { error("No GlobalMetrics provided") }
staticCompositionLocalOf<GlobalMetrics> { error("No GlobalMetrics provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ public fun JewelTheme(theme: ThemeDefinition, content: @Composable () -> Unit) {
}

public val LocalContentColor: ProvidableCompositionLocal<Color> =
staticCompositionLocalOf<Color> { error("No ContentColor provided") }
staticCompositionLocalOf<Color> { error("No ContentColor provided. Have you forgotten the theme?") }

internal val LocalIsDarkTheme =
staticCompositionLocalOf<Boolean> { error("No IsDarkTheme provided") }
staticCompositionLocalOf<Boolean> { error("No IsDarkTheme provided. Have you forgotten the theme?") }

internal val LocalSwingCompatMode = staticCompositionLocalOf {
// By default, Swing compat is not enabled
Expand All @@ -86,7 +86,7 @@ public val LocalIconData: ProvidableCompositionLocal<ThemeIconData> = staticComp
}

public val LocalTextStyle: ProvidableCompositionLocal<TextStyle> =
staticCompositionLocalOf<TextStyle> { error("No TextStyle provided") }
staticCompositionLocalOf<TextStyle> { error("No TextStyle provided. Have you forgotten the theme?") }

/** Overrides the dark mode for the current composition scope. */
@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ public class MenuManager(
}

public val LocalMenuManager: ProvidableCompositionLocal<MenuManager> =
staticCompositionLocalOf<MenuManager> { error("No MenuManager provided") }
staticCompositionLocalOf<MenuManager> { error("No MenuManager provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class ButtonMetrics(
}

public val LocalDefaultButtonStyle: ProvidableCompositionLocal<ButtonStyle> =
staticCompositionLocalOf<ButtonStyle> { error("No default ButtonStyle provided") }
staticCompositionLocalOf<ButtonStyle> { error("No default ButtonStyle provided. Have you forgotten the theme?") }

public val LocalOutlinedButtonStyle: ProvidableCompositionLocal<ButtonStyle> =
staticCompositionLocalOf<ButtonStyle> { error("No outlined ButtonStyle provided") }
staticCompositionLocalOf<ButtonStyle> { error("No outlined ButtonStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ public class CheckboxIcons(public val checkbox: PainterProvider) {
}

public val LocalCheckboxStyle: ProvidableCompositionLocal<CheckboxStyle> =
staticCompositionLocalOf<CheckboxStyle> { error("No CheckboxStyle provided") }
staticCompositionLocalOf<CheckboxStyle> { error("No CheckboxStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ public class ChipMetrics(
}

public val LocalChipStyle: ProvidableCompositionLocal<ChipStyle> =
staticCompositionLocalOf<ChipStyle> { error("No ChipStyle provided") }
staticCompositionLocalOf<ChipStyle> { error("No ChipStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public class CircularProgressStyle(
}

public val LocalCircularProgressStyle: ProvidableCompositionLocal<CircularProgressStyle> =
staticCompositionLocalOf<CircularProgressStyle> { error("No CircularProgressStyle provided") }
staticCompositionLocalOf<CircularProgressStyle> { error("No CircularProgressStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ public class DividerMetrics(
}

public val LocalDividerStyle: ProvidableCompositionLocal<DividerStyle> =
staticCompositionLocalOf<DividerStyle> { error("No DividerStyle provided") }
staticCompositionLocalOf<DividerStyle> { error("No DividerStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class DropdownIcons(public val chevronDown: PainterProvider) {
}

public val LocalDefaultDropdownStyle: ProvidableCompositionLocal<DropdownStyle> =
staticCompositionLocalOf<DropdownStyle> { error("No DefaultDropdownStyle provided") }
staticCompositionLocalOf<DropdownStyle> { error("No DefaultDropdownStyle provided. Have you forgotten the theme?") }

public val LocalUndecoratedDropdownStyle: ProvidableCompositionLocal<DropdownStyle> =
staticCompositionLocalOf<DropdownStyle> { error("No UndecoratedDropdownStyle provided") }
staticCompositionLocalOf<DropdownStyle> { error("No UndecoratedDropdownStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ public class GroupHeaderMetrics(
}

public val LocalGroupHeaderStyle: ProvidableCompositionLocal<GroupHeaderStyle> =
staticCompositionLocalOf<GroupHeaderStyle> { error("No GroupHeaderStyle provided") }
staticCompositionLocalOf<GroupHeaderStyle> { error("No GroupHeaderStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ public class HorizontalProgressBarMetrics(

public val LocalHorizontalProgressBarStyle: ProvidableCompositionLocal<HorizontalProgressBarStyle> =
staticCompositionLocalOf<HorizontalProgressBarStyle> {
error("No HorizontalProgressBarStyle provided")
error("No HorizontalProgressBarStyle provided. Have you forgotten the theme?")
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public class IconButtonMetrics(
}

public val LocalIconButtonStyle: ProvidableCompositionLocal<IconButtonStyle> =
staticCompositionLocalOf<IconButtonStyle> { error("No IconButtonStyle provided") }
staticCompositionLocalOf<IconButtonStyle> { error("No IconButtonStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ public class LazyTreeIcons(
}

public val LocalLazyTreeStyle: ProvidableCompositionLocal<LazyTreeStyle> =
staticCompositionLocalOf<LazyTreeStyle> { error("No LazyTreeStyle provided") }
staticCompositionLocalOf<LazyTreeStyle> { error("No LazyTreeStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ public class LinkTextStyles(
}

public val LocalLinkStyle: ProvidableCompositionLocal<LinkStyle> =
staticCompositionLocalOf<LinkStyle> { error("No LinkStyle provided") }
staticCompositionLocalOf<LinkStyle> { error("No LinkStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ public class MenuIcons(public val submenuChevron: PainterProvider) {
}

public val LocalMenuStyle: ProvidableCompositionLocal<MenuStyle> =
staticCompositionLocalOf<MenuStyle> { error("No MenuStyle provided") }
staticCompositionLocalOf<MenuStyle> { error("No MenuStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ public class RadioButtonIcons(public val radioButton: PainterProvider) {
}

public val LocalRadioButtonStyle: ProvidableCompositionLocal<RadioButtonStyle> =
staticCompositionLocalOf<RadioButtonStyle> { error("No RadioButtonStyle provided") }
staticCompositionLocalOf<RadioButtonStyle> { error("No RadioButtonStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ public class ScrollbarMetrics(
}

public val LocalScrollbarStyle: ProvidableCompositionLocal<ScrollbarStyle> =
staticCompositionLocalOf<ScrollbarStyle> { error("No ScrollbarStyle provided") }
staticCompositionLocalOf<ScrollbarStyle> { error("No ScrollbarStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private fun <T> TabState.chooseValueIgnoreCompat(
}

public val LocalDefaultTabStyle: ProvidableCompositionLocal<TabStyle> =
staticCompositionLocalOf<TabStyle> { error("No LocalTabStyle provided") }
staticCompositionLocalOf<TabStyle> { error("No LocalTabStyle provided. Have you forgotten the theme?") }

public val LocalEditorTabStyle: ProvidableCompositionLocal<TabStyle> =
staticCompositionLocalOf<TabStyle> { error("No LocalTabStyle provided") }
staticCompositionLocalOf<TabStyle> { error("No LocalTabStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public class TextAreaMetrics(
}

public val LocalTextAreaStyle: ProvidableCompositionLocal<TextAreaStyle> =
staticCompositionLocalOf<TextAreaStyle> { error("No TextAreaStyle provided") }
staticCompositionLocalOf<TextAreaStyle> { error("No TextAreaStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ public class TextFieldMetrics(
}

public val LocalTextFieldStyle: ProvidableCompositionLocal<TextFieldStyle> =
staticCompositionLocalOf<TextFieldStyle> { error("No TextFieldStyle provided") }
staticCompositionLocalOf<TextFieldStyle> { error("No TextFieldStyle provided. Have you forgotten the theme?") }
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ public class TooltipMetrics(
}

public val LocalTooltipStyle: ProvidableCompositionLocal<TooltipStyle> =
staticCompositionLocalOf<TooltipStyle> { error("No TooltipStyle provided") }
staticCompositionLocalOf<TooltipStyle> { error("No TooltipStyle provided. Have you forgotten the theme?") }

0 comments on commit 90c92ca

Please sign in to comment.