Community
Participate
Working Groups
JFace dialogs does not resize correctly according to content size, and always shows up too wide on Linux GTK platform. Even a simple MessageAndIconDialog with a short text takes up 70% width of my 1248x1024 screen. Could you please look into this problem? Thanks.
Moving to ui to investigate jface issue.
The icon and message dialog is set to be the same size as wizards by default (all dialogs are set to be a consistent minimum size) and to wrap thier text accordingly. If all of your dialogs are too large this may be because of the font you are using. Sans regular 10 is the default on my machine and the layout is fine for me.
I have already submitted a bug report on similar problem with WizardDialog(- please see #37361). I don't mean font size is too big, but actual problem is that I can't get dialog to resize smaller than certain size even if there's enough space left in it. And with certain font settings, it seems ridiculously big compared to other native gtk application dialogs. If you press close button of Eclipse platform, it will show you confirm dialog. And if you look more closely, you can see there's large space left between end of text and right side of the dialog border. But you can't seem to resize it smaller than the original size. Maybe it's the same problem as the Wizard problem which could be worked around by put additional pack() method. Isn't it nice to have properly sized compact dialog as other native applications? :)
So really what you are asking for here is for us to make a different default dialog size on GTK?
No. Sorry if I was not clear enough(I'm not very comfortable to write in English). What I really want is to be able to resize dialogs as small as the content inside it permits - not any specific 'default size'. I don't care if it has some marginal default size. But the real problem is currently, you CANNOT make it any smaller than the default size, which is very big even if there's enough space in it. I think I can make a small test case to show you the exact problem, or maybe better a workaround if you want.
Created attachment 6706 [details] screenshot of eclipse's exit dialog. it's size is 925x127! screenshot of eclipse's exit dialog. it's size is 925x127! As shown in this screenshot, it does not pack itself to be compact even if there's enough space left to do that. And more importantly, there's no way user, or program to make it any smaller than it's default size.
Just found out what causes the dialogs to show way to big. JFace dialogs enforce its minimum width as convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH) and when I removed the line, the problem was gone. Even if this value is reasonably small (300px default) but it seems somehow it fails to resize correctly when this minimum width is specified. Could you please reopen this bug to correct this problem? It's very annoying to see every dialog boxes occupy 70% of my screen width.
Reopening
*** This bug has been marked as a duplicate of 49485 ***
Sorry - wrong dup
*** This bug has been marked as a duplicate of 49483 ***
I believe this problem is being caused by the way in which pango calculates the default character width for your font. Dialog units are used to calculate the size of the dialog, and these will depend on both your font and your locale when using pango. Can you please tell me: - What font you are using - What version of pango and GTK+ you are using - Point size of the font and DPI of your X server Also, if you can, please run this program (the compile line is at the top of the file) and tell me what it outputs on your machine: http://vektor.ca/bugs/fontmetrics.c
It seems it's fixed now with the recent upgrade to GNOME 2.8. both Eclipse 3.x and 2.x works correctly. Anyway, my gtk+ version is 2.4.9, and pango is 1.6.0 now. And output from fontmetrics here : Font: Bandal Size: 12288 Size (pixels): 12 Approximate char width: 9481 Approximate digit width: 8192 Approximate char width (pixels): 9 Approximate digit width (pixels): 8 Thanks for the support! :)
I bet this was due to some bad data from pango. Please re-open if you see this happen again.
*** Bug 37361 has been marked as a duplicate of this bug. ***