New application icon on both apps

Rubin's vase with a headset: the vase's outline is two faces looking at
each other, one talking into the microphone. Blue on transparent; the
Android launcher puts it on white, as no launcher shows a transparent
adaptive icon. Desktop windows, tray, the .desktop entry and the macOS
dock all use it, with a bolder variant below 32 px.

ts3-client/tools/AppIcon.java generates the SVGs and the launcher
foreground.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 23:06:46 +00:00
co-authored by Claude Opus 5.5
parent a334173fcc
commit 44ecc15bd8
10 changed files with 233 additions and 13 deletions
@@ -35,7 +35,7 @@ public final class DesktopEntry {
private DesktopEntry() {
}
/** Call on the event thread once the look-and-feel is installed (the icon uses its accent). */
/** Call on the event thread. */
public static void install() {
if (!System.getProperty("os.name", "").toLowerCase(Locale.ROOT).startsWith("linux")
|| !Boolean.parseBoolean(System.getProperty("ts3j.desktopEntry", "true"))) {
@@ -145,7 +145,7 @@ public final class IconTheme {
return c != null ? c : Color.BLACK;
}
private static BufferedImage rasterize(byte[] data, int size) {
static BufferedImage rasterize(byte[] data, int size) {
try {
SVGDocument document = new SVGLoader().load(
new ByteArrayInputStream(data), null, LoaderContext.createDefault());
@@ -10,6 +10,8 @@ import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
@@ -301,8 +303,15 @@ public final class Icons {
return app(small());
}
/** Below 32 pixels a variant with a bolder headset, whose thin lines would blur away. */
public static ImageIcon app(int size) {
return make(size, Icons::paintApp);
String name = size < 32 ? "app-icon-small.svg" : "app-icon.svg";
try (InputStream in = Icons.class.getResourceAsStream(name)) {
BufferedImage image = IconTheme.rasterize(in.readAllBytes(), size);
if (image != null) return new ImageIcon(image);
} catch (IOException | RuntimeException ignored) {
}
return new ImageIcon(new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB));
}
/** The window icon at the sizes task bars and switchers pick from. */
@@ -475,14 +484,4 @@ public final class Icons {
g.drawLine(x1, y1, x2, y2);
}
}
private static void paintApp(Graphics2D g) {
g.setColor(Theme.accent());
g.fillRoundRect(1, 1, 14, 14, 4, 4);
g.setColor(Color.WHITE);
g.setStroke(new BasicStroke(1.6f));
g.drawArc(4, 5, 8, 8, 30, 120);
g.drawArc(2, 3, 12, 12, 30, 120);
g.fillOval(7, 9, 2, 2);
}
}
@@ -43,6 +43,7 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.KeyboardFocusManager;
import java.awt.Taskbar;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@@ -136,6 +137,10 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
contacts.addListener(() -> SwingUtilities.invokeLater(this::contactsChanged));
setIconImages(Icons.appImages());
// The macOS dock ignores window icons.
if (Taskbar.isTaskbarSupported() && Taskbar.getTaskbar().isSupported(Taskbar.Feature.ICON_IMAGE)) {
Taskbar.getTaskbar().setIconImage(Icons.app(256).getImage());
}
// We tear the connections down ourselves on close, so don't let Swing kill the JVM.
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><defs><linearGradient id="g" x1="0" y1="0" x2="0.6" y2="1"><stop offset="0" stop-color="#4FA3FF"/><stop offset="1" stop-color="#2442B8"/></linearGradient></defs><path fill="url(#g)" d="M128,5.6C66.1,5.6 11.9,47.6 10.8,104L10.8,104C4.6,107.5 0.5,114.1 0.5,121.7L0.5,146.8C0.5,158.1 9.7,167.3 21,167.3L21.4,167.3C26.9,184.5 36.3,190.5 49.6,190.5C54.3,190.5 59.5,189.7 65.2,188.5L65.2,188.5C68.1,187.8 71.1,187.1 74.3,186.2L74.3,186.2C76.6,187.9 79.4,188.9 82.5,188.9C90,188.9 96.1,182.8 96.1,175.2C96.1,167.7 90,161.6 82.5,161.6C76.9,161.6 72.1,164.9 70,169.7L70,169.7C66.9,170.5 64.1,171.2 61.5,171.8L61.5,171.8C56.5,172.9 52.6,173.6 49.5,173.6C43.5,173.6 40.4,170.9 37.9,163.1L37.9,163.1C42.9,159.4 46,153.4 46,146.8L46,121.7C46,114.2 41.9,107.6 35.8,104L35.8,104C37,65.2 75.7,30.7 128,30.7C180.3,30.7 219,65.2 220.2,104L220.2,104C214.1,107.6 210,114.2 210,121.7L210,146.8C210,158.1 219.1,167.3 230.5,167.3L235,167.3C246.3,167.3 255.5,158.1 255.5,146.8L255.5,121.7C255.5,114.1 251.4,107.5 245.2,104L245.2,104C244.1,47.6 189.9,5.6 128,5.6ZM79.3,52.3C76.4,54 73.7,55.8 71.2,57.7L71.2,57.7C75.5,62.7 81.4,69.6 84.7,75.1C89.7,83 93.8,94.2 96.1,100.1C98.4,106 98.4,107.5 98.4,110.4C98.4,113.2 94.8,114.1 96.1,117.2C97.5,120.2 103,124.8 106.4,128.6C109.8,132.4 115.5,136.9 116.6,140C117.8,143 115.5,145.3 113.2,146.8C110.9,148.3 104.3,147 103,149.1C101.6,151.1 105.8,156.5 105.2,159.3C104.9,160.9 103.2,162 101.8,163.2L101.8,163.2C104,166.7 105.2,170.8 105.2,175.2C105.2,175.2 105.2,175.2 105.2,175.2C105.2,181.2 102.9,186.6 99.2,190.7L99.2,190.7C99.8,191.6 100.3,192.6 100.7,193.5C102,196.7 104.9,199.7 104.1,202.6C103.3,205.4 99,208.1 96.1,210.5C93.3,213 89.1,214.1 87,217.4C84.9,220.6 84.7,226.3 83.6,229.9C82.5,233.5 83,236 80.2,239C77.3,242 69.9,246.2 66.5,248.1C63.1,250 60.8,250 59.7,250.4L196.3,250.4C195.2,250 192.9,250 189.5,248.1C186.1,246.2 178.7,242 175.8,239C173,236 173.5,233.5 172.4,229.9C171.3,226.3 171.1,220.6 169,217.4C166.9,214.1 162.7,213 159.9,210.5C157,208.1 152.7,205.4 151.9,202.6C151.1,199.7 154,196.7 155.3,193.5C156.6,190.2 160.3,186.2 159.9,183.2C159.5,180.2 153.6,178.1 153,175.2C152.5,172.4 156.8,168.8 156.5,166.1C156.1,163.5 151.3,162.2 150.8,159.3C150.2,156.5 154.4,151.1 153,149.1C151.7,147 145.1,148.3 142.8,146.8C140.5,145.3 138.2,143 139.4,140C140.5,136.9 146.2,132.4 149.6,128.6C153,124.8 158.5,120.2 159.9,117.2C161.2,114.1 157.6,113.2 157.6,110.4C157.6,107.5 157.6,106 159.9,100.1C162.2,94.2 166.3,83 171.3,75.1C174.6,69.6 180.5,62.7 184.8,57.7L184.8,57.7C182.3,55.8 179.6,54 176.7,52.3Z"/></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><defs><linearGradient id="g" x1="0" y1="0" x2="0.6" y2="1"><stop offset="0" stop-color="#4FA3FF"/><stop offset="1" stop-color="#2442B8"/></linearGradient></defs><path fill="url(#g)" d="M128,6.9C68.5,6.9 18.3,48.4 16.1,102.2L16.1,102.2C10.2,104.5 6,110.3 6,117L6,139.5C6,148.4 13.2,155.5 22,155.5L25.4,155.5C30.2,172.1 37.8,178.4 50.3,178.4C53.9,178.4 57.9,177.9 62.3,176.9L62.3,176.9C66.7,176.1 71.5,174.8 76.8,173.4L76.8,173.4C78.5,174.8 80.6,175.7 83,175.7C88.2,175.7 92.5,171.4 92.5,166.2C92.5,161 88.2,156.7 83,156.7C78.8,156.7 75.3,159.4 74,163.1L74,163.1C68.7,164.5 64.2,165.7 60.2,166.5L60.2,166.5C56.2,167.3 52.9,167.9 50.1,167.9C42.8,167.9 38.7,164.2 35.4,152.1L35.4,152.1C39.1,149.2 41.5,144.7 41.5,139.5L41.5,117C41.5,110.3 37.4,104.6 31.6,102.2L31.6,102.2C33.7,58.6 75.1,22.3 128,22.3C180.9,22.3 222.3,58.6 224.4,102.2L224.4,102.2C218.6,104.6 214.5,110.3 214.5,117L214.5,139.5C214.5,148.4 221.6,155.5 230.5,155.5L234,155.5C242.8,155.5 250,148.4 250,139.5L250,117C250,110.3 245.8,104.5 239.9,102.2L239.9,102.2C237.7,48.4 187.5,6.9 128,6.9ZM77,43C74.1,44.7 71.4,46.6 68.8,48.6L68.8,48.6C73.3,53.8 79.5,61 83,66.7C88.1,75 92.5,86.6 94.8,92.8C97.2,98.9 97.2,100.5 97.2,103.4C97.2,106.4 93.5,107.4 94.8,110.5C96.2,113.7 101.9,118.4 105.5,122.4C109,126.3 115,131.1 116.2,134.2C117.3,137.4 115,139.7 112.6,141.3C110.2,142.9 103.3,141.5 101.9,143.7C100.6,145.9 104.9,151.4 104.3,154.4C103.8,157 99.7,158.4 98.6,160.7L98.6,160.7C99.1,162 99.4,163.5 99.5,164.9L99.5,164.9C100.7,167 102.3,169.1 101.9,170.9C101.3,173.9 95.2,176.1 94.8,179.2C94.4,182.4 98.2,186.5 99.6,189.9C101,193.2 103.9,196.4 103.1,199.4C102.3,202.3 97.8,205.1 94.8,207.7C91.9,210.2 87.5,211.4 85.4,214.8C83.2,218.1 83,224 81.8,227.8C80.6,231.5 81.2,234.1 78.3,237.3C75.3,240.4 67.6,244.8 64,246.7C60.5,248.7 58.1,248.7 56.9,249.1L199.1,249.1C197.9,248.7 195.5,248.7 192,246.7C188.4,244.8 180.7,240.4 177.7,237.3C174.8,234.1 175.4,231.5 174.2,227.8C173,224 172.8,218.1 170.6,214.8C168.5,211.4 164.1,210.2 161.2,207.7C158.2,205.1 153.7,202.3 152.9,199.4C152.1,196.4 155,193.2 156.4,189.9C157.8,186.5 161.6,182.4 161.2,179.2C160.8,176.1 154.7,173.9 154.1,170.9C153.5,168 158,164.2 157.6,161.5C157.2,158.7 152.3,157.3 151.7,154.4C151.1,151.4 155.4,145.9 154.1,143.7C152.7,141.5 145.8,142.9 143.4,141.3C141,139.7 138.7,137.4 139.8,134.2C141,131.1 147,126.3 150.5,122.4C154.1,118.4 159.8,113.7 161.2,110.5C162.5,107.4 158.8,106.4 158.8,103.4C158.8,100.5 158.8,98.9 161.2,92.8C163.5,86.6 167.9,75 173,66.7C176.5,61 182.7,53.8 187.2,48.6L187.2,48.6C184.6,46.6 181.9,44.7 179,43Z"/></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB