Some font size changes.

The UI needs to be easier on the eyes, I'm working on it
This commit is contained in:
Snowyfox 2022-05-01 02:46:10 -04:00
parent 648d36ad4c
commit dacf58ac20
24 changed files with 44 additions and 18 deletions

0
ClipboardApi.java Executable file → Normal file
View File

11
ComposeWindow.java Executable file → Normal file
View File

@ -9,12 +9,14 @@ import javax.swing.JButton;
import javax.swing.Box; import javax.swing.Box;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.border.Border;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Color;
import cafe.biskuteri.hinoki.Tree; import cafe.biskuteri.hinoki.Tree;
import java.io.IOException; import java.io.IOException;
@ -298,6 +300,11 @@ implements ActionListener {
{ {
this.primaire = primaire; this.primaire = primaire;
Border b1 = BorderFactory.createEmptyBorder(8, 8, 8, 8);
Border b2 = BorderFactory.createEmptyBorder(4, 4, 4, 4);
Border b3 = BorderFactory.createLineBorder(Color.GRAY);
Border bc = BorderFactory.createCompoundBorder(b3, b2);
reply = new JTextField(); reply = new JTextField();
JLabel replyLabel = new JLabel("In reply to: "); JLabel replyLabel = new JLabel("In reply to: ");
replyLabel.setLabelFor(reply); replyLabel.setLabelFor(reply);
@ -335,13 +342,15 @@ implements ActionListener {
text = new JTextArea(); text = new JTextArea();
text.setLineWrap(true); text.setLineWrap(true);
text.setWrapStyleWord(true); text.setWrapStyleWord(true);
text.setFont(text.getFont().deriveFont(16f));
text.setBorder(bc);
setLayout(new BorderLayout(0, 8)); setLayout(new BorderLayout(0, 8));
add(top, BorderLayout.NORTH); add(top, BorderLayout.NORTH);
add(text, BorderLayout.CENTER); add(text, BorderLayout.CENTER);
add(bottom, BorderLayout.SOUTH); add(bottom, BorderLayout.SOUTH);
setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8)); setBorder(b1);
} }
} }

0
ImageApi.java Executable file → Normal file
View File

0
JKomasto.java Executable file → Normal file
View File

0
LoginWindow.java Executable file → Normal file
View File

46
PostWindow.java Executable file → Normal file
View File

@ -687,27 +687,43 @@ implements ActionListener {
{ {
g.clearRect(0, 0, getWidth(), getHeight()); g.clearRect(0, 0, getWidth(), getHeight());
((java.awt.Graphics2D)g).setRenderingHint(
java.awt.RenderingHints.KEY_ANTIALIASING,
java.awt.RenderingHints.VALUE_ANTIALIAS_ON
);
int w1 = authorName.getWidth(); int w1 = authorName.getWidth();
int w2 = body.getWidth(); int w2 = body.getWidth();
FontMetrics fm1 = getFontMetrics(authorName.getFont()); FontMetrics fm1 = getFontMetrics(authorName.getFont());
FontMetrics fm2 = getFontMetrics(body.getFont()); FontMetrics fm2 = getFontMetrics(body.getFont());
authorName.setText(RichTextPane.layout(authorNameOr, fm1, w1)); List<RichTextPane.Segment> lay1, lay2;
body.setText(RichTextPane.layout(bodyOr, fm2, w2)); lay1 = RichTextPane.layout(authorNameOr, fm1, w1);
lay2 = RichTextPane.layout(bodyOr, fm2, w2);
List<RichTextPane.Segment> lay; authorName.setText(lay1);
lay = RichTextPane.layout(bodyOr, fm2, w2); body.setText(lay2);
int height = 0; for (RichTextPane.Segment s: lay)
int maxY = 0; for (RichTextPane.Segment s: lay2)
{ {
if ((s.y + 10) > height) height = s.y + 10; if (s.y > maxY) maxY = s.y;
} }
body.setPreferredSize(new Dimension(1, height)); body.setPreferredSize(new Dimension(1, maxY + 10));
((java.awt.Graphics2D)g).setRenderingHint(
java.awt.RenderingHints.KEY_ANTIALIASING,
java.awt.RenderingHints.VALUE_ANTIALIAS_ON
);
/*
* I suspect the reason why we are losing antialiasing,
* is that the JScrollPane asks us to paint once and
* then on scroll, it repaints from its capture of the
* viewport contents, rather than ask us to repaint.
* Then it wouldn't set the hint.
*
* We're scheduled to remove the scrolling functionality
* in favour of pages, so, we don't need to intercept
* the scroller for now. Though I feel like it would've
* made more sense to allow setting a widget's rendering
* hints.
*/
} }
// ---%-@-%--- // ---%-@-%---
PostComponent(PostWindow primaire) PostComponent(PostWindow primaire)
@ -717,9 +733,9 @@ implements ActionListener {
emojiUrls = new String[0][]; emojiUrls = new String[0][];
Border b = BorderFactory.createEmptyBorder(10, 10, 10, 10); Border b = BorderFactory.createEmptyBorder(10, 10, 10, 10);
Font f1 = new Font("IPAGothic", Font.PLAIN, 16); Font f1 = new Font("Dialog", Font.PLAIN, 18);
Font f2 = new Font("IPAGothic", Font.PLAIN, 13); Font f2 = new Font("IPAGothic", Font.PLAIN, 14);
Font f3 = getFont().deriveFont(14f); Font f3 = new Font("Dialog", Font.PLAIN, 20);
profile = new RoundButton(); profile = new RoundButton();
favouriteBoost = new TwoToggleButton("favourite", "boost"); favouriteBoost = new TwoToggleButton("favourite", "boost");

0
RepliesWindow.java Executable file → Normal file
View File

View File

@ -125,7 +125,8 @@ implements MouseListener, MouseMotionListener, KeyListener {
identify(int x, int y) identify(int x, int y)
{ {
FontMetrics fm = getFontMetrics(getFont()); FontMetrics fm = getFontMetrics(getFont());
int iy = fm.getAscent(), lh = fm.getHeight(); int iy = fm.getAscent();
int lh = fm.getAscent() + fm.getDescent();
y -= fm.getDescent(); y -= fm.getDescent();
if (y <= iy) y = iy; if (y <= iy) y = iy;
else y += lh - ((y - iy) % lh); else y += lh - ((y - iy) % lh);
@ -186,7 +187,7 @@ implements MouseListener, MouseMotionListener, KeyListener {
text = copy; text = copy;
ListIterator<Segment> cursor = text.listIterator(); ListIterator<Segment> cursor = text.listIterator();
int x = 0, y = fm.getAscent(); int x = 0, y = fm.getAscent();
int dy = fm.getHeight(); int dy = fm.getAscent() + fm.getDescent();
while (cursor.hasNext()) while (cursor.hasNext())
{ {
Segment curr = cursor.next(); Segment curr = cursor.next();

0
TimelineWindow.java Executable file → Normal file
View File

0
TimelineWindowUpdater.java Executable file → Normal file
View File

0
TwoToggleButton.java Executable file → Normal file
View File

0
graphics/Flags.xcf Executable file → Normal file
View File

0
graphics/Hourglass.xcf Executable file → Normal file
View File

0
graphics/button.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
graphics/disabledOverlay.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
graphics/favouriteToggled.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 353 B

0
graphics/miscToggled.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
graphics/miscUntoggled.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

0
graphics/ref1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
graphics/selectedOverlay.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

0
graphics/test1.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

0
graphics/test2.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
graphics/test3.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
graphics/test4.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB