Hi there,
Looks like RVRules doesn't support VCL styles.
What is the best way to assign correct style colors to it?
RVRuler and VCL styles
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: RVRuler and VCL styles
The ruler support VCL style colors. I do not think that more complete VCL style support is possible.
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: RVRuler and VCL styles
1) Which version of TRichView do you use?
2) What's the value of Ruler.RulerColor property?
2) What's the value of Ruler.RulerColor property?
Re: RVRuler and VCL styles
1) 18.3
2) clWindow
2) clWindow
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: RVRuler and VCL styles
VCL skins are completely supported if Ruler.SkinType = stNoSkin.
Your ruler has SkinType <> stNoSkin.
There is a way to improve skin supports in this mode.
In RVRulerBase.pas, change the procedure UpdateRulerColors:
Make this procedure public in TCustomRuler. Call it when the application starts and after each change of VCL theme.
But look at this code. In skin modes, the ruler has a predefined set of gray colors that can be shaded using RulerColor, and only in stSkin1 mode.
After the change I suggested, the ruler look betters in dark themes. But still not very good in inverted (light on dark) color themes.
If this shading is OK for you, you can improve the result by assigning inverted font color for inverted themes:
But the best solution is to assign RVRuler.SkinType = stNoSkin in these themes.
Your ruler has SkinType <> stNoSkin.
There is a way to improve skin supports in this mode.
In RVRulerBase.pas, change the procedure UpdateRulerColors:
Code: Select all
procedure TCustomRuler.UpdateRulerColors;
Begin
If FSkinType = stNoSkin then
Exit;
Move(DefRulerColors, FRulerColors, 40);
If ColorToRGB(GetSysColor(RulerColor)) <> clWhite then
ColorizeColorsAlter(FRulerColors, GetSysColor(RulerColor))
Else If FSkinType = stSkin2 then
ColorizeColorsAlter(FRulerColors, $00C0C0C0);
SaturationColors(FRulerColors, FRulSaturation);
end;
But look at this code. In skin modes, the ruler has a predefined set of gray colors that can be shaded using RulerColor, and only in stSkin1 mode.
After the change I suggested, the ruler look betters in dark themes. But still not very good in inverted (light on dark) color themes.
If this shading is OK for you, you can improve the result by assigning inverted font color for inverted themes:
Code: Select all
uses Themes, RVFuncs;
procedure TForm3.btnSkinClick(Sender: TObject);
begin
RVA_ChooseStyle;
RVRuler1.UpdateRulerColors;
if RV_GetLuminance(StyleServices.GetSystemColor(clWindowText)) >
RV_GetLuminance(StyleServices.GetSystemColor(clWindow)) then
RVRuler1.Font.Color := not StyleServices.GetSystemColor(clWindowText) and $FFFFFF
else
RVRuler1.Font.Color := clWindowText;
end;