Community
Participate
Working Groups
In GTK 3 if you set SWT.Border or alignment such as SWT.Center they are not shown in the widget. As an example you can try execute this line: Label label = new Label (shell, SWT.CENTER|SWT.BORDER); I think it is because GTK 3 uses CSSProvider to set style.
(In reply to comment #0) > In GTK 3 if you set SWT.Border or alignment such as SWT.Center they are not > shown in the widget. > > As an example you can try execute this line: > > Label label = new Label (shell, SWT.CENTER|SWT.BORDER); > > I think it is because GTK 3 uses CSSProvider to set style. Regarding SWT.BORDER - I found out that SWT.BORDER is theme dependant and in adwaita (default theme) border is not drawn, whereas it is drawn in some other themes. Also I found som more information about moving to different styling of frames from here: http://developer.gnome.org/hig-book/3.5/controls-frames.html.en Silenio question to you: should we spend time on possibly creating our own CSS and putting border in it, or we leave this issue as theme specific ?
Sorry, I missed your question probably because I was not in the CC list. I think if a given theme has no borders we should just respect that. We should not force the label to have borders otherwise our labels will look different. It seems Fedora 18 added borders back anyways. I have not been able to reproduce the alignment problem in the latest. Can you still reproduce it?
(In reply to comment #2) > Sorry, I missed your question probably because I was not in the CC list. > > I think if a given theme has no borders we should just respect that. We > should not force the label to have borders otherwise our labels will look > different. It seems Fedora 18 added borders back anyways. > > I have not been able to reproduce the alignment problem in the latest. Can > you still reproduce it? I totally agree about forcing part. And in regards to the alignment, this issue was lately fixed. So bug can be closed. To see that issue is fixed, you can run: import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; public class FirstSWTClass { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("First SWT Application"); shell.setSize(250, 250); Label label = new Label(shell, SWT.CENTER); label.setText("Greetings from SWT"); label.setBounds(shell.getClientArea()); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
Alignment and border issues are fixed.