Skip to content

Commit

Permalink
Apply CSS to cell before loading style in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxoudela committed Aug 18, 2021
1 parent 8eaf545 commit c94d7b3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2013, 2019 ControlsFX
* Copyright (c) 2013, 2021 ControlsFX
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -300,6 +300,8 @@ protected void layoutChildren() {
if (dirtyStyle && getItem().isCellGraphic()) {
CellGraphicFactory browserImpl = handle.getView().getCellGraphicFactory();
if (browserImpl != null) {
// When cell is re-used, the style does not seemed to be updated so we force it.
super.applyCss();
//Send the graphic only if it's the right type, otherwise send null.
Node node = getGraphic() != null && browserImpl.getType().isAssignableFrom(getGraphic().getClass()) ? getGraphic() : null;
browserImpl.loadStyle(node, getItem(), getFont(), getTextFill(), getAlignment(), getBackground());
Expand Down

0 comments on commit c94d7b3

Please sign in to comment.