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 d1f6c9d commit 628afbe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ interface FocusableComponentState : InteractiveComponentState {
pressed: T,
hovered: T,
active: T,
isSwingCompatMode: Boolean = IntelliJTheme.isSwingCompatMode,
): T =
when {
!isEnabled -> disabled
isPressed && !isSwingCompatMode -> pressed
isHovered && !isSwingCompatMode -> hovered
isPressed && !IntelliJTheme.isSwingCompatMode -> pressed
isHovered && !IntelliJTheme.isSwingCompatMode -> hovered
isFocused -> focused
isActive -> active
else -> normal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ interface DropdownColors {

@Composable
fun backgroundFor(state: DropdownState) = rememberUpdatedState(
state.chooseValue(
normal = background,
disabled = backgroundDisabled,
focused = backgroundFocused,
pressed = backgroundPressed,
hovered = backgroundHovered,
active = background,
// Dropdown has hovered/pressed in title bar
isSwingCompatMode = false,
),
when {
!state.isEnabled -> backgroundDisabled
state.isPressed -> backgroundPressed
state.isHovered -> backgroundHovered
state.isFocused -> backgroundFocused
state.isActive -> background
else -> background
},
)

val content: Color
Expand Down

0 comments on commit 628afbe

Please sign in to comment.