Bug 132821 - [Dialogs] Stored Dialog location and size invalid after changing font
Summary: [Dialogs] Stored Dialog location and size invalid after changing font
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: polish
Depends on:
Blocks:
 
Reported: 2006-03-22 06:19 EST by Dani Megert CLA
Modified: 2006-04-27 13:52 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2006-03-22 06:19:16 EST
I20060321-1210.

I started to use the new  JFace Dialog support that manages location and size. The problem I run into is that it does not reset the size when the font changes, which makes the dialog look ugly and forces the user to manually adjust/reset the size, which is not an easy task, see also bug 116906.
Comment 1 Susan McCourt CLA 2006-03-23 13:14:14 EST
marking for 3.2 polish
Comment 2 Susan McCourt CLA 2006-04-19 17:05:18 EDT
I've got a proposed fix for this, but would like comments from the cc list about the proposal. 

The issue is that if dialog bounds were stored under a particular dialog font, then the bounds are potentially bogus when the dialog font changes.  The proposal is to do the following:

- store the font data string of the font used when the bounds were stored, along with the bounds
- when a dialog bounds is retrieved:
  a) if there was no previously stored dialog font, honor the bounds (to
     retain settings for those who saved the bounds before this fix)
  b) if there was a previously stored dialog font, and it matches, honor the
     bounds
  c) if there was a previously stored dialog font, and it does not match, then 
     do not retrieve the previously stored size.  However, the previously 
     stored location will be honored, because it will always be checked and
     adjusted if it no longer fits on the screen.  By preserving the location,
     we can come closer to remembering the correct location, which is 
     especially important to multi-display users.

The downside:
- dialog font changes that don't cause ugly/improper layout will still cause the stored bounds to be lost.  For example, if the user purposely sizes a dialog to be very large, and subsequently changes the font to be smaller or larger, the dialog will shrink to its default size even though the larger size was still valid for that user.
Comment 3 Martin Aeschlimann CLA 2006-04-20 04:07:18 EDT
That suggestion makes sense to me.

I'm wondering if the same applies for location: If you detect that screen size, or number of monitors change, do you ignore the stored location?
(I think that would make sense)
Comment 4 Dani Megert CLA 2006-04-20 04:23:58 EDT
+1
Comment 5 Markus Keller CLA 2006-04-20 05:11:27 EDT
+1
Comment 6 Susan McCourt CLA 2006-04-20 10:23:16 EDT
The location for dialogs is always honored, but it gets adjusted via the normal Window mechanisms.  Also of importance is that the location is stored relative to the parent shell, so in a change of number of monitors, the "right thing" happens.  This seems to accomodate the scenarios from bug #108801 and bug #33550 comment #15, so I don't see doing any extra work on identifying changes that affect location.
Comment 7 Susan McCourt CLA 2006-04-20 14:36:59 EDT
Fixed >20060420.
Comment 8 Susan McCourt CLA 2006-04-21 14:20:29 EDT
cc'ing McQ for FYI.
Comment 9 Susan McCourt CLA 2006-04-27 13:52:09 EDT
verified on N20060425-0010, Win XP using open resource dialog.