Bug 43788 - [Dialogs] JFace dialogs does not resize correctly
Summary: [Dialogs] JFace dialogs does not resize correctly
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Billy Biggs CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 37361 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-27 03:27 EDT by Xavier Cho CLA
Modified: 2005-06-22 21:57 EDT (History)
0 users

See Also:


Attachments
screenshot of eclipse's exit dialog. it's size is 925x127! (84.42 KB, image/png)
2003-11-09 00:14 EST, Xavier Cho CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier Cho CLA 2003-09-27 03:27:17 EDT
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.
Comment 1 Grant Gayed CLA 2003-09-29 11:36:39 EDT
Moving to ui to investigate jface issue.
Comment 2 Tod Creasey CLA 2003-09-30 15:37:23 EDT
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.
Comment 3 Xavier Cho CLA 2003-09-30 22:15:25 EDT
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? :)
Comment 4 Tod Creasey CLA 2003-10-01 08:18:21 EDT
So really what you are asking for here is for us to make a different default 
dialog size on GTK?
Comment 5 Xavier Cho CLA 2003-10-01 11:35:19 EDT
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.
Comment 6 Xavier Cho CLA 2003-11-09 00:14:09 EST
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.
Comment 7 Xavier Cho CLA 2004-04-05 05:13:26 EDT
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.
Comment 8 Tod Creasey CLA 2004-04-05 08:15:12 EDT
Reopening
Comment 9 Tod Creasey CLA 2004-04-05 08:15:24 EDT

*** This bug has been marked as a duplicate of 49485 ***
Comment 10 Tod Creasey CLA 2004-04-05 08:15:57 EDT
Sorry - wrong dup
Comment 11 Tod Creasey CLA 2004-04-05 08:16:48 EDT

*** This bug has been marked as a duplicate of 49483 ***
Comment 12 Billy Biggs CLA 2004-09-17 11:23:31 EDT
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
Comment 13 Xavier Cho CLA 2004-09-19 07:51:42 EDT
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! :)
Comment 14 Billy Biggs CLA 2004-10-28 12:06:21 EDT
I bet this was due to some bad data from pango.  Please re-open if you see this
happen again.
Comment 15 Billy Biggs CLA 2005-06-22 21:57:33 EDT
*** Bug 37361 has been marked as a duplicate of this bug. ***