Skip to content

Commit 3ecc28c

Browse files
committed
Made def IDs optional, settings UI tweaks
1 parent d85760d commit 3ecc28c

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/language/splitter/FoundDef.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,16 @@ private void generateText(int width)
5353
defText.addText(foundDef.getSource().getName(), options.getColor("defReadingCol"), options.getColor("defBackCol"));
5454

5555
//output original form if processed
56-
if(!foundForm.getProcessText().equals(""))
56+
if(foundForm.getProcess().size() != 0)
5757
{
5858
defText.addText(foundForm.toString(), options.getColor("defReadingCol"), options.getColor("defBackCol"));
5959
}
6060

6161
//output tags
6262
defText.addText(foundDef.getTagLine(), options.getColor("defTagCol"), options.getColor("defBackCol"));
63-
64-
defText.addText(String.valueOf(foundDef.getID()), options.getColor("defTagCol"), options.getColor("defBackCol"));
63+
//output ID (debug)
64+
if(options.getOptionBool("showDefID"))
65+
defText.addText(String.valueOf(foundDef.getID()), options.getColor("defTagCol"), options.getColor("defBackCol"));
6566

6667
String[] readings = foundDef.getSpellings();
6768
for(String reading:readings)

src/options/Options.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ public Options()
113113
options.put("splitterMode", "full");
114114
options.put("deconMode", "recursive");
115115
options.put("furiMode", "original");
116+
116117
options.put("hookKeyboard", "false");
118+
options.put("showDefID", "false");
117119

118120
}
119121
public Options(File file)throws IOException

src/options/OptionsUI.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import javax.imageio.ImageIO;
2929
import javax.swing.*;
30+
import javax.swing.border.EmptyBorder;
3031
import java.awt.*;
3132
import java.awt.event.ActionEvent;
3233
import java.awt.event.ComponentAdapter;
@@ -121,6 +122,7 @@ public OptionsUI() throws HeadlessException
121122
defWindow.add(new NumberOption("defWidth", "Definition popup width", "Determines how wide the definition popup window is."));
122123
defWindow.add(new ToggleOption("hideDefOnMouseLeave", "Hide definition when mouse leaves the screen", "If unticked, the definition popup will remain visible until you manually close it."));
123124
defWindow.add(new ToggleOption("showAllKanji", "Show all possible Kanji for a word", "If unticked, only kana readings are shown."));
125+
defWindow.add(new ToggleOption("showDefID", "Show definition ID", "Shows the ID code of definitions. Mainly for debug purposes."));
124126
defWindow.add(new OptionLabel("Theme:", null));
125127
defWindow.add(new ColourOption("defBackCol", "Background colour", "Colour for overlay background."));
126128
defWindow.add(new FontOption("defFont", "Font", "Used for definition popup text."));
@@ -168,10 +170,11 @@ public OptionsUI() throws HeadlessException
168170
}
169171
menuScroll = new JScrollPane(leftMenu);
170172
rightOptions = new JPanel();
173+
rightOptions.setBorder(new EmptyBorder(3, 3, 3, 3));
171174
optionScroll = new JScrollPane(rightOptions);
172175
lowerButtons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
173-
optionScroll.getVerticalScrollBar().setUnitIncrement(8);
174-
menuScroll.getVerticalScrollBar().setUnitIncrement(8);
176+
optionScroll.getVerticalScrollBar().setUnitIncrement(12);
177+
menuScroll.getVerticalScrollBar().setUnitIncrement(12);
175178

176179
lowerButtons.add(new JButton(new AbstractAction("Revert changes")
177180
{

src/options/page/OptionPage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import options.option.UIOption;
2020

2121
import javax.swing.*;
22+
import javax.swing.border.EmptyBorder;
2223
import java.util.ArrayList;
2324

2425
/**
@@ -36,6 +37,7 @@ public OptionPage(String name)
3637
options = new ArrayList<>();
3738
frame = new JPanel();
3839
frame.setLayout(new BoxLayout(frame, BoxLayout.Y_AXIS));
40+
frame.setBorder(new EmptyBorder(3, 3, 3, 3));
3941
//frame.setLayout(new FlowLayout(FlowLayout.LEFT));
4042
frame.add(new JLabel(name));
4143
this.name = name;

0 commit comments

Comments
 (0)