[Win] Table without column expands
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- java
- Ambito
- desktop, desktop-dev
Direzione di ricerca
Reproduce with the given TableWithoutColumnTest snippet: a VIRTUAL Table with no columns, MeasureItem setting event.width to table.getClientArea().width. On Windows the table shows a horizontal scrollbar and remembers a max width instead of staying client-wide. Start from the Windows Table/TableItem MeasureItem and client-area/scrollbar path in SWT; done when the snippet never shows a horizontal bar and rows shrink with the client area.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
We want to make a column as wide as the visible area (client area) without showing a horizontal scrollbar (just like a list). For that we set the client area's width in the MeasureItem event. However, this causes the table to show a horizontal scrollbar, and the item's width only can grow when resizing the table, but not shrink.
To Reproduce
Using Snippet 271 for inspiration:
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
final class TableWithoutColumnTest {
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.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.addListener (SWT.SetData, event -> {
final TableItem item = (TableItem) event.item;
final int index = table.indexOf (item);
item.setText ("Item " + index);
});
table.addListener(SWT.MeasureItem, event -> {
event.width = table.getClientArea().width;
});
table.setItemCount(100);
table.setSelection(0);
shell.setSize (200, 200);
shell.open ();
while (!shell.isDisposed()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
}
Expected behavior
The table should never show a horizontal scrollbar and all rows should be as wide as the client area.
Screenshots
Note the horizontal scrollbar. The table remembers the maximum width + x. (Also note the tiny drawing glitch (gray area in the selected row) when starting the resize.)
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, 175% zoom
- Lingua principale
- Java
- Stelle
- 202
- Fork
- 206
- Merge medio
- 14h 7m
- PR unite (30g)
- 103
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di 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 *`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
eclipse-platform/eclipse.platform.swt#3665 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di eclipse-platform/eclipse.platform.swt
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
objectionary/lints#1556 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
wildfly/wildfly-launcher#99 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
apache/rocketmq#11427 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno