Skip to content

Commit

Permalink
Fix tab icons not existing anymore in 243
Browse files Browse the repository at this point in the history
Also adds tabs to the ComponentShowcaseTab IDE sample
  • Loading branch information
rock3r committed Oct 19, 2024
1 parent 3bb65e7 commit a1c4948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ private fun readDefaultTabStyle(): TabStyle {
tabContentSpacing = 4.dp,
tabHeight = retrieveIntAsDpOrUnspecified("TabbedPane.tabHeight").takeOrElse { 24.dp },
),
icons = TabIcons(close = AllIconsKeys.General.CloseSmall),
icons = TabIcons(close = AllIconsKeys.Windows.CloseSmall),
contentAlpha =
TabContentAlpha(
iconNormal = 1f,
Expand Down Expand Up @@ -1112,7 +1112,7 @@ private fun readEditorTabStyle(): TabStyle {
tabContentSpacing = 4.dp,
tabHeight = retrieveIntAsDpOrUnspecified("TabbedPane.tabHeight").takeOrElse { 24.dp },
),
icons = TabIcons(close = AllIconsKeys.General.CloseSmall),
icons = TabIcons(close = AllIconsKeys.Windows.CloseSmall),
contentAlpha =
TabContentAlpha(
iconNormal = .7f,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ import org.jetbrains.jewel.ui.component.LazyTree
import org.jetbrains.jewel.ui.component.OutlinedButton
import org.jetbrains.jewel.ui.component.RadioButtonRow
import org.jetbrains.jewel.ui.component.Slider
import org.jetbrains.jewel.ui.component.TabData
import org.jetbrains.jewel.ui.component.TabStrip
import org.jetbrains.jewel.ui.component.Text
import org.jetbrains.jewel.ui.component.TextField
import org.jetbrains.jewel.ui.component.Tooltip
Expand All @@ -70,6 +72,7 @@ import org.jetbrains.jewel.ui.painter.hints.Badge
import org.jetbrains.jewel.ui.painter.hints.Size
import org.jetbrains.jewel.ui.painter.hints.Stroke
import org.jetbrains.jewel.ui.theme.colorPalette
import org.jetbrains.jewel.ui.theme.defaultTabStyle

@Composable
internal fun ComponentShowcaseTab(project: Project) {
Expand Down Expand Up @@ -279,6 +282,11 @@ private fun RowScope.ColumnTwo(project: Project) {

Divider(Orientation.Horizontal)

val tabs = remember {
listOf(TabData.Default(true, { Text("Tab 1") }), TabData.Default(false, { Text("Tab 2") }))
}
TabStrip(tabs, JewelTheme.defaultTabStyle, modifier = Modifier.fillMaxWidth())

var activated by remember { mutableStateOf(false) }
Text("activated: $activated", Modifier.onActivated { activated = it })

Expand Down

0 comments on commit a1c4948

Please sign in to comment.