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

Bug 518080

Summary: Use GtkSearchEntry instead of gtkEntry + icon
Product: [Eclipse Project] Platform Reporter: Leo Ufimtsev <lufimtse>
Component: SWTAssignee: Xi Yan <xixiyan>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: arunkumar.thondapu, ericwill
Version: 4.7Keywords: triaged
Target Milestone: 4.10 RC1   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517508
https://git.eclipse.org/r/132792
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d53c584eda3df3e021b22226a63edc7cdb3e65c3
https://git.eclipse.org/r/133079
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a8531a3bcd42ce3a5ebb0b797c646ca9487f3413
Whiteboard:

Description Leo Ufimtsev CLA 2017-06-09 14:44:11 EDT
When creating Text() and specify style SWT.SEARCH, a search scope icon and 'delete' text icon are added to the entry. See snippet 309 or linked bug.

At the moment we create an entry and add icons to it, and manually dispose icons etc. It would be better to use the new GtkSearchEntry widget as it was designed specifically for this purpose:
https://developer.gnome.org/gtk3/stable/GtkSearchEntry.html#GtkSearchEntry-stop-search

One advantage is that the delete button is only when there's actual content in the search box.

Notes:
- It might require some version guards, as  it were implemented around gtk 3.6
- Clicking on search icon and delete icon should be distinguishable in the event details.
Comment 1 Leo Ufimtsev CLA 2017-06-09 14:46:41 EDT
As note, gtk3-demo has a snippet to illustrate GtkSearchEntry. (Entry -> GtkSearchEntry).
Comment 2 Alexander Kurtakov CLA 2017-06-09 15:04:38 EDT
Maybe we can keep it for when we move to 3.6+ as min version for SWT.
Comment 3 Eclipse Genie CLA 2018-11-20 15:16:45 EST
New Gerrit change created: https://git.eclipse.org/r/132792
Comment 5 Eric Williams CLA 2018-11-23 15:24:50 EST
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/132792 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=d53c584eda3df3e021b22226a63edc7cdb3e65c3

In master now, thanks a bunch Xi!
Comment 6 Eclipse Genie CLA 2018-11-26 12:17:12 EST
New Gerrit change created: https://git.eclipse.org/r/133079
Comment 8 Xi Yan CLA 2018-11-28 09:58:14 EST
Verified in I20181128-0130.