Community
Participate
Working Groups
Created attachment 226341 [details] screenshot - 4.3RC5 test build, observed on Ubuntu 12.04LTS - screenshot is attached
Possibly a duplicate of bug 394583.
Works in Fedora 18 64bit. Attaching screenshot: http://oi47.tinypic.com/2hp10td.jpg
(In reply to comment #0) > Created attachment 226341 [details] > screenshot > > - 4.3RC5 test build, observed on Ubuntu 12.04LTS > > - screenshot is attached Hello Grant, I was able to reproduce this problem on Fedora 18 with 64 bit using this snippet: -------------------------------------------------------------------- import org.eclipse.swt.SWT; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class textbox_clipped { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); new Text(shell, SWT.READ_ONLY | SWT.BORDER).setText("TextBox is Clipped"); // This Textbox is Clipped new Text(shell, SWT.READ_ONLY | SWT.BORDER); // This Textbox in GTK3 is much wider than in GTK2 shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } ----------------------------------------------------------- If you run it in GTK2 and GTK3 you will see that the first Text field is clipped to the right, and second Text field appear to be much wider in GTK3 than in GTK2. I think that both problems are connected, as Text.computeTrim() trims the same amount in both GTK2 and GTK3, its just the width that is bigger, and creates this "clipping" effect. I have tried several things, but neither of them gave me the right result. I think (not sure) that the cause of the problem is in different size calculations of GtkEntry in GTK2 and GTK3, thus by default GtkEntry in GTK3 is wider than in GTK2. I hope this will help! Regards, Anatoly
(In reply to comment #3) > (In reply to comment #0) > > Created attachment 226341 [details] > > screenshot > > > > - 4.3RC5 test build, observed on Ubuntu 12.04LTS > > > > - screenshot is attached > > Hello Grant, > > I was able to reproduce this problem on Fedora 18 with 64 bit using this > snippet: > -------------------------------------------------------------------- > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.*; > import org.eclipse.swt.widgets.*; > > public class textbox_clipped { > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout(1, false)); > > > new Text(shell, SWT.READ_ONLY | SWT.BORDER).setText("TextBox is > Clipped"); // This Textbox is Clipped > new Text(shell, SWT.READ_ONLY | SWT.BORDER); // This Textbox in GTK3 is > much wider than in GTK2 > > > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } > } > > ----------------------------------------------------------- > > If you run it in GTK2 and GTK3 you will see that the first Text field is > clipped to the right, and second Text field appear to be much wider in GTK3 > than in GTK2. > > I think that both problems are connected, as Text.computeTrim() trims the > same amount in both GTK2 and GTK3, its just the width that is bigger, and > creates this "clipping" effect. > > I have tried several things, but neither of them gave me the right result. I > think (not sure) that the cause of the problem is in different size > calculations of GtkEntry in GTK2 and GTK3, thus by default GtkEntry in GTK3 > is wider than in GTK2. > > > I hope this will help! > > > Regards, > > Anatoly I have got it working! I was right that the problem was in default sizing of GtkEntry, also there was minor issue with GtkRequisition. Please try this patch and tell me if it works for you: http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gtk3_textbox_clipped Thanks, Anatoly
I haven't tried it yet, but looking at the patch, why 6 chars?
(In reply to comment #5) > I haven't tried it yet, but looking at the patch, why 6 chars? Good question, by default GTK3 makes Text too wide, so I need to set default Gtk3 Textbox smaller than it is. If I set it to 1, it is much smaller than the default GTK2 one, so I decided to make it look the same. If you open GTK2 and GTK3 snippet that I have provided together you will see that they look similar. I tried different char_width and the one I have chosen looks most appropriate to my mind. Here is the screenshot: http://oi47.tinypic.com/2ep4wvq.jpg ( GTk2 textboxes and Gtk3 textboxes)
I plan on pushing this one as it seems to improve the situation although not the best solution obviously.
Slightly modified patch(set width_chars only for SWT.SINGLE) pushed as this is clear improvement over the current state.