Improve guided tours UI

This commit is contained in:
SiboVG 2022-06-12 17:46:48 +02:00
parent 30c6b607d0
commit 79f9363b40
4 changed files with 16 additions and 9 deletions

View File

@ -1952,9 +1952,9 @@ SlideShowLinkListener.error.msg = Sorry, de geselecteerde tour is nog niet gesch
GuidedTourSelectionDialog.title = Rondleiding
GuidedTourSelectionDialog.lbl.selectTour = Selecteer rondleiding:
GuidedTourSelectionDialog.lbl.description = Tour omschrijving:
GuidedTourSelectionDialog.lbl.description = Omschrijving rondleiding:
GuidedTourSelectionDialog.lbl.length = Aantal slides:
GuidedTourSelectionDialog.btn.start = Start tour!
GuidedTourSelectionDialog.btn.start = Start rondleiding!
! Custom Fin BMP Importer

View File

@ -15,6 +15,7 @@ import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@ -25,10 +26,12 @@ import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.gui.components.StyledLabel;
import net.sf.openrocket.gui.components.StyledLabel.Style;
import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.gui.util.Icons;
import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.Named;
import net.sf.openrocket.gui.widgets.SelectColorButton;
import org.fife.ui.rtextarea.IconGroup;
public class GuidedTourSelectionDialog extends JDialog {
private static final long serialVersionUID = -3643116444821710259L;
@ -84,6 +87,7 @@ public class GuidedTourSelectionDialog extends JDialog {
tourDescription = new JEditorPane("text/html", "");
tourDescription.setEditable(false);
tourDescription.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true);
StyleSheet ss = slideSetManager.getSlideSet(tourNames.get(0)).getStyleSheet();
((HTMLDocument) tourDescription.getDocument()).getStyleSheet().addStyleSheet(ss);
sub.add(new JScrollPane(tourDescription), "grow, wrap rel");
@ -92,6 +96,7 @@ public class GuidedTourSelectionDialog extends JDialog {
sub.add(tourLength, "wrap unrel");
JButton start = new SelectColorButton(trans.get("btn.start"));
start.setIcon(Icons.HELP_TOURS);
start.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -1,10 +1,12 @@
package net.sf.openrocket.gui.help.tours;
import java.awt.Dimension;
import java.awt.Insets;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextPane;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.StyleSheet;
@ -37,6 +39,8 @@ public class SlideShowComponent extends JSplitPane {
textPane = new JEditorPane("text/html", "");
textPane.setEditable(false);
textPane.setMargin(new Insets(10, 10, 40, 10));
textPane.putClientProperty(JTextPane.HONOR_DISPLAY_PROPERTIES, true);
textPane.setPreferredSize(new Dimension(WIDTH, HEIGHT_TEXT));
JScrollPane scrollPanel = new JScrollPane(textPane);

View File

@ -48,7 +48,7 @@ public class SlideShowDialog extends JDialog {
slideShowComponent = new SlideShowComponent();
slideShowComponent.addHyperlinkListener(new SlideShowLinkListener(parent));
panel.add(slideShowComponent, "spanx, grow, wrap para");
panel.add(slideShowComponent, "spanx, pushy, grow, wrap para");
JPanel sub = new JPanel(new MigLayout("ins 0, fill"));
@ -77,7 +77,8 @@ public class SlideShowDialog extends JDialog {
sub.add(new JPanel(), "growx");
panel.add(sub, "pushx, center");
closeButton = new SelectColorButton(trans.get("button.close"));
closeButton.addActionListener(new ActionListener() {
@ -86,11 +87,8 @@ public class SlideShowDialog extends JDialog {
SlideShowDialog.this.dispose();
}
});
sub.add(closeButton, "right");
panel.add(sub, "growx");
panel.add(closeButton, "wrap");
this.add(panel);
updateEnabled();
addKeyActions();