mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-1981 - Theming - Docking Module
This commit is contained in:
parent
803a9e9864
commit
466db9efe3
73 changed files with 505 additions and 1553 deletions
|
@ -30,6 +30,9 @@ import org.jdesktop.animation.timing.Animator;
|
|||
import docking.util.AnimationUtils;
|
||||
import docking.widgets.EmptyBorderButton;
|
||||
import docking.widgets.label.GDLabel;
|
||||
import generic.theme.GThemeDefaults.Colors;
|
||||
import generic.theme.Gui;
|
||||
import generic.theme.TempColorUtils;
|
||||
import generic.util.WindowUtilities;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.layout.HorizontalLayout;
|
||||
|
@ -196,7 +199,7 @@ public class StatusBar extends JPanel {
|
|||
String updatedText = fixupMultilineText(text);
|
||||
statusLabel.setText(updatedText);
|
||||
statusLabel.setToolTipText(getToolTipText());
|
||||
statusLabel.setForeground(Color.BLACK);
|
||||
statusLabel.setForeground(Colors.FOREGROUND);
|
||||
|
||||
if (StringUtils.isBlank(updatedText)) {
|
||||
return;
|
||||
|
@ -304,24 +307,40 @@ public class StatusBar extends JPanel {
|
|||
private FadeTimer() {
|
||||
super(5000, null);
|
||||
addActionListener(this);
|
||||
initFadeColors();
|
||||
}
|
||||
|
||||
private void initFadeColors() {
|
||||
fadeColorMap.put(Color.BLACK, new Color(16, 16, 16));
|
||||
fadeColorMap.put(new Color(16, 16, 16), new Color(32, 32, 32));
|
||||
fadeColorMap.put(new Color(32, 32, 32), new Color(64, 64, 64));
|
||||
fadeColorMap.put(new Color(64, 64, 64), new Color(80, 80, 80));
|
||||
fadeColorMap.put(new Color(80, 80, 80), new Color(96, 96, 96));
|
||||
fadeColorMap.put(new Color(96, 96, 96), new Color(112, 112, 112));
|
||||
fadeColorMap.put(new Color(112, 112, 112), new Color(128, 128, 128));
|
||||
|
||||
int value = 0;
|
||||
int delta = 16;
|
||||
if (Gui.getActiveTheme().useDarkDefaults()) {
|
||||
value = 128;
|
||||
delta = -16;
|
||||
}
|
||||
|
||||
Color start = TempColorUtils.fromRgb(value, value, value);
|
||||
fadeColorMap.put(statusLabel.getForeground(), start);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
|
||||
Color from = TempColorUtils.fromRgb(value, value, value);
|
||||
value += delta;
|
||||
Color to = TempColorUtils.fromRgb(value, value, value);
|
||||
fadeColorMap.put(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restart() {
|
||||
initFadeColors();
|
||||
super.restart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
Color nextFadeColor = fadeColorMap.get(statusLabel.getForeground());
|
||||
|
||||
if (nextFadeColor != null) {
|
||||
|
||||
statusLabel.setForeground(nextFadeColor);
|
||||
}
|
||||
else {
|
||||
|
@ -385,7 +404,7 @@ public class StatusBar extends JPanel {
|
|||
int red = color.getRed();
|
||||
int green = color.getGreen();
|
||||
int blue = color.getBlue();
|
||||
return new Color((255 - red), (255 - green), (255 - blue));
|
||||
return TempColorUtils.fromRgb((255 - red), (255 - green), (255 - blue));
|
||||
}
|
||||
|
||||
private void contrastStatusLabelColors() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue