| Summary: | [Win32]setImage(null) on Label overrides text | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Fabian Zeindl <fabian.zeindl> | ||||||
| Component: | SWT | Assignee: | Paul Pazderski <paul-eclipse> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | ericwill, grant_gayed, khouly, lshanmug, mfadl, nikita, paul-eclipse, remy.suen | ||||||
| Version: | 3.4 | Keywords: | triaged | ||||||
| Target Milestone: | 4.13 M1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows All | ||||||||
| See Also: |
https://git.eclipse.org/r/143312 https://git.eclipse.org/r/143313 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1ebd136999348eaf6d9839b9b54ef7383ee04db4 |
||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 548736 | ||||||||
| Attachments: |
|
||||||||
|
Description
Fabian Zeindl
Is there a difference between Windows and Linux? The correct behavior is that the last thing set (either text or image) is displayed. Yes. Under Linux/GTK I can set a text and then do setImage(null) so the text is displayed. Ok, then this is not a bug. Right now, Label won't display both a text and an image. Try CLabel for this. But I don't set an image _and_ a text. I deleted the previously set image with setImage(null). Please provide a snippet that shows the problem. Created attachment 79735 [details]
Testcase
Launch the application and click the button three times:
Under Linux, "1. Text", then the image, then "3. Text" is displayed
Under Windows, "1. Text", then the image, then nothing is displayed
I use Ubuntu Feisty (7.04) which means gtk-2.10, swt 3.3 and java6.
Any news about this issue? Why? What's the problem with adding it to 3.3.2? AM, the gtk behaviour is correct, please fix on win32 and cocoa. (In reply to Grant Gayed from comment #9) > AM, the gtk behaviour is correct, please fix on win32 and cocoa. Moving to Windows. New Gerrit change created: https://git.eclipse.org/r/143312 Created attachment 278823 [details]
setImage(null) for GTK and Windows before and after change
Label need to set some static control styles when swapping between text and image rendering but fails in some cases e.g. when setting image to null or resetting same text after image was set.
I attached an image to show the results from different orders of setText/setImage for GTK, Win32 before and after change. From left to right:
1. setText
2. setImage
3. setText -> setImage
4. setImage -> setText
5. setText -> setImage -> setText
6. setImage -> setText -> setImage
7. setText -> setImage -> setImage(null)
The Snippet to create this screenshot is included in the change.
New Gerrit change created: https://git.eclipse.org/r/143313 Thanks for the fix Paul. We are currently wrapping up the 4.12 so development is frozen. When master reopens (should happen next week or week after, at the latest) your patches will be reviewed/merged. The API itself is broken. Either Text and Image should be exclusive (only one non-null at a time), or Image should act as an override (then setText effect is not visible, until Image is removed). As it stands, visual state of the label can't be derived from its properties alone, which is nonsense. Forgot to add: if we fix Image property to be a proper override (i.e. setText doesn't show text as long as Image is present), then Text can be reused as an accessible description of the image label. Gerrit change https://git.eclipse.org/r/143312 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1ebd136999348eaf6d9839b9b54ef7383ee04db4 This is not yet fixed on Cocoa, will clone this bug for Cocoa. (In reply to Lakshmi Shanmugam from comment #18) > This is not yet fixed on Cocoa, will clone this bug for Cocoa. Done by Bug 548736. Verified with I20190710-0610 |