From 0ff0919db27390fb625f899a585373d1de3e576d Mon Sep 17 00:00:00 2001 From: ericek111 Date: Thu, 1 Oct 2026 16:31:43 +0000 Subject: [PATCH] Keep the server tab strip in step with theme switches The strip is out of the component tree while one server is open, so a look-and-feel switch missed it and it came back in the old theme's colours. Co-Authored-By: Claude Opus 5.5 --- .../src/main/java/com/ts3client/ui/ServerTabPane.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java index 98712e3..22f4fd3 100644 --- a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java +++ b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java @@ -9,6 +9,7 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -60,6 +61,16 @@ final class ServerTabPane extends JPanel { dragReorder.attach(tabbed); } + /** + * The tab strip is out of the component tree while a single server is open, so a + * look-and-feel switch would miss it and leave it in the old theme's colours. + */ + @Override + public void updateUI() { + super.updateUI(); + if (tabbed != null && tabbed.getParent() == null) SwingUtilities.updateComponentTreeUI(tabbed); + } + /** Drags a tab from one position to another, keeping the current selection on screen. */ private void moveTab(int from, int to) { if (from < 0 || to < 0 || from >= tabs.size() || to >= tabs.size() || from == to) return;