Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-01-09 14:35:26 -0500
committerEric Williams2018-01-09 15:26:26 -0500
commit458bdeadd04cc1a45cff6a7f661fe5d0279fb6fb (patch)
treeb47bd87cf0c6147c6d23d11bb16c0c0573ff9dae
parent0ff1442114227cd62ce9ee86013cea0b715c18e8 (diff)
downloadeclipse.platform.swt-458bdeadd04cc1a45cff6a7f661fe5d0279fb6fb.tar.gz
eclipse.platform.swt-458bdeadd04cc1a45cff6a7f661fe5d0279fb6fb.tar.xz
eclipse.platform.swt-458bdeadd04cc1a45cff6a7f661fe5d0279fb6fb.zip
Bug 519295: [GTK3] Invisible settings button in validation preferences
Instead of setting the image dimensions for each column, set them in the parent and use those dimensions for every column. Every image renderer should be the same size anyways, regardless of column -- the size is determined by the dimensions of the first image set. The bug was caused by parent.pixbufSizeSet being true, but the column renderers being size 0x0. The renderers in the third column never got sized because the column renderer size was never set. Funnily enough the ability to check for this was added in Tree but never implemented. Both Table and Tree have been fixed now. Change-Id: Ibad077cb4de21071bb22b75446881d63da0590e0 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java7
3 files changed, 7 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 5b6728bd60..0d427ae8d4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -89,7 +89,7 @@ public class Table extends Composite {
int maxWidth = 0;
int topIndex;
double cachedAdjustment, currentAdjustment;
-
+ int pixbufHeight, pixbufWidth;
static final int CHECKED_COLUMN = 0;
static final int GRAYED_COLUMN = 1;
static final int FOREGROUND_COLUMN = 2;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 1853caac6b..cd07ab446a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -39,7 +39,6 @@ public class TableItem extends Item {
Font[] cellFont;
String [] strings;
boolean cached, grayed;
- int columnSetHeight, columnSetWidth;
/**
* Constructs a new instance of this class given its parent
@@ -1231,9 +1230,9 @@ public void setImage (int index, Image image) {
int iHeight = image.getBoundsInPixels ().height;
if (iWidth > currentWidth [0] || iHeight > currentHeight [0]) {
OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, iWidth, iHeight);
+ parent.pixbufHeight = iHeight;
+ parent.pixbufWidth = iWidth;
parent.pixbufSizeSet = true;
- columnSetHeight = iHeight;
- columnSetWidth = iWidth;
}
}
} else {
@@ -1243,8 +1242,8 @@ public void setImage (int index, Image image) {
* Bug 489025: There is a corner case where the below is triggered when current(Width|Height) is -1,
* which results in icons being set to 0. Fix is to compare only positive sizes.
*/
- if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
- OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
+ if (parent.pixbufWidth > Math.max(currentWidth [0], 0) || parent.pixbufHeight > Math.max(currentHeight [0], 0)) {
+ OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, parent.pixbufWidth, parent.pixbufHeight);
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index ffc90ae789..51ea62b3ee 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -41,7 +41,6 @@ public class TreeItem extends Item {
String [] strings;
boolean cached, grayed, isExpanded;
static final int EXPANDER_EXTRA_PADDING = 4;
- int columnSetHeight, columnSetWidth;
/**
* Constructs a new instance of this class given its parent
@@ -1586,8 +1585,6 @@ public void setImage (int index, Image image) {
if (iWidth > currentWidth [0] || iHeight > currentHeight [0]) {
OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, iWidth, iHeight);
parent.pixbufSizeSet = true;
- columnSetHeight = iHeight;
- columnSetWidth = iWidth;
parent.pixbufHeight = iHeight;
parent.pixbufWidth = iWidth;
/*
@@ -1616,8 +1613,8 @@ public void setImage (int index, Image image) {
* Bug 489025: There is a corner case where the below is triggered when current(Width|Height) is -1,
* which results in icons being set to 0. Fix is to compare only positive sizes.
*/
- if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
- OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
+ if (parent.pixbufWidth > Math.max(currentWidth [0], 0) || parent.pixbufHeight > Math.max(currentHeight [0], 0)) {
+ OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, parent.pixbufWidth, parent.pixbufHeight);
}
}
}

Back to the top