Skip to content

Commit

Permalink
Fix for Erratic behavior(s) after launch #1179, additional comment for
Browse files Browse the repository at this point in the history
  • Loading branch information
pskowronek committed May 9, 2024
1 parent 21bd41a commit 0014205
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,11 @@ private void initializeCustomLookAndFeels() {
* Initialises the list of available look&feels.
*/
private void initializeAvailableLookAndFeels() {
while (!WindowManager.getInstance().isAdditionalLafsLoaded()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {}
}
// Loads all available look and feels.
lookAndFeels = UIManager.getInstalledLookAndFeels();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import javax.swing.table.TableColumnModel;

Expand Down Expand Up @@ -205,8 +206,16 @@ public Insets getInsets() {

executor.execute(() -> {
// Create menu bar (has to be created after toolbar) - ok, but why?
// PSko - I guess it is related to loading Actions and that icons
// for toolbar action should have icons, but in menu they should not.
// However, still I don't get how setting the icon to null here in MenuToolkit#addMenuItem
// impacts menu icons....... if nullify is commented-out there, then icons all of sudden
// show in the menu causing this: https://github.com/mucommander/mucommander/issues/1178
MainMenuBar menuBar = new MainMenuBar(this);
getJFrame().setJMenuBar(menuBar);
SwingUtilities.invokeLater(() -> {
getJFrame().setJMenuBar(menuBar);
getJFrame().revalidate();
});
});

// Create the split pane that separates folder panels and allows to resize how much space is allocated to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,8 @@ public void configurationChanged(ConfigurationEvent event) {
setLookAndFeel(lnfName);
}
}

public boolean isAdditionalLafsLoaded() {
return additionalLafsLoaded;
}
}

0 comments on commit 0014205

Please sign in to comment.