-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reference #733 Signed-off-by: Ivan Morgillo <imorgillo@gmail.com> GitOrigin-RevId: a25d084ed04d880d871ba31912cb4988210d058b
- Loading branch information
1 parent
04663c4
commit 2457006
Showing
16 changed files
with
899 additions
and
32 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
39 changes: 39 additions & 0 deletions
39
ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridgeSplitButton.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the | ||
// Apache 2.0 license. | ||
package org.jetbrains.jewel.bridge.theme | ||
|
||
import androidx.compose.ui.unit.dp | ||
import com.intellij.util.ui.JBUI | ||
import org.jetbrains.jewel.bridge.isNewUiTheme | ||
import org.jetbrains.jewel.bridge.retrieveColorOrUnspecified | ||
import org.jetbrains.jewel.bridge.toComposeColor | ||
import org.jetbrains.jewel.ui.component.styling.SplitButtonColors | ||
import org.jetbrains.jewel.ui.component.styling.SplitButtonMetrics | ||
import org.jetbrains.jewel.ui.component.styling.SplitButtonStyle | ||
|
||
private val dividerPadding: Int | ||
get() = if (isNewUiTheme()) 4 else 1 | ||
|
||
public fun readOutlinedSplitButtonStyle(): SplitButtonStyle = | ||
SplitButtonStyle( | ||
button = readOutlinedButtonStyle(), | ||
colors = | ||
SplitButtonColors( | ||
dividerColor = JBUI.CurrentTheme.Button.buttonOutlineColorStart(false).toComposeColor(), | ||
dividerDisabledColor = JBUI.CurrentTheme.Button.disabledOutlineColor().toComposeColor(), | ||
chevronColor = JBUI.CurrentTheme.Button.Split.Default.ICON_COLOR.toComposeColor(), | ||
), | ||
metrics = SplitButtonMetrics(dividerMetrics = readDividerStyle().metrics, dividerPadding = dividerPadding.dp), | ||
) | ||
|
||
public fun readDefaultSplitButtonStyle(): SplitButtonStyle = | ||
SplitButtonStyle( | ||
button = readDefaultButtonStyle(), | ||
colors = | ||
SplitButtonColors( | ||
dividerColor = retrieveColorOrUnspecified("Button.Split.default.separatorColor"), | ||
dividerDisabledColor = JBUI.CurrentTheme.Button.disabledOutlineColor().toComposeColor(), | ||
chevronColor = JBUI.CurrentTheme.Button.Split.Default.ICON_COLOR.toComposeColor(), | ||
), | ||
metrics = SplitButtonMetrics(dividerMetrics = readDividerStyle().metrics, dividerPadding = dividerPadding.dp), | ||
) |
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
Oops, something went wrong.