Summary: | [GTK] Spinner cursor is wrongly positioned for floating point values | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Khanh Hoang <khanh.hoang> |
Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | akurtakov, ericwill, sdamrong, thang.nguyen |
Version: | 4.14 | Keywords: | triaged |
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
See Also: | https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/169090 | ||
Whiteboard: |
Description
Khanh Hoang
2019-12-09 03:55:01 EST
Can you provide an SWT snippet that demonstrates the issue? (In reply to Eric Williams from comment #1) > Can you provide an SWT snippet that demonstrates the issue? Hi Eric, Please find below the SWT snippet for Spinner that I am using: final int maximumVal = 6350; Spinner spin = new Spinner(parentComposite, SWT.BORDER); spin.setIncrement(25); spin.setDigits(2); spin.setMinimum(0); spin.setMaximum(maximumVal); spin.setTextLimit(5); GridData layout = new GridData(SWT.NONE, SWT.NONE, false, false, 1, 1); layout.minimumWidth = 50; spin.setLayoutData(powerLayout); Eric, Do we have any updates on this? Eric no longer works on Eclipse. Hello, I have taken a look at this. It looks like the cause is in gtk_changed, where we force an update to the spin button through gtk_spin_button_update, which causes the cursor movement and the addition of the zero. So the fix is to not have this call to the force update, however, I am not sure of the repercussions. I'm thinking the forced update is used to make sure the SWT.Modify event has the most updated value (?). If that is not the case, removing the gtk_spin_button_update is the fix. Wondering if anyone has some feedback on why we need to manually update the spin button. Although when the digits of the spin buttons are set to 0, no floating point, the cursor is misplaced. But I believe it is still connected to the manual update on spin button. New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/169090 Hello, I was wondering if you could test on Windows (or whatever platform you use) the behavior for the two cases mentioned in the first comment. I wanted to verify that the change I make is consistent on other platforms. Thanks in advance! |