Skip to content

Commit

Permalink
Fix flash-of-color on displaying popup windows
Browse files Browse the repository at this point in the history
Closes #14
  • Loading branch information
kirill-grouchnikov committed Jan 20, 2022
1 parent 5778767 commit 67d44cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -87,6 +87,10 @@ internal fun displayPopupContent(
popupContentWindow.isUndecorated = true
popupContentWindow.isResizable = false

val fillColor = skinColors.getBackgroundColorScheme(decorationAreaType).backgroundFillColor
val awtFillColor = fillColor.awtColor
popupContentWindow.background = awtFillColor

val locationOnScreen = currentWindow.rootPane.locationOnScreen

val hasButtonPanel = (contentModel.value!!.panelContentModel != null)
Expand Down Expand Up @@ -327,8 +331,6 @@ internal fun displayPopupContent(
)
val popupBorderColor = skinPainters.borderPainter.getRepresentativeColor(borderScheme)
val awtBorderColor = popupBorderColor.awtColor
val fillColor = skinColors.getBackgroundColorScheme(decorationAreaType).backgroundFillColor
val awtFillColor = fillColor.awtColor
val borderThickness = 1.0f / density.density

popupContentWindow.rootPane.border = object : Border {
Expand Down
Expand Up @@ -90,6 +90,10 @@ internal fun displayRichTooltipContent(
popupContentWindow.isUndecorated = true
popupContentWindow.isResizable = false

val fillColor = skinColors.getBackgroundColorScheme(decorationAreaType).backgroundFillColor
val awtFillColor = fillColor.awtColor
popupContentWindow.background = awtFillColor

val locationOnScreen = currentWindow.rootPane.locationOnScreen

val offset = ceil(density.density).toInt()
Expand Down Expand Up @@ -347,8 +351,6 @@ internal fun displayRichTooltipContent(
)
val popupBorderColor = skinPainters.borderPainter.getRepresentativeColor(borderScheme)
val awtBorderColor = popupBorderColor.awtColor
val fillColor = skinColors.getBackgroundColorScheme(decorationAreaType).backgroundFillColor
val awtFillColor = fillColor.awtColor
val borderThickness = 1.0f / density.density

popupContentWindow.rootPane.border = object : Border {
Expand Down

0 comments on commit 67d44cd

Please sign in to comment.