Bug 104545 - Make default size of empty composites smaller
Summary: Make default size of empty composites smaller
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 85261 (view as bug list)
Depends on:
Blocks: 70049 102885
  Show dependency tree
 
Reported: 2005-07-20 14:21 EDT by Boris Bokowski CLA
Modified: 2009-08-27 04:54 EDT (History)
6 users (show)

See Also:


Attachments
Snippet that shows the empty coolbar with a size of 64x64 pixels (1.88 KB, application/octet-stream)
2005-07-20 14:25 EDT, Boris Bokowski CLA
no flags Details
screenshot of the snippet running (4.42 KB, image/png)
2005-07-20 14:26 EDT, Boris Bokowski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2005-07-20 14:21:03 EDT
Could the following two constants in Widget.java be changed to something smaller?

/* Default widths for widgets */
static final int DEFAULT_WIDTH	= 64;
static final int DEFAULT_HEIGHT	= 64;

Anything less than or equal to 16 would work for us, 0 would be OK too.  I have
run our tests (JFace, UI, RCP) and they run fine when the constants are 0.

Background: When you write an RCP app and enable the cool bar, the cool bar will
initially be empty, but 64x64 pixels in size. On Windows, you cannot see the
border of the empty coolbar so the user gets a big empty space at the top of
their window and might be confused.

See also Bug 70049, where the same problem occurs in an RCP application that
starts off with no open perspective and thus no cool bar items.
Comment 1 Boris Bokowski CLA 2005-07-20 14:25:44 EDT
Created attachment 25072 [details]
Snippet that shows the empty coolbar with a size of 64x64 pixels
Comment 2 Boris Bokowski CLA 2005-07-20 14:26:13 EDT
Created attachment 25073 [details]
screenshot of the snippet running
Comment 3 Steve Northover CLA 2005-07-28 16:05:14 EDT
We just need to decide what the defaults are for each subclass of Composite 
and put the code on every platform.
Comment 4 Steve Northover CLA 2005-09-06 19:53:25 EDT
What happened?  This one is pretty easy.  We just need to figure out the 
defaults for each kind of widget.
Comment 5 B. Chen CLA 2006-05-02 11:08:46 EDT
Any status on this defect? Our product has dependency on bug #70049 which is waiting on this fix. We need this fix in 3.2. 
Comment 6 Steve Northover CLA 2006-05-02 15:34:43 EDT
CAR tells me that the fix is easy if we only fix CoolBar (which is what they are asking).

+1 to fix CoolBar only.
Comment 7 Carolyn MacLeod CLA 2006-05-02 16:53:49 EDT
McQ, we have the fix ready and waiting...
Comment 8 B. Chen CLA 2006-05-02 21:42:26 EDT
Since the fix is ready, may I ask when it's going to be in the build?
Comment 9 Mike Wilson CLA 2006-05-03 09:46:07 EDT
please attach a patch that describes the change.
Comment 10 Carolyn MacLeod CLA 2006-05-03 11:58:19 EDT
I've currently got the change implemented on each platform (i.e. on 4 different machines), so it's easier to describe the change than to create a patch. All platforms are the same change:

1) Add the following 2 new constants to CoolBar class:
static final int DEFAULT_COOLBAR_WIDTH = 0;
static final int DEFAULT_COOLBAR_HEIGHT = 0;

2) In CoolBar computeSize method (which currently uses DEFAULT_WIDTH and DEFAULT_HEIGHT from Control on all platforms if there are no children),
- change DEFAULT_WIDTH to DEFAULT_COOLBAR_WIDTH and
- change DEFAULT_HEIGHT to DEFAULT_COOLBAR_HEIGHT.

Tested on all platforms.
Comment 11 Carolyn MacLeod CLA 2006-05-03 12:00:11 EDT
Re comment 8, we need the approval of 2 team leads in order to put any code change in at this point.
Comment 12 Mike Wilson CLA 2006-05-03 12:03:34 EDT
+1
Comment 13 Carolyn MacLeod CLA 2006-05-03 13:01:53 EDT
Thanks, McQ.

Fixed in HEAD > 20060503.
This will be in eclipse 3.2RC3.
Comment 14 Felipe Heidrich CLA 2009-07-17 14:53:25 EDT
*** Bug 85261 has been marked as a duplicate of this bug. ***