mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Register Channel tab's JFXPanel scenes with the ThemeManager
The Channel tab embeds two JavaFX scenes inside Swing via JFXPanel: the noise squelch chart (NoiseSquelchView) and the symbol view. Neither was registered with the ThemeManager, so the dark stylesheet was never applied to them. In dark mode the chart legend, axis area and surrounding panel rendered with JavaFX's default light Modena styling against the otherwise dark UI. JFXPanel-hosted scenes are invisible to javafx.stage.Window.getWindows(), so the theme manager cannot find them automatically on toggle - they have to be explicitly registered at creation time, the same as the JavaFX Stages JavaFxWindowManager already registers.
This commit is contained in:
@@ -24,6 +24,7 @@ import io.github.dsheirer.dsp.filter.channelizer.PolyphaseChannelSource;
|
||||
import io.github.dsheirer.gui.power.SignalPowerView;
|
||||
import io.github.dsheirer.gui.squelch.NoiseSquelchView;
|
||||
import io.github.dsheirer.gui.symbol.SymbolView;
|
||||
import io.github.dsheirer.gui.theme.ThemeManager;
|
||||
import io.github.dsheirer.module.ProcessingChain;
|
||||
import io.github.dsheirer.module.decode.FeedbackDecoder;
|
||||
import io.github.dsheirer.module.decode.PrimaryDecoder;
|
||||
@@ -200,6 +201,7 @@ public class ChannelSpectrumPanel extends JPanel implements Listener<ProcessingC
|
||||
//Spin noise squelch panel construction off onto the JavafX UI thread.
|
||||
Platform.runLater(() -> {
|
||||
Scene scene = new Scene(mNoiseSquelchView);
|
||||
ThemeManager.getInstance().register(scene);
|
||||
mNoiseSquelchPanel.setScene(scene);
|
||||
Scene scene2 = new Scene(mSymbolView);
|
||||
URL resource = getClass().getResource("/sdrtrunk_style.css");
|
||||
@@ -213,6 +215,7 @@ public class ChannelSpectrumPanel extends JPanel implements Listener<ProcessingC
|
||||
LOGGER.warn("Can't find stylesheet resource for sdrtrunk");
|
||||
}
|
||||
|
||||
ThemeManager.getInstance().register(scene2);
|
||||
mSymbolPanel.setScene(scene2);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user