[Win32] Table column resizing broken
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 54/100
Línea de trabajo
Start by tracing how Table.getClientArea() and TableColumn.setWidth() interact with scrollbar sizing on Windows at 175% zoom. The issue provides a reproducer but names no implementation files or tests, so locate the relevant Win32 table code and existing resizing tests first. Done means resizing the window no longer shows a horizontal scrollbar when the column should fit the client area.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
We want a table column to be as wide as the table to avoid a horizontal scrollbar. This is broken with the rounding of getClientArea() for zoom factors like 175% (typical for 4k displays).
To Reproduce
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class OneTableColumn {
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
final Table table = new Table(shell, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
table.setHeaderVisible(false);
final TableColumn column = new TableColumn(table, SWT.LEFT);
column.setResizable(false);
table.addListener(SWT.Resize, new Listener() {
private boolean updating;
@Override
public void handleEvent(Event event) {
updateColumnWidth();
// Update again after SWT has adjusted the scrollbars.
display.asyncExec(() -> {
if (!table.isDisposed()) {
updateColumnWidth();
}
});
}
private void updateColumnWidth() {
if (updating) {
return;
}
updating = true;
try {
final int width = table.getClientArea().width;
if (column.getWidth() != width) {
column.setWidth(width);
}
}
finally {
updating = false;
}
}
});
for (int i = 0; i < 10; i++) {
new TableItem(table, SWT.NONE).setText("Item " + i);
}
shell.setSize(400, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
}
- run this snippet on Windows with a zoom factor of 175%
- resize the window -> the horizontal scrollbar occurs for some window widths
- even changing
column.setWidth(width)tocolumn.setWidth(width - 1)does not prevent the scrollbar from occurring
Expected behavior
The column should be as wide as the client area, but not wider, so no horizontal scrollbar is shown.
Screenshots
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 (or) Additional context
Workaround: use SWT v4972r4 or earlier
- Lenguaje dominante
- Java
- Estrellas
- 202
- Forks
- 206
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 102
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
-
[Win32] Table tooltip indexes cell font with subitem -1Posiblemente ocupada @fdesbiens la tomó hace 17 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eclipse-platform/eclipse.platform.swt#3752 ·
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
-
[Cocoa] NPE in Text.shouldChangeTextInRange_replacementString when the press-and-hold accent menu inserts textPosiblemente ocupada @Jm6CnDDXBwFTakS la tomó hace 2 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
eclipse-platform/eclipse.platform.swt#3819 ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.swt
Issues similares
-
bug key bindings source editor
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
endoflife-date/endoflife.date#11561 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
conductor-oss/conductor#1824 ·
Los mantenedores suelen responder en 5 días
-
Type: Possible bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
AntennaPod/AntennaPod#8887 · 1 comentario ·
Los mantenedores suelen responder en 1 día