spktoolbar: Add DividerLineColor to SpkPopupMenu appearance.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8732 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-22 15:04:00 +00:00
parent 29a4c0d8f3
commit 9a2c6006ee
2 changed files with 33 additions and 17 deletions

View File

@ -213,7 +213,7 @@ begin
if FAppearance.Popup.Style <> psGutter then
x := DropDownMenuMargin;
y := (ARect.Top + ARect.Bottom) div 2;
TGUITools.DrawHLine(ACanvas, x, ARect.Right-DropdownMenuMargin, y, TextColor);
TGUITools.DrawHLine(ACanvas, x, ARect.Right-DropdownMenuMargin, y, FAppearance.Popup.DividerLineColor);
end else
begin
y := (ARect.Top + ARect.Bottom - hText) div 2;

View File

@ -342,11 +342,12 @@ type
private
FDispatch: TSpkBaseAppearanceDispatch;
FCaptionFont: TFont;
FDisabledCaptionColor: TColor;
FCheckedFrameColor: TColor;
FCheckedGradientFromColor: TColor;
FCheckedGradientToColor: TColor;
FCheckedGradientType: TBackgroundKind;
FDisabledCaptionColor: TColor;
FDividerLineColor: TColor;
FGutterGradientFromColor: TColor;
FGutterGradientToColor: TColor;
FGutterGradientType: TBackgroundKind;
@ -367,6 +368,7 @@ type
procedure SetCheckedGradientToColor(const Value: TColor);
procedure SetCheckedGradientType(const Value: TBackgroundKind);
procedure SetDisabledCaptionColor(const Value: TColor);
procedure SetDividerLineColor(const Value: TColor);
procedure SetGutterGradientFromColor(const Value: TColor);
procedure SetGutterGradientToColor(const Value: TColor);
procedure SetGutterGradientType(const Value: TBackgroundKind);
@ -398,6 +400,7 @@ type
property CheckedGradientToColor: TColor read FCheckedGradientToColor write SetCheckedGradientToColor;
property CheckedGradientType: TBackgroundKind read FCheckedGradientType write SetCheckedGradientType;
property DisabledCaptionColor: TColor read FDisabledCaptionColor write SetDisabledCaptionColor;
property DividerLineColor: TColor read FDividerLineColor write SetDividerLineColor;
property GutterGradientFromColor: TColor read FGutterGradientFromColor write SetGutterGradientFromColor;
property GutterGradientToColor: TColor read FGutterGradientToColor write SetGutterGradientToColor;
property GutterGradientType: TBackgroundKind read FGutterGradientType write SetGutterGradientType;
@ -1772,6 +1775,7 @@ begin
FCheckedGradientType := SrcAppearance.CheckedGradientType;
FDisabledCaptionColor := SrcAppearance.DisabledCaptionColor;
FDividerLineColor := SrcAppearance.DividerLineColor;
{
FIdleFrameColor := SrcAppearance.IdleFrameColor;
}
@ -1841,12 +1845,16 @@ begin
if Assigned(Subnode) then
FCheckedGradientType := TBackgroundKind(Subnode.TextAsInteger);
// Disabled text
Subnode := Node['DisabledCaptionColor', false];
if Assigned(SubNode) then
FDisabledCaptionColor := Subnode.TextAsColor;
// Divider line
Subnode := Node['DividerLineColor', false];
if Assigned(Subnode) then
FDividerLineColor := Subnode.TextAsColor;
// Idle
Subnode := Node['IdleCaptionColor', false];
if Assigned(Subnode) then
@ -1948,6 +1956,7 @@ begin
FCheckedGradientFromColor := rgb(255, 227, 149);
FCheckedGradientToColor := FCheckedGradientFromColor;
FCheckedGradientType := bkSolid;
FDividerLineColor := rgb(141, 178, 227);
{
FIdleFrameColor := rgb(155, 183, 224);
}
@ -1993,9 +2002,8 @@ begin
FCheckedGradientFromColor := rgb(255, 227, 149);
end;
FCheckedGradientToColor := FCheckedGradientFromColor;
{
FIdleFrameColor := $00B8B1A9;
}
FDividerLineColor := $00BEBEBE;
FIdleCaptionColor := $0060655F;
FIdleGradientFromColor := rgb(250, 250, 250);
FIdleGradientToColor := rgb(250, 250, 250);
@ -2041,6 +2049,7 @@ begin
FCheckedGradientType := bkSolid;
FDisabledCaptionColor := rgb(192, 192, 192);
FDividerLineColor := $00D2D0CF;
FGutterGradientFromColor := rgb(239, 239, 239);
FGutterGradientToColor := rgb(239, 239, 239);
FGutterGradientType := bkSolid;
@ -2082,6 +2091,7 @@ begin
FCheckedGradientToColor := FCheckedGradientFromColor;
FCheckedGradientType := bkSolid;
FDisabledCaptionColor := $787878;
FDividerLineColor := $000000;
FGutterGradientFromColor := clBlack;
FGutterGradientToColor := clBlack;
FGutterGradientType := bkSolid;
@ -2123,13 +2133,13 @@ begin
Add(' CheckedGradientToColor := $' + IntToHex(FCheckedGradientToColor, 8) + ';');
Add(' CheckedGradientType := ' + GetEnumName(TypeInfo(TBackgroundKind), ord(FCheckedGradientType)) + ';');
Add(' DisabledCaptionColor := $' + IntToHex(FDisabledCaptionColor, 8) + ';');
Add(' DividerLineColor := $' + IntToHex(FDividerLineColor, 8) + ';');
Add(' IdleCaptionColor := $' + IntToHex(FIdleCaptionColor, 8) + ';');
// Add(' IdleFrameColor := $' + IntToHex(FIdleFrameColor, 8) + ';');
Add(' IdleGradientFromColor := $' + IntToHex(FIdleGradientFromColor, 8) + ';');
Add(' IdleGradientToColor := $' + IntToHex(FIdleGradientToColor, 8) + ';');
Add(' IdleGradientType := ' + GetEnumName(TypeInfo(TBackgroundKind), ord(FIdleGradientType)) + ';');
// Add(' IdleInnerDarkColor := $' + IntToHex(FIdleInnerDarkColor, 8) + ';');
// Add(' IdleInnerLightColor := $' + IntToHex(FIdleInnerLightColor, 8) + ';');
Add(' GutterGradientFromColor := $' + IntToHex(FGutterGradientFromColor, 8) + ';');
Add(' GutterGradientToColor := $' + IntToHex(FGutterGradientToColor, 8) + ';');
@ -2141,9 +2151,6 @@ begin
Add(' HotTrackGradientFromColor := $' + IntToHex(FHotTrackGradientFromColor, 8) + ';');
Add(' HotTrackGradientToColor := $' + IntToHex(FHotTrackGradientToColor, 8) + ';');
Add(' HotTrackGradientType := ' + GetEnumName(TypeInfo(TBackgroundKind), ord(FHotTrackGradientType)) + ';');
// Add(' HotTrackInnerDarkColor := $' + IntToHex(FHotTrackInnerDarkColor, 8) + ';');
// Add(' HotTrackInnerLightColor := $' + IntToHex(FHotTrackInnerLightColor, 8) + ';');
// Add(' HotTrackBrightnessChange := ' + IntToStr(FHotTrackBrightnessChange) + ';');
Add(' Style := ' + GetEnumName(TypeInfo(TSpkPopupStyle), ord(FStyle)) + ';');
Add(' end;');
@ -2170,6 +2177,12 @@ begin
Subnode := Node['CheckedGradientToColor', true];
Subnode.TextAsColor := FCheckedGradientToColor;
Subnode := Node['DisabledCaptionColor', true];
Subnode.TextAsColor := FDisabledCaptionColor;
Subnode := Node['DividerLineColor', true];
Subnode.TextAsColor := FDividerlineColor;
Subnode := Node['IdleGradientType', true];
Subnode.TextAsInteger := integer(FIdleGradientType);
@ -2197,7 +2210,7 @@ begin
}
// Gutter
Subnode := Node['ButterGradientFromColor', true];
Subnode := Node['GutterGradientFromColor', true];
Subnode.TextAsColor := FGutterGradientFromColor;
Subnode := Node['GutterGradientToColor', true];
@ -2276,10 +2289,6 @@ begin
FDispatch.NotifyAppearanceChanged;
end;
procedure TSpkPopupMenuAppearance.SetDisabledCaptionColor(const Value: TColor);
begin
FDisabledCaptionColor := Value;
@ -2287,6 +2296,13 @@ begin
FDispatch.NotifyAppearanceChanged;
end;
procedure TSpkPopupMenuAppearance.SetDividerLineColor(const Value: TColor);
begin
FDividerLineColor := Value;
if FDispatch <> nil then
FDispatch.NotifyAppearanceChanged;
end;
procedure TSpkPopupMenuAppearance.SetGutterGradientFromColor(const Value: TColor);
begin
FGutterGradientFromColor := Value;