fix: Inherit parent background for preference controls to ensure consistent UI appearance#22
Merged
Merged
Conversation
…istent UI appearance
There was a problem hiding this comment.
Pull request overview
This PR improves preference page UI consistency by ensuring certain layout-oriented controls inherit their parent composite’s background, reducing visual mismatches across themes and platform renderers.
Changes:
- Added
PreferencePageUtils.inheritParentBackground(Control)to apply parent backgrounds (recursively for composites). - Updated
WrappableNoteLabelandWrappableIconLinkto apply background inheritance on creation and on parent resize. - Updated
MuleSoftMcpPreferencePageto explicitly set container/control backgrounds to match the parent.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/WrappableNoteLabel.java | Re-applies parent background (via utility) during creation and resize handling. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/WrappableIconLink.java | Re-applies parent background (via utility) during creation and resize handling. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/PreferencePageUtils.java | Introduces shared background inheritance helper and uses it for created preference links. |
| com.microsoft.copilot.eclipse.anypoint/src/com/microsoft/copilot/eclipse/anypoint/MuleSoftMcpPreferencePage.java | Aligns preference page control backgrounds with parent; adds a local helper for this. |
Comment on lines
106
to
+110
| private void setupResizeListener() { | ||
| parentToWatch.addControlListener(ControlListener.controlResizedAdapter(e -> updateContentLabelWidth())); | ||
| parentToWatch.addControlListener(ControlListener.controlResizedAdapter(e -> { | ||
| PreferencePageUtils.inheritParentBackground(this); | ||
| updateContentLabelWidth(); | ||
| })); |
Comment on lines
147
to
+151
| private void setupResizeListener() { | ||
| parent.addControlListener(ControlListener.controlResizedAdapter(e -> updateLinkWidth())); | ||
| parent.addControlListener(ControlListener.controlResizedAdapter(e -> { | ||
| PreferencePageUtils.inheritParentBackground(this); | ||
| updateLinkWidth(); | ||
| })); |
Comment on lines
+105
to
+110
| private static void useParentBackground(Control control) { | ||
| if (control != null && !control.isDisposed() && control.getParent() != null | ||
| && !control.getParent().isDisposed()) { | ||
| control.setBackground(control.getParent().getBackground()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.