Skip to content

Commit

Permalink
Application: Add information labels on some settings pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadelessFox committed May 4, 2024
1 parent 74e2630 commit f99ff73
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@ public JComponent createComponent(@NotNull PropertyChangeListener listener) {

final JPanel tools = new JPanel();
tools.setBorder(new LabeledBorder("Disassemble"));
tools.setLayout(new MigLayout("ins panel", "[fill][grow,fill,400lp]", ""));
tools.setLayout(new MigLayout("ins panel,wrap", "[fill][grow,fill,400lp]", ""));

tools.add(new JLabel("Direct3D compiler library:"));
tools.add(d3dCompilerPath, "wrap");
tools.add(d3dCompilerPath);

tools.add(new JLabel("DirectX compiler library:"));
tools.add(dxCompilerPath, "wrap");
tools.add(dxCompilerPath);

tools.add(new JLabel(
"These files are shipped with the game itself and located within the game directory.",
UIManager.getIcon("Action.informationIcon"),
SwingConstants.LEADING
), "span");

return tools;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import net.miginfocom.swing.MigLayout;

import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.beans.PropertyChangeListener;
import java.util.Objects;

Expand Down Expand Up @@ -58,20 +60,40 @@ public JComponent createComponent(@NotNull PropertyChangeListener listener) {

final JPanel tools = new JPanel();
tools.setBorder(new LabeledBorder("Playback"));
tools.setLayout(new MigLayout("ins panel", "[fill][grow,fill,400lp]", ""));
tools.setLayout(new MigLayout("ins panel,wrap", "[fill][grow,fill,400lp]", ""));

tools.add(new JLabel("ww2ogg executable:"));
tools.add(ww2oggPath, "wrap");
tools.add(ww2oggPath);

tools.add(new JLabel("ww2ogg codebooks:"));
tools.add(ww2oggCodebooksPath, "wrap");
tools.add(ww2oggCodebooksPath);

tools.add(new JLabel("revorb executable:"));
tools.add(revorbPath, "wrap");
tools.add(revorbPath);

tools.add(new JLabel("ffmpeg executable:"));
tools.add(ffmpegPath);

final JEditorPane pane = new JEditorPane();
pane.setEditable(false);
pane.setContentType("text/html");
pane.setText("You can download individual entries from the following links: <a href=\"https://github.com/hcs64/ww2ogg\">ww2ogg</a>, <a href=\"https://hydrogenaud.io/index.php/topic,64328.0.html\">revorb</a>, and <a href=\"https://ffmpeg.org/\">ffmpeg</a>.");
pane.addHyperlinkListener(e -> {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
IOUtils.unchecked(() -> {
Desktop.getDesktop().browse(e.getURL().toURI());
return null;
});
}
});

final JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.add(new JLabel(UIManager.getIcon("Action.informationIcon")));
panel.add(pane);

tools.add(panel, "span");

return tools;
}

Expand Down

0 comments on commit f99ff73

Please sign in to comment.