diff options
author | Alexander Kurtakov <akurtako@redhat.com> | 2013-07-13 10:44:23 +0300 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2013-07-13 10:44:23 +0300 |
commit | 5d74999766f9e86d70ddcdddef0aa7477038ff84 (patch) | |
tree | 3dc1afc13d91ea7bb505429d9d196a34d130b88d /bundles | |
parent | dd2aca966bc039ce9a2eb77aaa5738d3e28bb872 (diff) | |
download | eclipse.platform.swt-5d74999766f9e86d70ddcdddef0aa7477038ff84.tar.gz eclipse.platform.swt-5d74999766f9e86d70ddcdddef0aa7477038ff84.tar.xz eclipse.platform.swt-5d74999766f9e86d70ddcdddef0aa7477038ff84.zip |
Remove hacks for GtkTree from pre Gtk 2.10.
Diffstat (limited to 'bundles')
5 files changed, 0 insertions, 350 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index cbaabb6fa1..3d260e275f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -1480,23 +1480,6 @@ public void setTopIndex (int index) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0, 0); - if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { - /* - * Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell - * should vertically scroll the cell to the top if use_align is true and row_align is 0. - * However, prior to version 2.8 it does not scroll at all. The fix is to determine - * the new location and use gtk_tree_view_scroll_to_point. - * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point - * will have no effect. Therefore, it is still neccessary to call - * gtk_tree_view_scroll_to_cell. - */ - OS.gtk_widget_realize (handle); - GdkRectangle cellRect = new GdkRectangle (); - OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); - int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); - OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); - } OS.gtk_tree_path_free (path); OS.g_free (iter); } 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 2a8d1e5c7f..739e271191 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 @@ -3426,23 +3426,6 @@ public void setTopIndex (int index) { if (!(0 <= index && index < itemCount)) return; long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, _getItem (index).handle); OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f); - if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { - /* - * Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell - * should vertically scroll the cell to the top if use_align is true and row_align is 0. - * However, prior to version 2.8 it does not scroll at all. The fix is to determine - * the new location and use gtk_tree_view_scroll_to_point. - * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point - * will have no effect. Therefore, it is still neccessary to call - * gtk_tree_view_scroll_to_cell. - */ - OS.gtk_widget_realize (handle); - GdkRectangle cellRect = new GdkRectangle (); - OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); - int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); - OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); - } OS.gtk_tree_path_free (path); } 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 39ac93ffbf..bcc009b028 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 @@ -221,16 +221,6 @@ void clear () { for (int i=Table.FOREGROUND_COLUMN; i<columnCount; i++) { OS.gtk_list_store_set (parent.modelHandle, handle, i, (long /*int*/)0, -1); } - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } } cached = false; font = null; @@ -700,22 +690,6 @@ public Rectangle getTextBounds (int index) { return new Rectangle (rect.x, rect.y, width, rect.height + 1); } -void redraw () { - if (gtk_widget_get_realized (parent.handle)) { - long /*int*/ parentHandle = parent.handle; - long /*int*/ path = OS.gtk_tree_model_get_path (parent.modelHandle, handle); - GdkRectangle rect = new GdkRectangle (); - OS.gtk_tree_view_get_cell_area (parentHandle, path, 0, rect); - OS.gtk_tree_path_free (path); - long /*int*/ window = OS.gtk_tree_view_get_bin_window (parentHandle); - rect.x = 0; - int [] w = new int [1], h = new int [1]; - gdk_window_get_size (window, w, h); - rect.width = w [0]; - OS.gdk_window_invalidate_rect (window, rect, false); - } -} - void releaseHandle () { if (handle != 0) OS.g_free (handle); handle = 0; @@ -754,16 +728,6 @@ public void setBackground (Color color) { if (_getBackground ().equals (color)) return; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_list_store_set (parent.modelHandle, handle, Table.BACKGROUND_COLUMN, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -796,16 +760,6 @@ public void setBackground (int index, Color color) { int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_BACKGROUND, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (color != null) { @@ -887,16 +841,6 @@ public void setFont (Font font){ if (oldFont != null && oldFont.equals (font)) return; long /*int*/ fontHandle = font != null ? font.handle : 0; OS.gtk_list_store_set (parent.modelHandle, handle, Table.FONT_COLUMN, fontHandle, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -938,16 +882,6 @@ public void setFont (int index, Font font) { int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; long /*int*/ fontHandle = font != null ? font.handle : 0; OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_FONT, fontHandle, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (font != null) { @@ -1001,16 +935,6 @@ public void setForeground (Color color){ if (_getForeground ().equals (color)) return; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_list_store_set (parent.modelHandle, handle, Table.FOREGROUND_COLUMN, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -1043,16 +967,6 @@ public void setForeground (int index, Color color){ int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_FOREGROUND, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (color != null) { @@ -1142,16 +1056,6 @@ public void setImage (int index, Image image) { int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_PIXBUF, pixbuf, -1); /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } - /* * Bug in GTK. When in fixed height mode, GTK does not recalculate the cell renderer width * when the image is changed in the model. The fix is to force it to recalculate the width if * more space is required. @@ -1249,16 +1153,6 @@ public void setText (int index, String string) { byte[] buffer = Converter.wcsToMbcs (null, string, true); int modelIndex = parent.columnCount == 0 ? Table.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_list_store_set (parent.modelHandle, handle, modelIndex + Table.CELL_TEXT, buffer, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index fff697991f..beec23ac4f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -1443,14 +1443,8 @@ public TreeItem getItem (Point point) { if (OS.gtk_tree_model_get_iter (modelHandle, iter, path [0])) { boolean overExpander = false; if (OS.gtk_tree_view_get_expander_column (handle) == columnHandle [0]) { - int [] buffer = new int [1]; GdkRectangle rect = new GdkRectangle (); OS.gtk_tree_view_get_cell_area (handle, path [0], columnHandle [0], rect); - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18)) { - OS.gtk_widget_style_get (handle, OS.expander_size, buffer, 0); - int expanderSize = buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - rect.x += expanderSize; - } if ((style & SWT.MIRRORED) != 0) { overExpander = x > rect.x + rect.width; } else { @@ -2676,15 +2670,6 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, rect); OS.gtk_tree_view_get_background_area (handle, path, columnHandle, clipRect); OS.gtk_tree_path_free (path); - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (handle) == columnHandle) { - int [] buffer = new int [1]; - OS.gtk_widget_style_get (handle, OS.expander_size, buffer, 0); - rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - rect.width -= buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - //OS.gtk_widget_style_get (handle, OS.horizontal_separator, buffer, 0); - //rect.x += buffer[0]; - //rect.width -= buffer [0]; // TODO Is this required for some versions? - } ignoreSize = true; int [] contentX = new int [1], contentWidth = new int [1]; gtk_cell_renderer_get_preferred_size (cell, handle, contentWidth, null); @@ -3253,23 +3238,6 @@ public void setTopItem (TreeItem item) { long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, item.handle); showItem (path, false); OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f); - if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { - /* - * Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell - * should vertically scroll the cell to the top if use_align is true and row_align is 0. - * However, prior to version 2.8 it does not scroll at all. The fix is to determine - * the new location and use gtk_tree_view_scroll_to_point. - * If the widget is a pinhead, calling gtk_tree_view_scroll_to_point - * will have no effect. Therefore, it is still neccessary to call - * gtk_tree_view_scroll_to_cell. - */ - OS.gtk_widget_realize (handle); - GdkRectangle cellRect = new GdkRectangle (); - OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); - int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); - OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); - } OS.gtk_tree_path_free (path); } 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 b630d19caa..08e28b2fd6 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 @@ -302,16 +302,6 @@ void clear () { for (int i=Tree.FOREGROUND_COLUMN; i<columnCount; i++) { OS.gtk_tree_store_set (parent.modelHandle, handle, i, (long /*int*/)0, -1); } - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } } cached = false; font = null; @@ -446,26 +436,6 @@ public Rectangle getBounds (int index) { OS.gtk_tree_view_get_cell_area (parentHandle, path, column, rect); if ((parent.getStyle () & SWT.MIRRORED) != 0) rect.x = parent.getClientWidth () - rect.width - rect.x; - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) == column) { - int [] buffer = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0); - rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - rect.width -= buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - OS.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - rect.x += buffer [0]; - //rect.width -= buffer [0]; // TODO Is this required for some versions? - } - /* - * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even - * when the widget is mirrored. The fix is to sum up the indentation - * of the expanders. - */ - if ((parent.getStyle () & SWT.MIRRORED) != 0 && (OS.GTK_VERSION < OS.VERSION (2, 10, 0))) { - int depth = OS.gtk_tree_path_get_depth (path); - int [] expanderSize = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, expanderSize, 0); - rect.x += depth * (expanderSize[0] + TreeItem.EXPANDER_EXTRA_PADDING); - } OS.gtk_tree_path_free (path); if (index == 0 && (parent.style & SWT.CHECK) != 0) { @@ -519,21 +489,6 @@ public Rectangle getBounds () { parent.ignoreSize = false; rect.width = w [0]; int [] buffer = new int [1]; - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) == column) { - OS.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0); - rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - } - /* - * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even - * when the widget is mirrored. The fix is to sum up the indentation - * of the expanders. - */ - if ((parent.getStyle () & SWT.MIRRORED) != 0 && (OS.GTK_VERSION < OS.VERSION (2, 10, 0))) { - int depth = OS.gtk_tree_path_get_depth (path); - int [] expanderSize = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, expanderSize, 0); - rect.x += depth * (expanderSize[0] + TreeItem.EXPANDER_EXTRA_PADDING); - } OS.gtk_tree_path_free (path); OS.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); @@ -752,26 +707,6 @@ public Rectangle getImageBounds (int index) { OS.gtk_widget_realize (parentHandle); OS.gtk_tree_view_get_cell_area (parentHandle, path, column, rect); if ((parent.getStyle () & SWT.MIRRORED) != 0) rect.x = parent.getClientWidth () - rect.width - rect.x; - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) == column) { - int [] buffer = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0); - rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - rect.width -= buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - //OS.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - //int horizontalSeparator = buffer[0]; - //rect.x += horizontalSeparator; - } - /* - * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even - * when the widget is mirrored. The fix is to sum up the indentation - * of the expanders. - */ - if ((parent.getStyle () & SWT.MIRRORED) != 0 && (OS.GTK_VERSION < OS.VERSION (2, 10, 0))) { - int depth = OS.gtk_tree_path_get_depth (path); - int [] expanderSize = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, expanderSize, 0); - rect.x += depth * (expanderSize[0] + TreeItem.EXPANDER_EXTRA_PADDING); - } OS.gtk_tree_path_free (path); int [] x = new int [1], w = new int[1]; @@ -975,21 +910,6 @@ public Rectangle getTextBounds (int index) { gtk_cell_renderer_get_preferred_size (textRenderer, parentHandle, w, null); parent.ignoreSize = false; int [] buffer = new int [1]; - if (OS.GTK_VERSION < OS.VERSION (2, 8, 18) && OS.gtk_tree_view_get_expander_column (parentHandle) == column) { - OS.gtk_widget_style_get (parentHandle, OS.expander_size, buffer, 0); - rect.x += buffer [0] + TreeItem.EXPANDER_EXTRA_PADDING; - } - /* - * Bug in GTK. In GTK 2.8.x, the cell area is left aligned even - * when the widget is mirrored. The fix is to sum up the indentation - * of the expanders. - */ - if ((parent.getStyle () & SWT.MIRRORED) != 0 && (OS.GTK_VERSION < OS.VERSION (2, 10, 0))) { - int depth = OS.gtk_tree_path_get_depth (path); - int [] expanderSize = new int [1]; - OS.gtk_widget_style_get (parentHandle, OS.expander_size, expanderSize, 0); - rect.x += depth * (expanderSize[0] + TreeItem.EXPANDER_EXTRA_PADDING); - } OS.gtk_tree_path_free (path); OS.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); @@ -1054,22 +974,6 @@ public int indexOf (TreeItem item) { return index; } -void redraw () { - long /*int*/ parentHandle = parent.handle; - if (gtk_widget_get_realized (parentHandle)) { - long /*int*/ path = OS.gtk_tree_model_get_path (parent.modelHandle, handle); - GdkRectangle rect = new GdkRectangle (); - OS.gtk_tree_view_get_cell_area (parentHandle, path, 0, rect); - OS.gtk_tree_path_free (path); - long /*int*/ window = OS.gtk_tree_view_get_bin_window (parentHandle); - rect.x = 0; - int [] w = new int [1], h = new int [1]; - gdk_window_get_size (window, w, h); - rect.width = w [0]; - OS.gdk_window_invalidate_rect (window, rect, false); - } -} - void releaseChildren (boolean destroy) { if (destroy) { parent.releaseItems (handle); @@ -1156,16 +1060,6 @@ public void setBackground (Color color) { if (_getBackground ().equals (color)) return; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_tree_store_set (parent.modelHandle, handle, Tree.BACKGROUND_COLUMN, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -1199,16 +1093,6 @@ public void setBackground (int index, Color color) { int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_BACKGROUND, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (color != null) { @@ -1320,16 +1204,6 @@ public void setFont (Font font){ if (oldFont != null && oldFont.equals (font)) return; long /*int*/ fontHandle = font != null ? font.handle : 0; OS.gtk_tree_store_set (parent.modelHandle, handle, Tree.FONT_COLUMN, fontHandle, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -1371,16 +1245,6 @@ public void setFont (int index, Font font) { int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; long /*int*/ fontHandle = font != null ? font.handle : 0; OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_FONT, fontHandle, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (font != null) { @@ -1435,16 +1299,6 @@ public void setForeground (Color color){ if (_getForeground ().equals (color)) return; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_tree_store_set (parent.modelHandle, handle, Tree.FOREGROUND_COLUMN, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } @@ -1478,16 +1332,6 @@ public void setForeground (int index, Color color){ int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; GdkColor gdkColor = color != null ? color.handle : null; OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_FOREGROUND, gdkColor, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when it is cleared. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; if (color != null) { @@ -1579,18 +1423,6 @@ public void setImage (int index, Image image) { int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_PIXBUF, pixbuf, -1); /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when the image changes. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - if (parent.columnCount == 0) { - redraw (); - } - } - } - /* * Bug in GTK. When using fixed-height-mode, GTK does not recalculate the cell renderer width * when the image is changed in the model. The fix is to force it to recalculate the width if * more space is required. @@ -1690,16 +1522,6 @@ public void setText (int index, String string) { byte[] buffer = Converter.wcsToMbcs (null, string, true); int modelIndex = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; OS.gtk_tree_store_set (parent.modelHandle, handle, modelIndex + Tree.CELL_TEXT, buffer, -1); - /* - * Bug in GTK. When using fixed-height-mode, - * row changes do not cause the row to be repainted. The fix is to - * invalidate the row when the text changes. - */ - if ((parent.style & SWT.VIRTUAL) != 0) { - if (OS.GTK_VERSION < OS.VERSION (2, 6, 3)) { - redraw (); - } - } cached = true; } |