Community
Participate
Working Groups
Hi, using Snippet 165 to show a CTabFolder with Min / Max Buttons and some CTabItems, some strange things happen on my system: 1.) Close all CTabItems. The CTabFolder becomes empty. 2.) Hover over the place Min and Max items should be. See that they are clickable and the tooltip shows, although the buttons are not visible. -> I think those buttons should be visible even in case the last CTabItem is closed. 1.) Minimize the CTabFolder using the minimize button 2.) Close all Tabs. I am getting a small graphic bug. A few pixel of the last closed CTabItem is still visible. Ben
Still showing in latest SWT.
Is this adressed for M7?
I just released the code for this in HEAD. It will affect the Eclipse editor workbook so I am not sure if they will object. It may end up coming back out. The argument that they might present is that it is visually too cluttered. Currently in HEAD, the min and max buttons show even if there are no CTabItems. The height of the tab area defaults to the height of a tab with text only (i.e. it is based on font height). If you add a tab with an image this may cause the header height to increase. If you delete all the tabs, the header height does not go back to the default height - it stays at the height it had when the last tab was open. This is based on the assumption that new tabs will have the same height as the old tabs and we want to minimize jumping around.
I am seeing some new problems using latest nightly: - Closing the last CTabItem from the CTabFolder does not remove the horizontal separator, see Screenshot #1 - Even if not CTabItem is visible in the CTabFolder, I am seeing the horizontal separator and the Maximize Button if I am setting a Font to the CTabFolder, see Screenshot #2 Snippet for #2: public class Main { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); FillLayout fill = new FillLayout(); fill.marginHeight = 10; fill.marginWidth = 10; shell.setLayout(fill); Composite c = new Composite(shell, SWT.BORDER); c.setLayout(fill); CTabFolder tabFolder = new CTabFolder(c, SWT.CLOSE); tabFolder.setMaximizeVisible(true); tabFolder.setFont(new Font(display, "Helvetica", 10, SWT.NORMAL)); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } } }
Created attachment 20800 [details] Error #1 and #2
Created attachment 20810 [details] Patch that fixes problems for me
The horizontal line is intentional. It delimits the tab area. The error is that the tab height was not intitialized in the constructor of CTabFolder and was only updated when the font was set. I have fixed this. Now the line appears as soon as the CTabFolder is created and the maximize button is visible as soon as it is set.
Hm ok, but I am not understanding why the separator line and maximize/minimize controls should be visible, when the TabFolder is empty. Why should someone maximize an empty Tabfolder? The native TabFolder is not showing anything, expect for its native background and border, when no TabItem is added. Anyways, I am helping me with calling CTabFolder#setVisible(false) whenever the number of tabitems inside the folder becomes zero. Ben
In your original bug report you say "-> I think those buttons should be visible even in case the last CTabItem is closed." So that is what I implemented. Perhaps I misunderstood. If it makes sense to maximize/minimize the folder after you close the last item, then I presumed that it would make sense to maximize/minimize the folder before you open any items.
Oh, I wonder if I made a typo there or really wanted to have the buttons visible in November. Sorry, I thought this was about hiding the Max/Min Button while having no Items in the TabFolder. Anyways, I am pretty happy now :). And I think you already agreed that the current solution is better working in Eclipse. Keep up the good work, Ben