Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-5341 - Decompiler - Fixed background not painting fully for undefined functions

dragonmacher3717622c6031
diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java
index 6777fe1cca..607fb667d0 100644
--- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java
+++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerPanel.java
@@ -119,7 +119,6 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
layoutController = new ClangLayoutController(options, this, metrics, hlFactory);
fieldPanel = new DecompilerFieldPanel(layoutController);
- setBackground(options.getBackgroundColor());
scroller = new IndexedScrollPane(fieldPanel);
fieldPanel.addFieldSelectionListener(this);
@@ -140,6 +139,8 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
}
});
+ setBackground(options.getBackgroundColor());
+
decompilerHoverProvider = new DecompilerHoverProvider();
searchHighlightColor = options.getSearchHighlightColor();
@@ -454,6 +455,7 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
}
if (fieldPanel != null) {
fieldPanel.setBackgroundColor(bg);
+ scroller.setBackground(bg);
}
super.setBackground(bg);
}
diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/indexedscrollpane/IndexedScrollPane.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/indexedscrollpane/IndexedScrollPane.java
index 69dc3d3bc8..aa38110e79 100644
--- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/indexedscrollpane/IndexedScrollPane.java
+++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/indexedscrollpane/IndexedScrollPane.java
@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -64,9 +64,18 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
this.indexMapper = createIndexMapper();
}
+ @Override
+ public void setBackground(Color bg) {
+ if (viewport != null) {
+ viewport.setBackground(bg);
+ }
+ super.setBackground(bg);
+ }
+
/**
* Sets this scroll pane to never show scroll bars. This is useful when you want a container
* whose view is always as big as the component in this scroll pane.
+ * @param b true to never scroll
*/
public void setNeverScroll(boolean b) {
neverScroll = true;
@@ -75,16 +84,10 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
useViewSizeAsPreferredSize = b;
}
- /**
- * @see JScrollPane#setVerticalScrollBarPolicy(int)
- */
public void setVerticalScrollBarPolicy(int policy) {
scrollPane.setVerticalScrollBarPolicy(policy);
}
- /**
- * @see JScrollPane#setHorizontalScrollBarPolicy(int)
- */
public void setHorizontalScrollBarPolicy(int policy) {
scrollPane.setHorizontalScrollBarPolicy(policy);
}
@@ -167,7 +170,8 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
class ScrollViewLayout implements LayoutManager {
@Override
- public void addLayoutComponent(String name, Component comp) {
+ public void addLayoutComponent(String name, Component c) {
+ // stub
}
@Override
@@ -189,7 +193,8 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
}
@Override
- public void removeLayoutComponent(Component comp) {
+ public void removeLayoutComponent(Component c) {
+ // stub
}
}
@@ -231,6 +236,7 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
@Override
protected void paintComponent(Graphics g) {
+ // stub
}
@Override