Skip to content

Commit

Permalink
Get rid of BaseIntUiTheme and IntUiTheme
Browse files Browse the repository at this point in the history
One theme to rule them all!
  • Loading branch information
rock3r committed Oct 20, 2023
1 parent f85d23c commit c08ca05
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 436 deletions.
1 change: 1 addition & 0 deletions core/src/main/kotlin/org/jetbrains/jewel/JewelTheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ interface JewelTheme {
@Composable
@ReadOnlyComposable
get() = LocalTooltipStyle.current

val iconButtonStyle: IconButtonStyle
@Composable
@ReadOnlyComposable
Expand Down
60 changes: 0 additions & 60 deletions int-ui/int-ui-core/api/int-ui-core.api
Original file line number Diff line number Diff line change
@@ -1,63 +1,3 @@
public abstract interface class org/jetbrains/jewel/intui/core/BaseIntUiTheme : org/jetbrains/jewel/JewelTheme {
public abstract fun getCheckboxStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/CheckboxStyle;
public abstract fun getChipStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ChipStyle;
public abstract fun getCircularProgressStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/CircularProgressStyle;
public abstract fun getColorPalette (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/ThemeColorPalette;
public abstract fun getContentColor (Landroidx/compose/runtime/Composer;I)J
public abstract fun getDefaultButtonStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ButtonStyle;
public abstract fun getDefaultTabStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TabStyle;
public abstract fun getDividerStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/DividerStyle;
public abstract fun getDropdownStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/DropdownStyle;
public abstract fun getEditorTabStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TabStyle;
public abstract fun getGlobalColors (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/GlobalColors;
public abstract fun getGlobalMetrics (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/GlobalMetrics;
public abstract fun getGroupHeaderStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/GroupHeaderStyle;
public abstract fun getHorizontalProgressBarStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/HorizontalProgressBarStyle;
public abstract fun getIconData (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/ThemeIconData;
public abstract fun getLabelledTextFieldStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LabelledTextFieldStyle;
public abstract fun getLinkStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LinkStyle;
public abstract fun getMenuStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/MenuStyle;
public abstract fun getOutlinedButtonStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ButtonStyle;
public abstract fun getRadioButtonStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/RadioButtonStyle;
public abstract fun getScrollbarStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ScrollbarStyle;
public abstract fun getTextAreaStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TextAreaStyle;
public abstract fun getTextFieldStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TextFieldStyle;
public abstract fun getTextStyle (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/text/TextStyle;
public abstract fun getTreeStyle (Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LazyTreeStyle;
public abstract fun isDark (Landroidx/compose/runtime/Composer;I)Z
public abstract fun isSwingCompatMode (Landroidx/compose/runtime/Composer;I)Z
}

public final class org/jetbrains/jewel/intui/core/BaseIntUiTheme$DefaultImpls {
public static fun getCheckboxStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/CheckboxStyle;
public static fun getChipStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ChipStyle;
public static fun getCircularProgressStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/CircularProgressStyle;
public static fun getColorPalette (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/ThemeColorPalette;
public static fun getContentColor (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)J
public static fun getDefaultButtonStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ButtonStyle;
public static fun getDefaultTabStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TabStyle;
public static fun getDividerStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/DividerStyle;
public static fun getDropdownStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/DropdownStyle;
public static fun getEditorTabStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TabStyle;
public static fun getGlobalColors (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/GlobalColors;
public static fun getGlobalMetrics (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/GlobalMetrics;
public static fun getGroupHeaderStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/GroupHeaderStyle;
public static fun getHorizontalProgressBarStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/HorizontalProgressBarStyle;
public static fun getIconData (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/ThemeIconData;
public static fun getLabelledTextFieldStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LabelledTextFieldStyle;
public static fun getLinkStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LinkStyle;
public static fun getMenuStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/MenuStyle;
public static fun getOutlinedButtonStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ButtonStyle;
public static fun getRadioButtonStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/RadioButtonStyle;
public static fun getScrollbarStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/ScrollbarStyle;
public static fun getTextAreaStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TextAreaStyle;
public static fun getTextFieldStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/TextFieldStyle;
public static fun getTextStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/text/TextStyle;
public static fun getTreeStyle (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Lorg/jetbrains/jewel/styling/LazyTreeStyle;
public static fun isDark (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Z
public static fun isSwingCompatMode (Lorg/jetbrains/jewel/intui/core/BaseIntUiTheme;Landroidx/compose/runtime/Composer;I)Z
}

public final class org/jetbrains/jewel/intui/core/BaseIntUiThemeKt {
public static final fun BaseIntUiTheme (Lorg/jetbrains/jewel/ThemeDefinition;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V
public static final fun BaseIntUiTheme (Lorg/jetbrains/jewel/ThemeDefinition;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,173 +4,11 @@ import androidx.compose.foundation.LocalIndication
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.ProvidedValue
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import org.jetbrains.jewel.GlobalColors
import org.jetbrains.jewel.GlobalMetrics
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.LocalColorPalette
import org.jetbrains.jewel.LocalIconData
import org.jetbrains.jewel.NoIndication
import org.jetbrains.jewel.ThemeColorPalette
import org.jetbrains.jewel.ThemeDefinition
import org.jetbrains.jewel.ThemeIconData
import org.jetbrains.jewel.styling.ButtonStyle
import org.jetbrains.jewel.styling.CheckboxStyle
import org.jetbrains.jewel.styling.ChipStyle
import org.jetbrains.jewel.styling.CircularProgressStyle
import org.jetbrains.jewel.styling.DividerStyle
import org.jetbrains.jewel.styling.DropdownStyle
import org.jetbrains.jewel.styling.GroupHeaderStyle
import org.jetbrains.jewel.styling.HorizontalProgressBarStyle
import org.jetbrains.jewel.styling.LabelledTextFieldStyle
import org.jetbrains.jewel.styling.LazyTreeStyle
import org.jetbrains.jewel.styling.LinkStyle
import org.jetbrains.jewel.styling.MenuStyle
import org.jetbrains.jewel.styling.RadioButtonStyle
import org.jetbrains.jewel.styling.ScrollbarStyle
import org.jetbrains.jewel.styling.TabStyle
import org.jetbrains.jewel.styling.TextAreaStyle
import org.jetbrains.jewel.styling.TextFieldStyle

interface BaseIntUiTheme : JewelTheme {

val globalColors: GlobalColors
@Composable
@ReadOnlyComposable
get() = JewelTheme.globalColors

val globalMetrics: GlobalMetrics
@Composable
@ReadOnlyComposable
get() = JewelTheme.globalMetrics

val textStyle: TextStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.textStyle

val contentColor: Color
@Composable
@ReadOnlyComposable
get() = JewelTheme.contentColor

val isDark: Boolean
@Composable
@ReadOnlyComposable
get() = JewelTheme.isDark

val isSwingCompatMode: Boolean
@Composable
@ReadOnlyComposable
get() = JewelTheme.isSwingCompatMode

val iconData: ThemeIconData
@Composable
@ReadOnlyComposable
get() = JewelTheme.iconData

val colorPalette: ThemeColorPalette
@Composable
@ReadOnlyComposable
get() = JewelTheme.colorPalette

val defaultButtonStyle: ButtonStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.defaultButtonStyle

val outlinedButtonStyle: ButtonStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.outlinedButtonStyle

val checkboxStyle: CheckboxStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.checkboxStyle

val chipStyle: ChipStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.chipStyle

val dividerStyle: DividerStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.dividerStyle

val dropdownStyle: DropdownStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.dropdownStyle

val groupHeaderStyle: GroupHeaderStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.groupHeaderStyle

val labelledTextFieldStyle: LabelledTextFieldStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.labelledTextFieldStyle

val linkStyle: LinkStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.linkStyle

val menuStyle: MenuStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.menuStyle

val horizontalProgressBarStyle: HorizontalProgressBarStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.horizontalProgressBarStyle

val radioButtonStyle: RadioButtonStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.radioButtonStyle

val scrollbarStyle: ScrollbarStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.scrollbarStyle

val textAreaStyle: TextAreaStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.textAreaStyle

val textFieldStyle: TextFieldStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.textFieldStyle

val treeStyle: LazyTreeStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.treeStyle

val defaultTabStyle: TabStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.defaultTabStyle

val editorTabStyle: TabStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.editorTabStyle

val circularProgressStyle: CircularProgressStyle
@Composable
@ReadOnlyComposable
get() = JewelTheme.circularProgressStyle
}

@Composable
fun BaseIntUiTheme(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.jetbrains.jewel.intui.window

import org.jetbrains.jewel.intui.standalone.IntUiTheme
import org.jetbrains.jewel.JewelTheme
import org.jetbrains.jewel.painter.ResourcePainterProvider
import org.jetbrains.jewel.window.styling.DecoratedWindowStyle

/**
* Create [PainterProvider][org.jetbrains.jewel.painter.PainterProvider] for decorated window module resource.
*/
fun decoratedWindowPainterProvider(path: String) =
ResourcePainterProvider(path, DecoratedWindowStyle::class.java.classLoader, IntUiTheme::class.java.classLoader)
ResourcePainterProvider(path, DecoratedWindowStyle::class.java.classLoader, JewelTheme::class.java.classLoader)
Loading

0 comments on commit c08ca05

Please sign in to comment.