Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 265960 Details for
Bug 509455
[GTK3] The size of label with wrapping text is computed incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
label.patch (text/plain), 1.48 KB, created by
Mikhail Gaykovoy
on 2016-12-20 00:19:14 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Mikhail Gaykovoy
Created:
2016-12-20 00:19:14 EST
Size:
1.48 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java >index 14b1f75..94fd312 100644 >--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java >+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java >@@ -136,14 +136,21 @@ Point computeSizeInPixels (int wHint, int hHint, boolean changed) { > if (fixWrap) { > long /*int*/ labelLayout = OS.gtk_label_get_layout (labelHandle); > int pangoWidth = OS.pango_layout_get_width (labelLayout); >+ GtkBorder padding = new GtkBorder (); >+ if (OS.GTK3) { >+ long /*int*/ styleContext = OS.gtk_widget_get_style_context (labelHandle); >+ OS.gtk_style_context_get_padding (styleContext, OS.GTK_STATE_FLAG_NORMAL, padding); >+ } > if (wHint != SWT.DEFAULT) { >- OS.pango_layout_set_width (labelLayout, wHint * OS.PANGO_SCALE); >+ OS.pango_layout_set_width (labelLayout, Math.max(0, wHint - padding.left - padding.right) * OS.PANGO_SCALE); > } else { > OS.pango_layout_set_width (labelLayout, -1); > } > int [] w = new int [1], h = new int [1]; > OS.pango_layout_get_pixel_size (labelLayout, w, h); > OS.pango_layout_set_width (labelLayout, pangoWidth); >+ w [0] += padding.left + padding.right; >+ h [0] += padding.top + padding.bottom; > if (frameHandle != 0) { > int [] labelWidth = new int [1], labelHeight = new int [1]; > OS.gtk_widget_get_size_request (labelHandle, labelWidth, labelHeight);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 509455
:
265944
| 265960