prevent automatically scrolling to the bottom when mod details exceed window size

This commit is contained in:
Downforce Agent 2024-07-13 22:01:02 -05:00
parent f2786ee08a
commit 32a4e45638
3 changed files with 7 additions and 2 deletions

View File

@ -178,7 +178,7 @@ public class Bert implements ActionListener {
// dump contents // dump contents
System.out.println("Extracting " + arcname); System.out.println("Extracting " + arcname);
Fozzie popup = new Fozzie(); Fozzie popup = new Fozzie();
popup.displayTextOnly("Extracting" + arcname + "...", "Extracting"); popup.displayTextOnly("Extracting " + arcname + "...", "Extracting");
Process p; Process p;
try { try {
if (!Main.windows) { if (!Main.windows) {

View File

@ -30,11 +30,12 @@
<color color="-1"/> <color color="-1"/>
</border> </border>
<children> <children>
<scrollpane id="6e7e5"> <scrollpane id="6e7e5" binding="descriptionScroller">
<constraints> <constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<autoscrolls value="false"/>
<foreground color="-1"/> <foreground color="-1"/>
<opaque value="false"/> <opaque value="false"/>
</properties> </properties>

View File

@ -20,6 +20,7 @@ import javax.imageio.ImageIO;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.text.DefaultCaret;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -71,6 +72,7 @@ public class MissPiggy implements ActionListener {
private JButton importButton; private JButton importButton;
private JButton deployButton; private JButton deployButton;
private JTextPane descriptionField; private JTextPane descriptionField;
private JScrollPane descriptionScroller;
//private int selectedItem; //private int selectedItem;
@ -175,6 +177,8 @@ public class MissPiggy implements ActionListener {
importButton.setFont(Main.fExo2.deriveFont(Font.BOLD).deriveFont(12f)); importButton.setFont(Main.fExo2.deriveFont(Font.BOLD).deriveFont(12f));
deployButton.setFont(Main.fExo2.deriveFont(Font.BOLD).deriveFont(12f)); deployButton.setFont(Main.fExo2.deriveFont(Font.BOLD).deriveFont(12f));
((DefaultCaret)descriptionField.getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE); // prevent automatically scrolling to the bottom when mod details exceed window size
frame.setSize(800, 600); // 1280 800 frame.setSize(800, 600); // 1280 800
frame.setMinimumSize(new Dimension(640,480)); frame.setMinimumSize(new Dimension(640,480));
frame.setTitle("Firestar Mod Manager"); frame.setTitle("Firestar Mod Manager");