Zoom chat and descriptions with Ctrl+mouse wheel

Text and pictures in the chat tabs and the info panel zoom in browser
steps (50-300 %), keeping the line at the top in view. The chat and the
info panel each have their own level, shared by every server tab and
saved in the settings.

The HTML documents now take their fonts from a stylesheet that applies
the zoom. The old ScaledStyleSheet never reached the document, and
FlatLaf already applies the interface scale, so it only zooms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 16:44:04 +00:00
parent 0ff0919db2
commit d2de76f534
7 changed files with 229 additions and 12 deletions

View File

@@ -66,6 +66,8 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
private final ContactStore contacts = ContactStore.load();
private final AudioBackend audio = new DesktopAudioBackend();
private final PictureDownloads pictures = new PictureDownloads(new File(AppDirs.profile(), "pictures"), true);
private final TextZoom chatZoom;
private final TextZoom infoZoom;
/** Sound pack playback, shared by every connection. */
private final SoundNotifier sounds;
private final SoundPlayer soundPlayer;
@@ -102,6 +104,14 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
public MainFrame(Settings settings) {
super("TS3J — TeamSpeak 3 Java Client");
this.settings = settings;
this.chatZoom = new TextZoom(settings.chatZoom, z -> {
settings.chatZoom = z;
settings.save();
});
this.infoZoom = new TextZoom(settings.infoZoom, z -> {
settings.infoZoom = z;
settings.save();
});
this.identities = IdentityStore.load(settings);
new TeamSpeakImporter(identities, bookmarks, settings).seedIfFresh();
this.sounds = new SoundNotifier(settings);
@@ -469,6 +479,14 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
}
/** Tells the user of a poke or a private message while the client is in the background. */
TextZoom chatZoom() {
return chatZoom;
}
TextZoom infoZoom() {
return infoZoom;
}
DesktopNotifier notifier() {
return notifier;
}