Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devkanro committed Oct 17, 2023
1 parent e949897 commit 2d06872
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ interface FocusableComponentState : InteractiveComponentState {
pressed: T,
hovered: T,
active: T,
isSwingCompatMode: Boolean = IntelliJTheme.isSwingCompatMode,
): T =
when {
!isEnabled -> disabled
isPressed && !IntelliJTheme.isSwingCompatMode -> pressed
isHovered && !IntelliJTheme.isSwingCompatMode -> hovered
isPressed && !isSwingCompatMode -> pressed
isHovered && !isSwingCompatMode -> hovered
isFocused -> focused
isActive -> active
else -> normal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ import java.net.URI
fun main() {
val icon = svgResource("icons/jewel-logo.svg")
application {
var intTheme by remember { mutableStateOf(IntUiThemes.Light) }
var intUiTheme by remember { mutableStateOf(IntUiThemes.Light) }

var swingCompat by remember { mutableStateOf(false) }
val theme = if (intTheme.isDark()) IntUiTheme.darkThemeDefinition() else IntUiTheme.lightThemeDefinition()
val theme = if (intUiTheme.isDark()) IntUiTheme.darkThemeDefinition() else IntUiTheme.lightThemeDefinition()
val projectColor by rememberUpdatedState(
if (intTheme.isLightHeader()) {
if (intUiTheme.isLightHeader()) {
Color(0xFFF5D4C1)
} else {
Color(0xFF654B40)
Expand All @@ -85,7 +85,7 @@ fun main() {

IntUiTheme(
theme.withDecoratedWindow(
titleBarStyle = when (intTheme) {
titleBarStyle = when (intUiTheme) {
IntUiThemes.Light -> IntUiTitleBarStyle.light()
IntUiThemes.LightWithLightHeader -> IntUiTitleBarStyle.lightWithLightHeader()
IntUiThemes.Dark -> IntUiTitleBarStyle.dark()
Expand All @@ -101,7 +101,7 @@ fun main() {
title = "Jewel component catalog",
icon = icon,
) {
val windowBackground = if (intTheme.isDark()) {
val windowBackground = if (intUiTheme.isDark()) {
IntUiTheme.colorPalette.grey(1)
} else {
IntUiTheme.colorPalette.grey(14)
Expand Down Expand Up @@ -147,14 +147,14 @@ fun main() {
}

Tooltip({
when (intTheme) {
when (intUiTheme) {
IntUiThemes.Light -> Text("Switch to light theme with light header")
IntUiThemes.LightWithLightHeader -> Text("Switch to dark theme")
IntUiThemes.Dark -> Text("Switch to light theme")
}
}) {
IconButton({
intTheme = when (intTheme) {
intUiTheme = when (intUiTheme) {
IntUiThemes.Light -> IntUiThemes.LightWithLightHeader
IntUiThemes.LightWithLightHeader -> IntUiThemes.Dark
IntUiThemes.Dark -> IntUiThemes.Light
Expand All @@ -165,7 +165,7 @@ fun main() {
val darkThemeIcon =
rememberStatelessPainterProvider("icons/[email protected]", svgLoader)

val iconProvider = if (intTheme.isDark()) darkThemeIcon else lightThemeIcon
val iconProvider = if (intUiTheme.isDark()) darkThemeIcon else lightThemeIcon
Icon(iconProvider.getPainter(resourceLoader).value, "Themes")
}
}
Expand Down

0 comments on commit 2d06872

Please sign in to comment.