Ticket T1195057
Visible to All Users

Unable to add form frame with The Bezier

created a year ago

We've been getting (lots) of complaints from our users about the lack of form frames in the dark color schemes of the The Bezier skin.

The problem, as you probably know, is that, for some skin palettes, the fact that the form caption bar, form background, and frame have the same color makes overlapping forms blend together.

Here's what forms using the Default palette looks like (in the skin editor):
Clipboard-File-1.png
That's okay, but then look at something like Ghost Shark:
Clipboard-File-2.png
And it's the same for most of the dark skins, save a couple.

I don't know what your designers were thinking when they implemented this but it's clearly not usable.

Since this has been a known problem since the skin was introduced you clearly aren't going to fix it in the skin. We could fix it ourselves with the skin editor but that would mean that we would have to reapply these changes every time we update the library. We've been down that path before and it's just not a maintainable solution.

So in order to fix the problem, without modifying the skin files, we decided to fix it at runtime, in code:

Delphi
// Patch the skin (we assume it's Bezier) to show a thin border around the form and captionbar RootLookAndFeel.BeginUpdate; try var PainterInfo: TdxSkinLookAndFeelPainterInfo; if (RootLookAndFeel.Painter.GetPainterData(PainterInfo)) then begin var Group: TdxSkinControlGroup; var CaptionElement: TdxSkinElement := nil; if PainterInfo.Skin.GetGroupByName('Form', Group) then if not Group.GetElementByName('FormCaption', CaptionElement) then CaptionElement := nil; for var Border := Low(TcxBorder) to High(TcxBorder) do begin // The caption bar frame if (CaptionElement <> nil) and (CaptionElement.Borders[Border].Color = clNone) then begin // left and right caption bar border (top doesn't appear to be used) if (Border <> bBottom) then CaptionElement.Borders[Border].ColorReference := 'Brush Light' else // Bottom caption bar border CaptionElement.Borders[bBottom].ColorReference := 'Brush Minor'; end; // The form frame; Top caption bar border, left, right, and bottom form border // BorderStyle = bsToolWindow or bsSizeToolWin if (PainterInfo.FormFrames[False, Border].Borders[Border].Color = clNone) then PainterInfo.FormFrames[False, Border].Borders[Border].ColorReference := 'Brush Light'; // everything else if (PainterInfo.FormFrames[True, Border].Borders[Border].Color = clNone) then PainterInfo.FormFrames[True, Border].Borders[Border].ColorReference := 'Brush Light'; end; end; RootLookAndFeel.Refresh; finally RootLookAndFeel.EndUpdate; end;

This appear to solve the problem for regular forms:
Clipboard-File-4.png
… but for tool windows we have been unable to modify the left, right, and bottom caption bar border:
Clipboard-File-5.png

I suspect that the test of the color against clNone should really be testing the palette Key Paint color against the Paint color because all the palettes have a frame color of clNone. Even those that already have a border.

So the question is: How do we go about ensuring that a given palette always produce a visible form border?

Comments (1)
AM AM
Anders Melander a year ago

    Ah… Yes, of course.

    Clipboard-File-2.png

    For some reason I didn't think of using GetElementByName to style the tool window caption bar, like I did with the regular form caption bar. Silly me.

    Thank you for the help.

    Answers approved by DevExpress Support

    created a year ago

    Hello,

    Thank you for the detailed description.

    If you use the ToolWindow border style, you need to change borders for the SmallFormCaption skin element.

    Should you have further questions, feel free to contact me. I will be happy to follow up.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.