mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
Theme-aware icons for the main window menu bar and Playlist Editor tab (#2493)
The main window's font-glyph icons were rendered with IconFontSwing.buildIcon, which bakes a fixed colour into the image (black by default, DARK_GRAY for the Playlist Editor tab), so the Screen Capture camera, the Playlist Editor tab icon and the View menu icons ignored the selected theme and were nearly invisible on dark themes. Adds ThemedFontIcon, which resolves its colour from UIManager at paint time (Label.foreground, MenuItem.selectionForeground while a menu item is armed, Label.disabledForeground when disabled) and re-renders only when the colour changes, so icons follow theme switches without a restart. Claude-Session: https://claude.ai/code/session_01TDsxnQntujmycg3aJyRsuN Co-authored-by: Dennis Sheirer <dennis.sheirer@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ package io.github.dsheirer.spectrum;
|
||||
|
||||
import io.github.dsheirer.properties.SystemProperties;
|
||||
import jiconfont.icons.font_awesome.FontAwesome;
|
||||
import jiconfont.swing.IconFontSwing;
|
||||
import io.github.dsheirer.gui.theme.ThemedFontIcon;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DisableSpectrumWaterfallMenuItem extends JMenuItem
|
||||
public DisableSpectrumWaterfallMenuItem(SpectralDisplayPanel spectralDisplayPanel)
|
||||
{
|
||||
super("Disable Spectrum & Waterfall");
|
||||
setIcon(IconFontSwing.buildIcon(FontAwesome.EYE_SLASH, 12));
|
||||
setIcon(new ThemedFontIcon(FontAwesome.EYE_SLASH, 12));
|
||||
|
||||
mSpectralDisplayPanel = spectralDisplayPanel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user