Skip to content

Commit

Permalink
SecurityDetailsViewer: Another attempt to fix ScrolledComposite artifact
Browse files Browse the repository at this point in the history
Additional code to avoide situation when ScrolledComposite's scrollbar
covers right edge of its internal container, obscuring information there
(like last digits of quotes, etc.). Instead, we want to layout this
container set so that inner content container took ScrolledComposite's
width without scrollbar.

For reference, this is based on hint in this StackOverflow question:
https://stackoverflow.com/questions/35123/prevent-swt-scrolledcomposite-from-eating-part-of-its-children
  • Loading branch information
pfalcon committed Nov 15, 2024
1 parent 7b695d9 commit 65feb66
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@ public void controlResized(ControlEvent e)
container.setMinSize(container1.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});

// After adding all children, explicitly calculate size and layout
// ScrolledComposite's content container. This is again to avoid
// artifact when scrollbar covers this container's right edge.
container1.setSize(container1.computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
container1.layout();
}

public Control getControl()
Expand Down

0 comments on commit 65feb66

Please sign in to comment.