Skip to content

Commit 49fc07c

Browse files
committed
Last minute bug fixes and changes
1 parent 657711c commit 49fc07c

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

preferences/settings.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,5 @@ edictSourcePriority = 0
9292
epwingSourcePriority = -1
9393
epwingBlacklistMinLines = 10
9494
epwingStartBlacklist = ・
95-
resetDefScroll = true
95+
resetDefScroll = true
96+
exportDisplay = external

src/options/OptionsUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public OptionsUI() throws HeadlessException
135135

136136
root.add(defs);
137137
OptionPage xport = new OptionPage("Export");
138-
xport.add(new RadioOption("exportDisplay", exportDisplayConfig, "Export counter mode", null));
138+
xport.add(new RadioOption("exportDisplay", exportDisplayConfig, "Export counter mode", "Requires restart to apply."));
139139
xport.add(new OptionLabel("Words:", null));
140140
xport.add(new ToggleOption("commentOnExport", "Ask for comment when exporting words", "<html>If ticked, you will be prompted for extra information when exporting a word."
141141
+ "<br>If unticked, this field is always left blank"));

src/options/option/RadioOption.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public class RadioOption extends UIOption
3030
JPanel mainPanel;
3131
ArrayList<ValueHandler> radioButtons;
3232

33-
static final int height = 150;
34-
3533
public RadioOption(String tag, String configText, String name, String tip)
3634
{
3735
super(tag, name, tip);
@@ -64,7 +62,7 @@ public RadioOption(String tag, String configText, String name, String tip)
6462
//mainPanel.add(colPanel, BorderLayout.WEST);
6563

6664

67-
mainPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, height));
65+
mainPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, mainPanel.getMinimumSize().height));
6866
}
6967
@Override
7068
public void update()
@@ -105,6 +103,7 @@ public void actionPerformed(ActionEvent e)
105103
}
106104
});
107105
button.setText(name);
106+
button.setToolTipText(tip);
108107
}
109108

110109
public Component getComponent()

src/options/page/UserDefPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@ public void update()
129129
@Override
130130
public String toString()
131131
{
132-
return "edit " + source.getName().toLowerCase() + " dictionary";
132+
return /*"edit " + */source.getName().toLowerCase() + " dictionary";
133133
}
134134
}

src/ui/TextBlockRenderer.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void render(Graphics g, int x, int y)
5959
defLines = 0;//will be recounted
6060
capture = "";//will be recaptured
6161
g.setColor(new Color(0,0,0,1));
62-
g.fillRect(x, y - g.getFontMetrics().getAscent(), width, 1);//let mouse move through 1 pixel space
62+
g.fillRect(x, y - g.getFontMetrics().getAscent() + (options.getOptionBool("defsShowUpwards")?1:0), width, 1);//let mouse move through 1 pixel space
6363
y++;//slight spacer
6464
if(!options.getOptionBool("defsShowUpwards"))y -= g.getFontMetrics().getHeight();
6565

@@ -103,27 +103,27 @@ private int renderLine(TextBlock text, Graphics g, int x, int y)
103103
int startY = y;
104104
FontMetrics font = g.getFontMetrics();
105105
TextStream stream = new TextStream(text.getText());
106-
String line = "";
106+
StringBuilder line = new StringBuilder();
107107
Deque<String> lines = new LinkedList<>();
108108
while(!stream.isDone())
109109
{
110110
String nextBit = stream.nextWord();
111111
if(font.stringWidth(line + nextBit) > width)//too much for this line, wrap over
112112
{
113-
lines.add(line);//add line for rendering
114-
line = nextBit.trim();//put word on new line
113+
lines.add(line.toString());//add line for rendering
114+
line = new StringBuilder(nextBit.trim());//put word on new line
115115
}
116116
else
117117
{
118-
line += nextBit;
118+
line.append(nextBit);
119119
}
120120
}
121-
if(!line.equals(""))lines.add(line);//add last line
121+
if(!line.toString().equals(""))lines.add(line.toString());//add last line
122122
//draw lines
123123
while(!lines.isEmpty())
124124
{
125-
if(displayUpwards)line = lines.pollLast();
126-
else line = lines.pollFirst();
125+
if(displayUpwards) line = new StringBuilder(lines.pollLast());
126+
else line = new StringBuilder(lines.pollFirst());
127127
//draw line
128128
defLines++;
129129
if(startLine <= defLines)
@@ -137,7 +137,7 @@ private int renderLine(TextBlock text, Graphics g, int x, int y)
137137

138138
//print text
139139
g.setColor(text.getTextCol());
140-
g.drawString(line, x, y);
140+
g.drawString(line.toString(), x, y);
141141

142142
}
143143
}

0 commit comments

Comments
 (0)