[Win32] Table: first row partly hidden behind header
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Run the provided Java reproduction on Windows and trace the SWT Table behavior involved in changing from multiple virtual rows to a single selected row. The issue does not name implementation files or tests, so first locate the Win32 Table code and related tests. Done means the single item is fully visible below the header after selecting “Second.”
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
It might happen that setting an owner-drawn table a single item it will not become fully visible, hidden behind the table header, though the table is large enough to show it.
To Reproduce
import java.util.ArrayList;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class SingleTableItemBehindHeader {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout(SWT.HORIZONTAL));
final List list = new List(shell, SWT.BORDER);
list.setItems("First", "Second");
final java.util.List<String> rows = new ArrayList<>();
final Table table = new Table(shell, SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setHeaderVisible(true);
final TableColumn column = new TableColumn(table, SWT.LEFT);
column.setText("Column");
column.setWidth(350);
table.addListener(SWT.SetData, event -> {
final TableItem tableItem = (TableItem)event.item;
tableItem.setData(rows.get(event.index));
});
final Listener listener = event -> {
switch (event.type) {
case SWT.MeasureItem -> {
final String text = (String)event.item.getData();
final Point size = event.gc.stringExtent(text);
event.width = size.x + 4;
event.height = size.y + 4;
}
case SWT.PaintItem -> {
final String text = (String)event.item.getData();
event.gc.drawString(text, event.x + 2, event.y + 2, true);
}
}
};
table.addListener(SWT.MeasureItem, listener);
table.addListener(SWT.PaintItem, listener);
list.addListener(SWT.Selection, event -> {
final int index = list.getSelectionIndex();
switch (index) {
case 0 -> {
setTableRows(java.util.List.of("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"), rows, table);
table.setSelection(11);
}
case 1 -> {
setTableRows(java.util.List.of("11"), rows, table);
table.deselectAll();
table.select(new int[] {0});
}
default -> {
setTableRows(java.util.List.of(), rows, table);
}
}
});
shell.setSize(600, 200);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void setTableRows(java.util.List<String> values, java.util.List<String> rows, Table table) {
rows.clear();
rows.addAll(values);
table.setItemCount(rows.size());
table.clearAll();
}
}
- run this snippet
- select the "First" row on the left; this will fill the table on the right and select its last item
- select the "Second" row on the left; this will set the table on the right a single item and select it; but this single item it partly hidden behind the header
Expected behavior
After selecting "Second", the first table item should be fully visible
Environment:
- Select the platform(s) on which the behavior is seen:
-
- All OS
-
- Windows
-
- Linux
-
- macOS
- Additional OS info (e.g. OS version, Linux Desktop, etc)
Windows 11 25H2
Workaround
None
- Lenguaje dominante
- Java
- Estrellas
- 202
- Forks
- 206
- Merge medio
- 20 h 20 min
- PR fusionados (30 d)
- 113
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eclipse-platform/eclipse.platform.swt
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`Posiblemente ocupada @GreenFuze la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.swt
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
netshot-net/Netshot#413 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
scylladb/scylla-cdc-source-connector#350 ·
Los mantenedores suelen responder en 1 día
-
agent:working documentation enhancement go:build lane:needs-decision
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Sanne/incus-spawn#1435 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
area:shuffle bug priority:high requires-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/datafusion-comet#7062 ·
Los mantenedores suelen responder en 1 día
-
help wanted testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
antonyrag/ragleap-core#786 ·
Los mantenedores suelen responder en 1 día