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 6d990c8c6a..591facfa44 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2025 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -336,16 +336,13 @@ Rectangle getBoundsinPixels () { rect.width = w [0]; int horizontalSeparator; + int[] buffer = new int[1]; if (GTK.GTK4) { - long separator = GTK.gtk_separator_new(GTK.GTK_ORIENTATION_HORIZONTAL); - GtkAllocation allocation = new GtkAllocation (); - GTK.gtk_widget_get_allocation(separator, allocation); - horizontalSeparator = allocation.height; + GTK.gtk_cell_renderer_get_padding(textRenderer, buffer, null); } else { - int[] buffer = new int[1]; GTK3.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - horizontalSeparator = buffer[0]; } + horizontalSeparator = buffer[0]; rect.x += horizontalSeparator; gtk_tree_view_column_cell_get_position (column, textRenderer, x, null); @@ -769,16 +766,13 @@ public Rectangle getTextBounds (int index) { parent.ignoreSize = false; int horizontalSeparator; + int[] buffer = new int[1]; if (GTK.GTK4) { - long separator = GTK.gtk_separator_new(GTK.GTK_ORIENTATION_HORIZONTAL); - GtkAllocation allocation = new GtkAllocation (); - GTK.gtk_widget_get_allocation(separator, allocation); - horizontalSeparator = allocation.height; + GTK.gtk_cell_renderer_get_padding(textRenderer, buffer, null); } else { - int[] buffer = new int[1]; GTK3.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - horizontalSeparator = buffer[0]; } + horizontalSeparator = buffer[0]; rect.x += horizontalSeparator; gtk_tree_view_column_cell_get_position (column, textRenderer, x, null); 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 5879b0b68b..65c7136b33 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 @@ -481,14 +481,11 @@ public Rectangle getBounds () { int horizontalSeparator; if (GTK.GTK4) { - long separator = GTK.gtk_separator_new(GTK.GTK_ORIENTATION_HORIZONTAL); - GtkAllocation allocation = new GtkAllocation (); - GTK.gtk_widget_get_allocation(separator, allocation); - horizontalSeparator = allocation.height; + GTK.gtk_cell_renderer_get_padding(textRenderer, buffer, null); } else { GTK3.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - horizontalSeparator = buffer[0]; } + horizontalSeparator = buffer[0]; rect.x += horizontalSeparator; gtk_tree_view_column_cell_get_position (column, textRenderer, x, null); @@ -948,14 +945,11 @@ public Rectangle getTextBounds (int index) { int horizontalSeparator; if (GTK.GTK4) { - long separator = GTK.gtk_separator_new(GTK.GTK_ORIENTATION_HORIZONTAL); - GtkAllocation allocation = new GtkAllocation (); - GTK.gtk_widget_get_allocation(separator, allocation); - horizontalSeparator = allocation.height; + GTK.gtk_cell_renderer_get_padding(textRenderer, buffer, null); } else { GTK3.gtk_widget_style_get (parentHandle, OS.horizontal_separator, buffer, 0); - horizontalSeparator = buffer[0]; } + horizontalSeparator = buffer[0]; rect.x += horizontalSeparator; gtk_tree_view_column_cell_get_position (column, textRenderer, x, null); /*