-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 17 additions & 26 deletions
43
...ndalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiDividerStyle.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
package org.jetbrains.jewel.intui.standalone.styling | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.Immutable | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
import org.jetbrains.jewel.GenerateDataFunctions | ||
import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme | ||
import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme | ||
import org.jetbrains.jewel.styling.DividerMetrics | ||
import org.jetbrains.jewel.styling.DividerStyle | ||
|
||
@Immutable | ||
@GenerateDataFunctions | ||
class IntUiDividerStyle( | ||
override val color: Color, | ||
override val metrics: DividerMetrics, | ||
) : DividerStyle { | ||
val DividerStyle.Companion.Defaults: IntUiDividerStyleFactory | ||
get() = IntUiDividerStyleFactory | ||
|
||
companion object { | ||
object IntUiDividerStyleFactory { | ||
|
||
@Composable | ||
fun light( | ||
color: Color = IntUiLightTheme.colors.grey(12), | ||
metrics: IntUiDividerMetrics = IntUiDividerMetrics(), | ||
) = IntUiDividerStyle(color, metrics) | ||
@Composable | ||
fun light( | ||
color: Color = IntUiLightTheme.colors.grey(12), | ||
metrics: DividerMetrics = DividerMetrics.defaults(), | ||
) = DividerStyle(color, metrics) | ||
|
||
@Composable | ||
fun dark( | ||
color: Color = IntUiDarkTheme.colors.grey(1), | ||
metrics: IntUiDividerMetrics = IntUiDividerMetrics(), | ||
) = IntUiDividerStyle(color, metrics) | ||
} | ||
@Composable | ||
fun dark( | ||
color: Color = IntUiDarkTheme.colors.grey(1), | ||
metrics: DividerMetrics = DividerMetrics.defaults(), | ||
) = DividerStyle(color, metrics) | ||
} | ||
|
||
@Immutable | ||
@GenerateDataFunctions | ||
class IntUiDividerMetrics( | ||
override val thickness: Dp = 1.dp, | ||
override val startIndent: Dp = 0.dp, | ||
) : DividerMetrics | ||
fun DividerMetrics.Companion.defaults( | ||
thickness: Dp = 1.dp, | ||
startIndent: Dp = 0.dp, | ||
) = DividerMetrics(thickness, startIndent) |