|
6 | 6 | import the.bytecode.club.bytecodeviewer.BytecodeViewer; |
7 | 7 | import the.bytecode.club.bytecodeviewer.Configuration; |
8 | 8 | import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer; |
9 | | -import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; |
10 | 9 | import the.bytecode.club.bytecodeviewer.resources.IconResources; |
11 | 10 | import the.bytecode.club.bytecodeviewer.gui.components.FileChooser; |
12 | 11 | import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea; |
|
18 | 17 | import the.bytecode.club.bytecodeviewer.util.SyntaxLanguage; |
19 | 18 |
|
20 | 19 | import javax.swing.*; |
| 20 | +import javax.swing.border.LineBorder; |
21 | 21 | import java.awt.*; |
22 | 22 | import java.io.File; |
23 | 23 | import java.io.IOException; |
@@ -123,16 +123,18 @@ public void setVisible(boolean b) |
123 | 123 |
|
124 | 124 | JPanel p = new JPanel(new BorderLayout()); |
125 | 125 | JPanel p2 = new JPanel(new BorderLayout()); |
126 | | - |
127 | 126 | p.add(p2, BorderLayout.NORTH); |
128 | 127 | p.add(component, BorderLayout.CENTER); |
129 | | - |
130 | | - if(Configuration.lafTheme == LAFTheme.SYSTEM) |
131 | | - p2.add(getJMenuBar(), BorderLayout.CENTER); |
132 | | - else //TODO DarkLAF wont display the jMenuBar due to how it handles them, instead display the menu |
133 | | - //TODO make the menu interactable and display the menu manually |
134 | | - p2.add(getJMenuBar().getMenu(0), BorderLayout.CENTER); |
135 | | - |
| 128 | + |
| 129 | + JMenuBar menuBar = getJMenuBar(); |
| 130 | + // As the Darklaf windows decorations steal the menu bar from the frame |
| 131 | + // it sets the preferred size to (0,0). Because we want to steal the menu bar ourselves. |
| 132 | + // we have to revert this change. |
| 133 | + // Remove when https://github.com/weisJ/darklaf/issues/258 is fixed and available in a |
| 134 | + // release. |
| 135 | + menuBar.setPreferredSize(null); |
| 136 | + p2.add(menuBar, BorderLayout.CENTER); |
| 137 | + |
136 | 138 | ComponentViewer.addComponentAsTab(pluginName, p); |
137 | 139 | } |
138 | 140 | else |
|
0 commit comments