-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected padding in CTabFolders without images #945
Comments
@shubhamWaghmare-sap do you know why you decided to not only apply the padding when the setting says to do so (i.e., At least for me, changing the above posted snipped as follows solves the issue for me: if (((state & SWT.SELECTED) != 0 && !parent.showSelectedImage)
|| ((state & SWT.SELECTED) == 0 && !parent.showUnselectedImage))
return TABS_WITHOUT_ICONS_PADDING; |
…clipse-platform#945 Currently, all headers in CTabFolders without an image have a large text padding. This applies to both the case where no image is assigned to a tab item and the case where images shall not be shown as the properties showSelectedImage and showUnselectedImage are both false. While the latter is intended behavior to switch between image-based tab folders and image-less, padding-based tab folders (see eclipse-platform#785), the former unintentionally breaks with the existing UI experience for CTabFolders that do not use images. This change makes the identification of whether large text padding shall be applied explicit by factoring it out into a method (which may be replaced by a different implementation later on). It reduces the cases in which the large text padding is applied to the intended case (showSelectedImage = showUnselectedImage = false) and restores the behavior for all existing use cases. Contributes to eclipse-platform#945
…clipse-platform#945 Currently, all headers in CTabFolders without an image have a large text padding. This applies to both the case where no image is assigned to a tab item and the case where images shall not be shown as the properties showSelectedImage and showUnselectedImage are both false. While the latter is intended behavior to switch between image-based tab folders and image-less, padding-based tab folders (see eclipse-platform#785), the former unintentionally breaks with the existing UI experience for CTabFolders that do not use images. This change makes the identification of whether large text padding shall be applied explicit by factoring it out into a method (which may be replaced by a different implementation later on). It reduces the cases in which the large text padding is applied to the intended case (showSelectedImage = showUnselectedImage = false) and restores the behavior for all existing use cases. Contributes to eclipse-platform#945
…clipse-platform#945 Currently, all headers in CTabFolders without an image have a large text padding. This applies to both the case where no image is assigned to a tab item and the case where images shall not be shown as the properties showSelectedImage and showUnselectedImage are both false. While the latter is intended behavior to switch between image-based tab folders and image-less, padding-based tab folders (see eclipse-platform#785), the former unintentionally breaks with the existing UI experience for CTabFolders that do not use images. This change makes the identification of whether large text padding shall be applied explicit by factoring it out into a method (which may be replaced by a different implementation later on). It reduces the cases in which the large text padding is applied to the intended case (showSelectedImage = showUnselectedImage = false) and restores the behavior for all existing use cases. Contributes to eclipse-platform#945
…clipse-platform#945 Currently, all headers in CTabFolders without an image have a large text padding. This applies to both the case where no image is assigned to a tab item and the case where images shall not be shown as the properties showSelectedImage and showUnselectedImage are both false. While the latter is intended behavior to switch between image-based tab folders and image-less, padding-based tab folders (see eclipse-platform#785), the former unintentionally breaks with the existing UI experience for CTabFolders that do not use images. This change makes the identification of whether large text padding shall be applied explicit by factoring it out into a method (which may be replaced by a different implementation later on). It reduces the cases in which the large text padding is applied to the intended case (showSelectedImage = showUnselectedImage = false) and restores the behavior for all existing use cases. Contributes to eclipse-platform#945
Currently, all headers in CTabFolders without an image have a large text padding. This applies to both the case where no image is assigned to a tab item and the case where images shall not be shown as the properties showSelectedImage and showUnselectedImage are both false. While the latter is intended behavior to switch between image-based tab folders and image-less, padding-based tab folders (see #785), the former unintentionally breaks with the existing UI experience for CTabFolders that do not use images. This change makes the identification of whether large text padding shall be applied explicit by factoring it out into a method (which may be replaced by a different implementation later on). It reduces the cases in which the large text padding is applied to the intended case (showSelectedImage = showUnselectedImage = false) and restores the behavior for all existing use cases. Contributes to #945
The idea behind padding is to provide a clearly visible separation between tabs, when no image is available/visible for tabs. With images visible, it is easy to identify the individual open tabs. If images are not visible, without padding the separation is not very clear between two tabs i.e. which part of the text belongs to which tab is hard to identify, as also mentioned by you @HeikoKlare in eclipse-platform/eclipse.platform.ui#1071 (comment) Hence the padding helps with the visual separation between tabs, when tab image is not visible or not available (is null or disposed) or when the setting says to not show image (
@HeikoKlare Could you please elaborate on why Expected behavior is desirable over the current behavior with padding when image is not assigned or disposed? |
The problem here is with respect to compatbility. I like the option to have tab folder with large text padding as introduced with #785. But that behavior should be enabled explicitly (currently by setting An improvement of the current implementation could be to make the size of the padding configurable in specializations or even instances of the CTabFolderRenderer, as proposed by @satz: #785 (comment) Meanwhile, the behavior for existing CTabFolder should be like before #785 due to #947. So after the next I-Build you should be able to update your Eclipse to have the pre-existing appearance again (@merks fyi). |
@HeikoKlare Thanks for the explanation.
Agreed. Makes sense. 👍 |
Following are the open discussions for improvements from different issues around eclipse-platform/eclipse.platform.ui#1071 & #785 :
Addressing these can provide flexibility and enhance the visual appearance of the tabs. Any comments on the "need" for each of the above mentioned improvements or any additions to the list are welcome. |
What's the state of this issue? Does it still exist or is it fixed? |
The original issue should be fixed (from an end users' perspective) via #947, but it is not a sufficient solution from a developer's point of view. In particular, there is no way to explicitly configure whether large paddings shall be used in tab headers. You can only defined that implicitly by a specific combination of
I would propose to put the other ideas for improvement into a separate issue, as they are not directly related to the original issue here. |
Describe the bug
The headers in CTabFolders always have a large padding if they either do not have a usable image assigned or if they are configured to now show icons. The latter case was the intention of #785, but as a side effect it also applies to when simply no image is provided (like in all existing CTabFolders without images).
The reason is that the extra padding is also applied when the image of a tab is null or disposed:
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java
Lines 396 to 398 in f19db14
To Reproduce
The behavior can be seen when opening the CTabFolder in the
CustomControlsExample
.Before:
After:
Expected behavior
CTabFolders without images shall be shown without extra padding like before #785.
Screenshots
The issue can, e.g., be seen in the plug-in settings. Originally posted in a comment of the original PR: #785 (comment)
Before:
After:
Version since
Since #785 / SWT 3.125.
The text was updated successfully, but these errors were encountered: