[Win32] Table: first row partly hidden behind header
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.”
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Java
- スター
- 202
- フォーク
- 206
- 平均マージ
- 16時間 56分
- マージ済み PR(30日)
- 110
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-platform/eclipse.platform.swt のほかの issue
-
`SWT_AWT.initFrame` takes `(long, String)` in Java; the GTK native declares no `className` and the Cocoa native types it `const char *`対応中かも @GreenFuze が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
eclipse-platform/eclipse.platform.swt#3665 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
eclipse-platform/eclipse.platform.swt#3336 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
eclipse-platform/eclipse.platform.swt#3718 ·
メンテナーはふだん 1 日以内に返信
eclipse-platform/eclipse.platform.swt の issue をすべて見る
似ている issue
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
kestra-io/plugin-aws#816 ·
メンテナーはふだん 2 日以内に返信
-
area/plugin good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
kestra-io/plugin-kestra#200 ·
メンテナーはふだん 1 日以内に返信
-
bug untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
opensearch-project/search-relevance#618 ·
メンテナーはふだん 3 日以内に返信
-
[Studio][Bug] Invalid ACL wildcard entries inflate the risk score対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/rocketmq-dashboard#6716 ·
メンテナーはふだん 3 日以内に返信