Added #1680 Pinning objects

Fixed Header of display panel not visible on certain color schemes
Changed Raw editor does not show tag name in the tree (it's now in the new pinnable head)
This commit is contained in:
Jindra Petřík
2022-11-19 13:35:37 +01:00
parent fdcbe59cec
commit 96c63be654
22 changed files with 866 additions and 48 deletions

View File

@@ -17,6 +17,7 @@
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.configuration.Configuration;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.SystemColor;
import java.awt.geom.GeneralPath;
@@ -69,11 +70,14 @@ public class HeaderLabel extends JLabel {
@Override
public void paint(Graphics g) {
Color foregroundColor;
if (Configuration.useRibbonInterface.get()) {
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getBackgroundFillColor());
foregroundColor = skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getForegroundColor();
} else {
g.setColor(SystemColor.control);
foregroundColor = SystemColor.controlText;
}
g.fillRect(0, 0, getWidth(), getHeight());
if (Configuration.useRibbonInterface.get()) {
@@ -94,13 +98,11 @@ public class HeaderLabel extends JLabel {
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
borderPainter.paintBorder(g, this, getWidth(), getHeight() + dy,
contour, contourInner, skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED));
g.setColor(skin.getColorScheme(DecorationAreaType.HEADER, ColorSchemeAssociationKind.FILL, ComponentState.ENABLED).getForegroundColor());
} else {
g.setColor(SystemColor.controlText);
}
JLabel lab = new JLabel(getText(), JLabel.CENTER);
lab.setSize(getSize());
lab.setForeground(foregroundColor);
lab.paint(g);
}
}