Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-01-09 19:35:26 +0000
committerAndrey Loskutov2018-01-10 08:47:31 +0000
commit4d3e9a159f1a3b267d2c2a7bac7b84f67a51f26b (patch)
tree460e0650b7b769b5b3b64d07afabc46359370e01
parent2a77f729c852f703fea77d9c38322bafb65efae3 (diff)
downloadeclipse.platform.swt-4d3e9a159f1a3b267d2c2a7bac7b84f67a51f26b.tar.gz
eclipse.platform.swt-4d3e9a159f1a3b267d2c2a7bac7b84f67a51f26b.tar.xz
eclipse.platform.swt-4d3e9a159f1a3b267d2c2a7bac7b84f67a51f26b.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 08291661c0..dc1ff6f288 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 9070e3dd80..c13e64d537 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
@@ -38,7 +38,6 @@ public class TableItem extends Item {
Font font;
Font[] cellFont;
boolean cached, grayed;
- int columnSetHeight, columnSetWidth;
/**
* Constructs a new instance of this class given its parent
@@ -1174,9 +1173,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 {
@@ -1186,8 +1185,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 0bd2e4b9d3..a3e0e8721f 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
@@ -40,7 +40,6 @@ public class TreeItem extends Item {
Font[] cellFont;
boolean cached, grayed, isExpanded;
static final int EXPANDER_EXTRA_PADDING = 4;
- int columnSetHeight, columnSetWidth;
/**
* Constructs a new instance of this class given its parent
@@ -1528,8 +1527,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;
/*
@@ -1558,8 +1555,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