Commit 84bda53
committed
Make TreeItem.getExpanded consistent across platforms #2834
When the children of a previously expanded TreeItem are removed, the
call to getExpanded() should continue to return "true". On both Linux
and MacOS, this property is not persisted and therefore stored in a
local variable. But on Linux, a call to getExpanded() still returns the
result from a call to the GTK API.
To harmonize the behavior between the different operating systems,
following changes are done:
1) The call to getExpanded() now always returns the local variable,
similar to how it's done for MacOS.
2) The call to setExpanded() doesn't modify the tree item if it is
already expanded or a leaf node.
Closes #28341 parent cd186a7 commit 84bda53
File tree
2 files changed
+13
-6
lines changed- bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets
- tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit
2 files changed
+13
-6
lines changedLines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
| 538 | + | |
542 | 539 | | |
543 | 540 | | |
544 | 541 | | |
| |||
1226 | 1223 | | |
1227 | 1224 | | |
1228 | 1225 | | |
1229 | | - | |
| 1226 | + | |
| 1227 | + | |
1230 | 1228 | | |
1231 | 1229 | | |
1232 | 1230 | | |
| |||
1237 | 1235 | | |
1238 | 1236 | | |
1239 | 1237 | | |
| 1238 | + | |
1240 | 1239 | | |
1241 | 1240 | | |
1242 | | - | |
1243 | 1241 | | |
1244 | 1242 | | |
1245 | 1243 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
538 | 541 | | |
539 | 542 | | |
540 | 543 | | |
541 | 544 | | |
542 | 545 | | |
543 | 546 | | |
544 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
545 | 554 | | |
546 | 555 | | |
547 | 556 | | |
| |||
0 commit comments