Community
Participate
Working Groups
- 4.3M5 test build, observed on Ubuntu 12.04LTS I noticed in ControlExample that controls would draw a border when their SWT.BORDER style was set, but their SWT.BORDER checkbox would never become selected. The following snippet shows the problem, the last line should print 2048, not 0 (ControlExample can be used to visually confirm that Tables do support showing a border): public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); Table table = new Table(shell, SWT.BORDER); System.out.println(table.getStyle() & SWT.BORDER); // <--- }
analysis: the problem lies in Scroolable.getBorderWidth which depends on Control.getThickness which has GTK3 version which just returns Point(0,0). Scrollable.getBorderWidth is used in Control.checkBorder to decide whether to set the BORDER in the style.
Fixed http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a41e15e7547760b92fd60ae3e7e3c9081f82f745 We need to include the context border and padding in the calculation. Note that the patch is adding GTK_STYLE_CLASS_FRAME to the context. This is the appropriate class for Scrollable, but I am not sure it is the right one for other senders of getThickness(). I performed some testing and could not find any problems.