Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312842 - Add some margin space between the trim and the "client area."
Summary: Add some margin space between the trim and the "client area."
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.0 M6   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 293481
  Show dependency tree
 
Reported: 2010-05-13 16:57 EDT by Susan McCourt CLA
Modified: 2010-05-24 16:07 EDT (History)
4 users (show)

See Also:


Attachments
work in progress patch (8.38 KB, patch)
2010-05-18 16:05 EDT, Susan McCourt CLA
no flags Details | Diff
Take 2 (4.79 KB, patch)
2010-05-20 12:36 EDT, Bogdan Gheorghe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2010-05-13 16:57:12 EDT

    
Comment 1 Susan McCourt CLA 2010-05-13 16:58:45 EDT
The mockups for the default e4 style include some margins - below the toolbar, on the left and right, underneath.

In the short run we should hack in some margins so that things look a little less cramped by default.

In the long run, the trim margins (as well as the gutters between part stacks) need to be stylable.
Comment 2 Susan McCourt CLA 2010-05-13 19:15:27 EDT
For now I've done the following:
- TrimPartLayout now has public fields for gutterTop, gutterBottom, gutterRight, gutterLeft
- WBWRenderer hard-codes these to values that match the mockups

To be done:
- decide where these values would be defined in the CSS.
Comment 3 Remy Suen CLA 2010-05-14 12:05:00 EDT
Note that the demos now also have "breathing room".
Comment 4 Brian de Alwis CLA 2010-05-17 13:28:07 EDT
Please ensure this is configurable: it makes e4 RCP apps look terrible, IMHO.
Comment 5 Susan McCourt CLA 2010-05-17 13:39:19 EDT
(In reply to comment #4)
> Please ensure this is configurable: it makes e4 RCP apps look terrible, IMHO.

The next step is to make this stylable.
Comment 6 Susan McCourt CLA 2010-05-18 16:05:08 EDT
Created attachment 169009 [details]
work in progress patch

This patch retrieves the margin values from the CSSEngine in order to set the layout margins for the WBW.  Discussed this approach with Eric and Bogdan.  For now we will mercilessly reach for a theme manager and its CSSEngine and grab the values from there.  This patch demonstrates how other renderers could get the margin values.  We may want to come up with something a little nicer (wrap all this up in a helper class) so that at least this wad of code isn't being copied everywhere. 

Bogdan - can you have a look?  It's not finding the MWindow values in the CSS but maybe since I'm setting the cssinfo on the fly just before retrieving the values, something is missing?  (Or I've made a dumb mistake)...
Comment 7 Bogdan Gheorghe CLA 2010-05-20 09:52:08 EDT
OK, I have this working in my workspace. I'll clean it up and attach the patch here.
Comment 8 Bogdan Gheorghe CLA 2010-05-20 12:36:26 EDT
Created attachment 169372 [details]
Take 2 

To get this to work, you need to add the following CSS to e4_default.css:

.MTrimmedWindow {  
    margin-top: 12px;
    margin-bottom: 2px;
    margin-left: 10px;
    margin-right: 10px;
}
Comment 9 Susan McCourt CLA 2010-05-20 14:00:42 EDT
Thanks, Bogdan!
Fixed in HEAD >20100520.
I've made a CSSEngineHelper that can be used to retrieve values given a particular control and IEclipseContext.  At least this way we can bury the details about going through the theme engine and the CSS implementation details.
Comment 10 Susan McCourt CLA 2010-05-20 14:01:13 EDT
(In reply to comment #4)
> Please ensure this is configurable: it makes e4 RCP apps look terrible, IMHO.

Brian, the margins will now default to 0 unless specified in the stylesheet.