Commit 6e665a6
committed
Fix size of tab items when large text padding is used
The recently introduced option to not show images in tab folders
currently works as follows: A large padding is applied to the tab item
as a separator with the text being centered within this padding. For
tabs showing a close icon (which in particular is the currently selected
on), this icon is added right at the right end of the tab item, such
that the text is centered in between the left end of the tab item and
the close button. This does not look perfect and while the padding is
necessary as a separator for tabs only containing a text, having close
icons and, in case of the selected tab, also a different background is
sufficient as a separator.
This change adapts the appearance of tab items having a close icon when
having images disabled. It uses the same size for the tab as if no close
icon was drawn and then reduces the area in which the text is centered
to the remaining space left to the close icon. This looks cleaner and
has the effect that tabs within a tab folder have a fixed with, such
that when changing the selection all tabs keep their size and positions.
Only the texts within the tab items change their positions depending on
whether the close icon is shown or not.1 parent 75da5aa commit 6e665a6
File tree
2 files changed
+32
-34
lines changed- bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom
2 files changed
+32
-34
lines changedLines changed: 11 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2972 | 2972 | | |
2973 | 2973 | | |
2974 | 2974 | | |
2975 | | - | |
2976 | | - | |
2977 | | - | |
2978 | | - | |
2979 | | - | |
2980 | | - | |
2981 | | - | |
2982 | | - | |
2983 | | - | |
2984 | | - | |
2985 | | - | |
2986 | | - | |
2987 | | - | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
2988 | 2986 | | |
2989 | 2987 | | |
2990 | 2988 | | |
| |||
Lines changed: 21 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
369 | 365 | | |
370 | 366 | | |
371 | 367 | | |
| |||
385 | 381 | | |
386 | 382 | | |
387 | 383 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 384 | + | |
393 | 385 | | |
394 | | - | |
| 386 | + | |
395 | 387 | | |
396 | 388 | | |
397 | 389 | | |
398 | 390 | | |
399 | | - | |
400 | | - | |
401 | | - | |
| 391 | + | |
402 | 392 | | |
403 | | - | |
404 | 393 | | |
405 | 394 | | |
406 | 395 | | |
407 | | - | |
| 396 | + | |
408 | 397 | | |
409 | 398 | | |
410 | 399 | | |
| |||
1438 | 1427 | | |
1439 | 1428 | | |
1440 | 1429 | | |
1441 | | - | |
| 1430 | + | |
1442 | 1431 | | |
1443 | 1432 | | |
1444 | 1433 | | |
| |||
1478 | 1467 | | |
1479 | 1468 | | |
1480 | 1469 | | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
| |||
1652 | 1652 | | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | | - | |
| 1655 | + | |
1656 | 1656 | | |
1657 | 1657 | | |
1658 | 1658 | | |
| |||
0 commit comments