Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343004 - [Theming] shell custom variant not working as expected
Summary: [Theming] shell custom variant not working as expected
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 13:16 EDT by Penka CLA
Modified: 2011-04-20 06:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Penka CLA 2011-04-15 13:16:29 EDT
Build Identifier: 1.3.1

I want to customize the WorkbenchWindow shell to display a banner with product name on the top - the shell title bar height should be 50px and title font size 20px. I want to set logo image in the shell with size 44x44.

I have a theme registered with the following setting for the default shell:
Shell-Titlebar {
  color: white;
  background-image: gradient( linear, left top, left bottom,
                              from(#6699cc), to(#225599) );
  padding: 2px 5px 2px;
  margin: 0px;
  height: 22px;
  font: bold 12px tahoma, verdana, helvetica, arial, sans-serif;
  border: none;
  border-radius: 3px 3px 0px 0px;
}

I created class notation in my css  for the workbench window shell:
Shell-Titlebar.myWorkbenchShellTitle {
  color: white;
  background-color: rgb(27, 19, 114);
  padding: 2px 5px 2px;
  margin: 0px;
  height: 50px;
  font: bold 19px  verdana, arial, sans-serif;
  border: none;
  border-radius: 0px;
}
and set the variant in postWindowCreate() method of my ApplicationWorkbenchWindowAdvisor class
 
    @Override
    public void postWindowCreate(){
            getWindowConfigurer().getWindow().getShell()
                .setData(WidgetUtil.CUSTOM_VARIANT, "myWorkbenchShellTitle");
getWindowConfigurer().getWindow().getShell().setTitle("My application title");
}

The background color and border styles worked, but when the height was set to 50px, the main window menu overlapped the shell title. The font size did not change too.
If I change these settings in the Shell-Titlebar (not custom variant) they work, the menu is displayed properly, but they apply to every single shell.


Reproducible: Always

Steps to Reproduce:
1.Register theme and branding
2.In the theme css define Shell-Titlebar custom variant setting with height more than 28px and font size more than 12px.
3.Set the variant in the WorkbenchWindow shell.
Comment 1 Ivan Furnadjiev CLA 2011-04-20 05:21:38 EDT
I found two problems:
1. The custom variant is not propagated to Shell#_captionTitle, thus setting the font from the custom variant has no effect.
2. ShellThemeAdapter always get title bar margin and height from the default selector. We should get them from the custom variant if set.
Comment 2 Ivan Furnadjiev CLA 2011-04-20 06:42:27 EDT
Set the custom variant on Shell#_captionTitle as well. Changed ShellThemeAdapter to get the title bar values by getCssBoxDimension and getCssDimension. Thus, the custom variant is respected. Changes are in CVS HEAD.