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

Bug 487522

Summary: [GTK3.20] Entries/Text widgets have smaller heights
Product: [Eclipse Project] Platform Reporter: Eric Williams <ericwill>
Component: SWTAssignee: Eric Williams <ericwill>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nobody, peter
Version: 4.6   
Target Milestone: 4.7.2   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/67350
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102
https://git.eclipse.org/r/67360
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8a370a563c18a63d7de19922c28261623b74f8b3
https://git.eclipse.org/r/67361
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=991352091018ac80965024c1500104d29f23e7f8
https://git.eclipse.org/r/110038
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=06c8813f7326155289469803c378321127e0982c
https://git.eclipse.org/r/110046
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=9e64d9d1913a4def07f05ad2eebc45d6f5190c73
Whiteboard:
Bug Depends on:    
Bug Blocks: 474628    
Attachments:
Description Flags
Quick Access entry too small
none
eclipse Oxygen.1 (4.7.1)
none
tar archive with gtk3 theme none

Description Eric Williams CLA 2016-02-09 11:31:50 EST
Created attachment 259669 [details]
Quick Access entry too small

On GTK3.19/3.20, text entries have smaller heights, making them look cramped and broken. This is more noticeable with the "Quick Access" entry found in the workbench.

Attached is a screenshot that shows the issue. The entry on GTK3.19/3.20 is 11px smaller than on GTK3.18 and below.
Comment 1 Eric Williams CLA 2016-02-16 15:38:37 EST
The issue seems to be caused by gtk_style_context_get_padding() not returning the proper amount of padding. For example on GTK3.19 it returns 0, but returns 11 on GTK3.18 and below. Replacing this call with a call to Control.computeNativeSize() for height calculations returns the correct number.

To do: investigate other widgets using gtk_style_context_get_padding() to ensure nothing else is breaking.
Comment 2 Eclipse Genie CLA 2016-02-25 12:01:51 EST
New Gerrit change created: https://git.eclipse.org/r/67350
Comment 4 Eric Williams CLA 2016-02-25 14:12:35 EST
(In reply to Eclipse Genie from comment #3)
> Gerrit change https://git.eclipse.org/r/67350 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=4f73bb5f5e4e14e1dc578b1f6ffb0befc8181102

In master now.
Comment 5 Eclipse Genie CLA 2016-02-25 14:33:04 EST
New Gerrit change created: https://git.eclipse.org/r/67360
Comment 7 Eclipse Genie CLA 2016-02-25 14:36:40 EST
New Gerrit change created: https://git.eclipse.org/r/67361
Comment 9 Eric Williams CLA 2016-02-25 14:40:37 EST
Sorry for the Bugzilla spam, I had to revert due to a typo. I accidentally copy and pasted "=" instead of "+=". All fixed now.
Comment 10 Nobody - feel free to take it CLA 2017-10-09 15:32:22 EDT
I don't found another bug about text entry, so i write here.

$ rpm -q gtk3
gtk3-3.22.17-1.x86_64


> gtk_style_context_get_padding() no longer returns correct values for GtkEntry widgets.

Maybe better, check padding values at first?

By default, Adwaita theme not set padding value for text entry.
But another theme – may have. As result, no way reduce or enlarge height text entry with theme.

In my gtk3 theme text entry have padding:

> padding: 4px 5px;

In all programs text entry displayed correctly(height 34px - gedit, tweak tool and other),
but in eclipse is a bit more (height 38px).


I think, better check padding values:

if (tmp.top > 0 && tmp.bottom > 0)

instead of

if (OS.GTK_VERSION >= OS.VERSION (3, 20, 0))


here
http://git.eclipse.org/c/gerrit/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Text.java?h=R4_7_maintenance#n623
Comment 11 Nobody - feel free to take it CLA 2017-10-09 15:38:28 EDT
Created attachment 270895 [details]
eclipse Oxygen.1 (4.7.1)
Comment 12 Eric Williams CLA 2017-10-10 10:43:45 EDT
(In reply to Alien Huker from comment #10)
> I don't found another bug about text entry, so i write here.
> 
> $ rpm -q gtk3
> gtk3-3.22.17-1.x86_64
> 
> 
> > gtk_style_context_get_padding() no longer returns correct values for GtkEntry widgets.
> 
> Maybe better, check padding values at first?
> 
> By default, Adwaita theme not set padding value for text entry.
> But another theme – may have. As result, no way reduce or enlarge height
> text entry with theme.
> 
> In my gtk3 theme text entry have padding:
> 
> > padding: 4px 5px;
> 
> In all programs text entry displayed correctly(height 34px - gedit, tweak
> tool and other),
> but in eclipse is a bit more (height 38px).
> 
> 
> I think, better check padding values:
> 
> if (tmp.top > 0 && tmp.bottom > 0)
> 
> instead of
> 
> if (OS.GTK_VERSION >= OS.VERSION (3, 20, 0))
> 
> 
> here
> http://git.eclipse.org/c/gerrit/platform/eclipse.platform.swt.git/tree/
> bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Text.
> java?h=R4_7_maintenance#n623

What theme do you use? It will help me investigate a fix.
Comment 13 Nobody - feel free to take it CLA 2017-10-10 12:19:47 EDT
Created attachment 270911 [details]
tar archive with gtk3 theme

$ cd ~/.themes
$ tar -xf test1.tar.xz
$ gsettings set org.gnome.desktop.interface gtk-theme "test1"
Comment 14 Nobody - feel free to take it CLA 2017-10-10 12:21:18 EDT
Maybe "min-height" property is not counted?
Comment 15 Nobody - feel free to take it CLA 2017-10-12 18:17:41 EDT
> Point widthNative = computeNativeSize(handle, trim.width, SWT.DEFAULT, true);

It possible take here min-height and than put
> trim.height += tmp.top + tmp.bottom;

?

This is will solve my problem.
Comment 16 Eric Williams CLA 2017-10-13 08:33:51 EDT
I will take a look at this today.
Comment 17 Eclipse Genie CLA 2017-10-13 09:33:12 EDT
New Gerrit change created: https://git.eclipse.org/r/110038
Comment 19 Eric Williams CLA 2017-10-13 09:52:50 EDT
(In reply to Eclipse Genie from comment #18)
> Gerrit change https://git.eclipse.org/r/110038 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=06c8813f7326155289469803c378321127e0982c

The change has been merged into master. Thanks for your help!

If you'd like, I can also backport the change into Oxygen (4.7).
Comment 20 Nobody - feel free to take it CLA 2017-10-13 09:57:02 EDT
Thanks:)

> If you'd like, I can also backport the change into Oxygen (4.7).

Yes, please.
Comment 21 Eclipse Genie CLA 2017-10-13 09:59:41 EDT
New Gerrit change created: https://git.eclipse.org/r/110046
Comment 23 Eric Williams CLA 2017-10-13 10:18:19 EDT
(In reply to Eclipse Genie from comment #22)
> Gerrit change https://git.eclipse.org/r/110046 was merged to
> [R4_7_maintenance].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=9e64d9d1913a4def07f05ad2eebc45d6f5190c73

Backport complete. The fix will land in the Oxygen.2 release.