Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350511

Summary: [preferences] Incorrect padding for Show Whitespace characters preference
Product: [Eclipse Project] Platform Reporter: Brock Janiczak <brockj>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: daniel_megert, deepakazad, markus.kell.r
Version: 3.7   
Target Milestone: 3.8 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Brock Janiczak CLA 2011-06-27 23:19:12 EDT
Build Identifier: 20110615-0604

The Show whitespace characters preference in the text editors preference page looks misaligned under GTK3.  I think this is because setText wasn't called on the check box.

Reproducible: Always

Steps to Reproduce:
1. Running GTK3
2. Open the Text Editors preference page
3. observe that the Show Whitespace preference is indented slightly more than other items
4. Clicking on the checkbox also shows a little rectangle next to the check box where the text would normally go.
Comment 1 Deepak Azad CLA 2011-06-28 00:33:03 EDT
I will take a look.
Comment 2 Markus Keller CLA 2011-06-28 14:27:41 EDT
Yeah, on the Mac it's even worse. This happens because a checkbox label cannot contain links, so we fake the widget using two.

The problem is that we don't know where the OS starts drawing text next to a checkbox. We either need API for this from SWT, or we could try to make an educated guess like this:
- create a checkbox c with text "a"
- create a label l with text "a"
=> right indent is close to
    c.computeSize(DEFAULT, DEFAULT) - l.computeSize(DEFAULT, DEFAULT)
Comment 3 Markus Keller CLA 2012-01-20 13:40:14 EST
Fixed in TextEditorDefaultsPreferencePage and OptionsConfigurationBlock.

The strategy in comment 2 didn't work, since each platform has its own peculiarities. In the end, I used platform-specific offsets.