| Summary: | [Theming] shell custom variant not working as expected | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Penka <pveleva> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | 1.4 M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
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. 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. |
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.