Skip to content

Commit

Permalink
[#538] Update dark mode doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoding7 authored and prmr committed Jul 2, 2024
1 parent e07d263 commit 734970f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/functional/DarkMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ Whenever dark mode is turned on or off, the icons of the tool bar buttons, which

```java
private void recreateButtonIcons()
{
List<Node> toolBarItems = getItems();
List<MenuItem> contextMenuItems = aPopupMenu.getItems();
for( int i = 0; i < toolBarItems.size(); i++ )
{
List<Node> toolBarItems = getItems();
List<MenuItem> contextMenuItems = aPopupMenu.getItems();
for( int i = 0; i < toolBarItems.size(); i++ )
ButtonBase button = (ButtonBase) toolBarItems.get(i);
if( toolBarItems.get(i) instanceof SelectableToolButton toolButton &&
toolButton.getPrototype().isPresent() )
{
ButtonBase button = (ButtonBase) toolBarItems.get(i);
if( toolBarItems.get(i) instanceof SelectableToolButton toolButton &&
toolButton.getPrototype().isPresent() )
{
button.setGraphic(aDiagramRenderer.createIcon(toolButton.getPrototype().get()));
contextMenuItems.get(i).setGraphic(aDiagramRenderer.createIcon(toolButton.getPrototype().get()));
}
button.setGraphic(aDiagramRenderer.createIcon(toolButton.getPrototype().get()));
contextMenuItems.get(i).setGraphic(aDiagramRenderer.createIcon(toolButton.getPrototype().get()));
}
}
}
```

To summarize, the method collects all the buttons in `DiagramTabToolBar` and `ContextMenu`, and creates a new `Canvas` instance for the icon of each button.

0 comments on commit 734970f

Please sign in to comment.