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

functions
This commit is contained in:
dragonmacher 2025-02-05 21:04:50 -05:00
parent 5002de13f4
commit 3717622c60
2 changed files with 19 additions and 11 deletions

View file

@ -119,7 +119,6 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
layoutController = new ClangLayoutController(options, this, metrics, hlFactory); layoutController = new ClangLayoutController(options, this, metrics, hlFactory);
fieldPanel = new DecompilerFieldPanel(layoutController); fieldPanel = new DecompilerFieldPanel(layoutController);
setBackground(options.getBackgroundColor());
scroller = new IndexedScrollPane(fieldPanel); scroller = new IndexedScrollPane(fieldPanel);
fieldPanel.addFieldSelectionListener(this); fieldPanel.addFieldSelectionListener(this);
@ -140,6 +139,8 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
} }
}); });
setBackground(options.getBackgroundColor());
decompilerHoverProvider = new DecompilerHoverProvider(); decompilerHoverProvider = new DecompilerHoverProvider();
searchHighlightColor = options.getSearchHighlightColor(); searchHighlightColor = options.getSearchHighlightColor();
@ -454,6 +455,7 @@ public class DecompilerPanel extends JPanel implements FieldMouseListener, Field
} }
if (fieldPanel != null) { if (fieldPanel != null) {
fieldPanel.setBackgroundColor(bg); fieldPanel.setBackgroundColor(bg);
scroller.setBackground(bg);
} }
super.setBackground(bg); super.setBackground(bg);
} }

View file

@ -64,9 +64,18 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
this.indexMapper = createIndexMapper(); 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 * 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. * whose view is always as big as the component in this scroll pane.
* @param b true to never scroll
*/ */
public void setNeverScroll(boolean b) { public void setNeverScroll(boolean b) {
neverScroll = true; neverScroll = true;
@ -75,16 +84,10 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
useViewSizeAsPreferredSize = b; useViewSizeAsPreferredSize = b;
} }
/**
* @see JScrollPane#setVerticalScrollBarPolicy(int)
*/
public void setVerticalScrollBarPolicy(int policy) { public void setVerticalScrollBarPolicy(int policy) {
scrollPane.setVerticalScrollBarPolicy(policy); scrollPane.setVerticalScrollBarPolicy(policy);
} }
/**
* @see JScrollPane#setHorizontalScrollBarPolicy(int)
*/
public void setHorizontalScrollBarPolicy(int policy) { public void setHorizontalScrollBarPolicy(int policy) {
scrollPane.setHorizontalScrollBarPolicy(policy); scrollPane.setHorizontalScrollBarPolicy(policy);
} }
@ -167,7 +170,8 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
class ScrollViewLayout implements LayoutManager { class ScrollViewLayout implements LayoutManager {
@Override @Override
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component c) {
// stub
} }
@Override @Override
@ -189,7 +193,8 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
} }
@Override @Override
public void removeLayoutComponent(Component comp) { public void removeLayoutComponent(Component c) {
// stub
} }
} }
@ -231,6 +236,7 @@ public class IndexedScrollPane extends JPanel implements IndexScrollListener {
@Override @Override
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
// stub
} }
@Override @Override