You've already forked lazarus-ccr
spktoolbar: Rename DividerLineColor to GutterFrameColor.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8737 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,3 +1,19 @@
|
|||||||
|
(*******************************************************************************
|
||||||
|
* *
|
||||||
|
* File: SpkPopup.pas *
|
||||||
|
* Description: Popup menu for Lazarus port of TSpkToolbar *
|
||||||
|
* Copyright: (c) 2023 by W. Pamler *
|
||||||
|
* License: Modified LGPL (with linking exception, like Lazarus LCL) *
|
||||||
|
' See "license.txt" in this installation *
|
||||||
|
* *
|
||||||
|
* Issues: *
|
||||||
|
* - The popup menu is not borderless - looks strange in Metro Dark *
|
||||||
|
* - Checkbox and radio button are drawn with theme services --> hardly *
|
||||||
|
* hardly visible in Metro Dark *
|
||||||
|
* - Submenu indicator triangle is black --> hardly visible in Metro Dark *
|
||||||
|
* *
|
||||||
|
*******************************************************************************)
|
||||||
|
|
||||||
unit SpkPopup;
|
unit SpkPopup;
|
||||||
|
|
||||||
{$mode objfpc}{$H+}
|
{$mode objfpc}{$H+}
|
||||||
@ -114,11 +130,11 @@ begin
|
|||||||
|
|
||||||
if not IsHot and (FAppearance.Popup.Style = psGutter) then
|
if not IsHot and (FAppearance.Popup.Style = psGutter) then
|
||||||
begin
|
begin
|
||||||
|
FrameColor := FAppearance.Popup.GutterLineColor;
|
||||||
ColorFrom := FAppearance.Popup.GutterGradientFromColor;
|
ColorFrom := FAppearance.Popup.GutterGradientFromColor;
|
||||||
ColorTo := FAppearance.Popup.GutterGradientToColor;
|
ColorTo := FAppearance.Popup.GutterGradientToColor;
|
||||||
GradientType := FAppearance.Popup.GutterGradientType;
|
GradientType := FAppearance.Popup.GutterGradientType;
|
||||||
TGUITools.DrawPopupItemRect(ACanvas, Rgutter, 0, ColorFrom, ColorTo, GradientType);
|
TGUITools.DrawPopupItemRect(ACanvas, Rgutter, 0, ColorFrom, ColorTo, GradientType);
|
||||||
FrameColor := FAppearance.Popup.GutterLineColor;
|
|
||||||
if FrameColor <> clNone then
|
if FrameColor <> clNone then
|
||||||
TGUITools.DrawVLine(ACanvas, Rgutter.Right+1, R.Top, R.Bottom, FrameColor);
|
TGUITools.DrawVLine(ACanvas, Rgutter.Right+1, R.Top, R.Bottom, FrameColor);
|
||||||
end;
|
end;
|
||||||
@ -213,7 +229,9 @@ begin
|
|||||||
if FAppearance.Popup.Style <> psGutter then
|
if FAppearance.Popup.Style <> psGutter then
|
||||||
x := DropDownMenuMargin;
|
x := DropDownMenuMargin;
|
||||||
y := (ARect.Top + ARect.Bottom) div 2;
|
y := (ARect.Top + ARect.Bottom) div 2;
|
||||||
TGUITools.DrawHLine(ACanvas, x, ARect.Right-DropdownMenuMargin, y, FAppearance.Popup.DividerLineColor);
|
FrameColor := FAppearance.Popup.GutterFrameColor;
|
||||||
|
if FrameColor <> clNone then
|
||||||
|
TGUITools.DrawHLine(ACanvas, x, ARect.Right-DropdownMenuMargin, y, FrameColor);
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
y := (ARect.Top + ARect.Bottom - hText) div 2;
|
y := (ARect.Top + ARect.Bottom - hText) div 2;
|
||||||
|
@ -347,7 +347,7 @@ type
|
|||||||
FCheckedGradientToColor: TColor;
|
FCheckedGradientToColor: TColor;
|
||||||
FCheckedGradientType: TBackgroundKind;
|
FCheckedGradientType: TBackgroundKind;
|
||||||
FDisabledCaptionColor: TColor;
|
FDisabledCaptionColor: TColor;
|
||||||
FDividerLineColor: TColor;
|
FGutterFrameColor: TColor;
|
||||||
FGutterGradientFromColor: TColor;
|
FGutterGradientFromColor: TColor;
|
||||||
FGutterGradientToColor: TColor;
|
FGutterGradientToColor: TColor;
|
||||||
FGutterGradientType: TBackgroundKind;
|
FGutterGradientType: TBackgroundKind;
|
||||||
@ -368,7 +368,7 @@ type
|
|||||||
procedure SetCheckedGradientToColor(const Value: TColor);
|
procedure SetCheckedGradientToColor(const Value: TColor);
|
||||||
procedure SetCheckedGradientType(const Value: TBackgroundKind);
|
procedure SetCheckedGradientType(const Value: TBackgroundKind);
|
||||||
procedure SetDisabledCaptionColor(const Value: TColor);
|
procedure SetDisabledCaptionColor(const Value: TColor);
|
||||||
procedure SetDividerLineColor(const Value: TColor);
|
procedure SetGutterFrameColor(const Value: TColor);
|
||||||
procedure SetGutterGradientFromColor(const Value: TColor);
|
procedure SetGutterGradientFromColor(const Value: TColor);
|
||||||
procedure SetGutterGradientToColor(const Value: TColor);
|
procedure SetGutterGradientToColor(const Value: TColor);
|
||||||
procedure SetGutterGradientType(const Value: TBackgroundKind);
|
procedure SetGutterGradientType(const Value: TBackgroundKind);
|
||||||
@ -400,7 +400,7 @@ type
|
|||||||
property CheckedGradientToColor: TColor read FCheckedGradientToColor write SetCheckedGradientToColor;
|
property CheckedGradientToColor: TColor read FCheckedGradientToColor write SetCheckedGradientToColor;
|
||||||
property CheckedGradientType: TBackgroundKind read FCheckedGradientType write SetCheckedGradientType;
|
property CheckedGradientType: TBackgroundKind read FCheckedGradientType write SetCheckedGradientType;
|
||||||
property DisabledCaptionColor: TColor read FDisabledCaptionColor write SetDisabledCaptionColor;
|
property DisabledCaptionColor: TColor read FDisabledCaptionColor write SetDisabledCaptionColor;
|
||||||
property DividerLineColor: TColor read FDividerLineColor write SetDividerLineColor;
|
property GutterFrameColor: TColor read FGutterFrameColor write SetGutterFrameColor;
|
||||||
property GutterGradientFromColor: TColor read FGutterGradientFromColor write SetGutterGradientFromColor;
|
property GutterGradientFromColor: TColor read FGutterGradientFromColor write SetGutterGradientFromColor;
|
||||||
property GutterGradientToColor: TColor read FGutterGradientToColor write SetGutterGradientToColor;
|
property GutterGradientToColor: TColor read FGutterGradientToColor write SetGutterGradientToColor;
|
||||||
property GutterGradientType: TBackgroundKind read FGutterGradientType write SetGutterGradientType;
|
property GutterGradientType: TBackgroundKind read FGutterGradientType write SetGutterGradientType;
|
||||||
@ -1780,7 +1780,12 @@ begin
|
|||||||
FCheckedGradientType := SrcAppearance.CheckedGradientType;
|
FCheckedGradientType := SrcAppearance.CheckedGradientType;
|
||||||
|
|
||||||
FDisabledCaptionColor := SrcAppearance.DisabledCaptionColor;
|
FDisabledCaptionColor := SrcAppearance.DisabledCaptionColor;
|
||||||
FDividerLineColor := SrcAppearance.DividerLineColor;
|
|
||||||
|
FGutterFrameColor := SrcAppearance.GutterFrameColor;
|
||||||
|
FGutterGradientFromColor := SrcAppearance.GutterGradientFromColor;
|
||||||
|
FGutterGradientToColor := SrcAppearance.GutterGradientToColor;
|
||||||
|
FGutterGradientType := SrcAppearance.GutterGradientType;
|
||||||
|
|
||||||
{
|
{
|
||||||
FIdleFrameColor := SrcAppearance.IdleFrameColor;
|
FIdleFrameColor := SrcAppearance.IdleFrameColor;
|
||||||
}
|
}
|
||||||
@ -1801,13 +1806,6 @@ begin
|
|||||||
FHotTrackInnerLightColor := SrcAppearance.HotTrackInnerLightColor;
|
FHotTrackInnerLightColor := SrcAppearance.HotTrackInnerLightColor;
|
||||||
FHotTrackInnerDarkColor := SrcAppearance.HotTrackInnerDarkColor;
|
FHotTrackInnerDarkColor := SrcAppearance.HotTrackInnerDarkColor;
|
||||||
FHotTrackBrightnessChange := SrcAppearance.HotTrackBrightnessChange;
|
FHotTrackBrightnessChange := SrcAppearance.HotTrackBrightnessChange;
|
||||||
FActiveFrameColor := SrcAppearance.ActiveFrameColor;
|
|
||||||
FActiveGradientFromColor := SrcAppearance.ActiveGradientFromColor;
|
|
||||||
FActiveGradientToColor := SrcAppearance.ActiveGradientToColor;
|
|
||||||
FActiveGradientType := SrcAppearance.ActiveGradientType;
|
|
||||||
FActiveInnerLightColor := SrcAppearance.ActiveInnerLightColor;
|
|
||||||
FActiveInnerDarkColor := SrcAppearance.ActiveInnerDarkColor;
|
|
||||||
FActiveCaptionColor := SrcAppearance.ActiveCaptionColor;
|
|
||||||
}
|
}
|
||||||
FStyle := SrcAppearance.Style;
|
FStyle := SrcAppearance.Style;
|
||||||
if FDispatch <> nil then
|
if FDispatch <> nil then
|
||||||
@ -1855,11 +1853,6 @@ begin
|
|||||||
if Assigned(SubNode) then
|
if Assigned(SubNode) then
|
||||||
FDisabledCaptionColor := Subnode.TextAsColor;
|
FDisabledCaptionColor := Subnode.TextAsColor;
|
||||||
|
|
||||||
// Divider line
|
|
||||||
Subnode := Node['DividerLineColor', false];
|
|
||||||
if Assigned(Subnode) then
|
|
||||||
FDividerLineColor := Subnode.TextAsColor;
|
|
||||||
|
|
||||||
// Idle
|
// Idle
|
||||||
Subnode := Node['IdleCaptionColor', false];
|
Subnode := Node['IdleCaptionColor', false];
|
||||||
if Assigned(Subnode) then
|
if Assigned(Subnode) then
|
||||||
@ -1892,6 +1885,10 @@ begin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gutter
|
// Gutter
|
||||||
|
Subnode := Node['GutterFrameColor', false];
|
||||||
|
if Assigned(Subnode) then
|
||||||
|
FGutterFrameColor := Subnode.TextAsColor;
|
||||||
|
|
||||||
Subnode := Node['GutterGradientFromColor', false];
|
Subnode := Node['GutterGradientFromColor', false];
|
||||||
if Assigned(Subnode) then
|
if Assigned(Subnode) then
|
||||||
FGutterGradientFromColor := Subnode.TextAsColor;
|
FGutterGradientFromColor := Subnode.TextAsColor;
|
||||||
@ -1961,10 +1958,10 @@ begin
|
|||||||
FCheckedGradientFromColor := rgb(255, 227, 149);
|
FCheckedGradientFromColor := rgb(255, 227, 149);
|
||||||
FCheckedGradientToColor := FCheckedGradientFromColor;
|
FCheckedGradientToColor := FCheckedGradientFromColor;
|
||||||
FCheckedGradientType := bkSolid;
|
FCheckedGradientType := bkSolid;
|
||||||
FDividerLineColor := rgb(141, 178, 227);
|
|
||||||
{
|
{
|
||||||
FIdleFrameColor := rgb(155, 183, 224);
|
FIdleFrameColor := rgb(155, 183, 224);
|
||||||
}
|
}
|
||||||
|
FGutterFrameColor := rgb(141, 178, 227);
|
||||||
FGutterGradientFromColor := rgb(233, 238, 238);
|
FGutterGradientFromColor := rgb(233, 238, 238);
|
||||||
FGutterGradientToColor := rgb(233, 238, 238);
|
FGutterGradientToColor := rgb(233, 238, 238);
|
||||||
FGutterGradientType := bkSolid;
|
FGutterGradientType := bkSolid;
|
||||||
@ -2007,12 +2004,12 @@ begin
|
|||||||
FCheckedGradientFromColor := rgb(255, 227, 149);
|
FCheckedGradientFromColor := rgb(255, 227, 149);
|
||||||
end;
|
end;
|
||||||
FCheckedGradientToColor := FCheckedGradientFromColor;
|
FCheckedGradientToColor := FCheckedGradientFromColor;
|
||||||
FDividerLineColor := $00BEBEBE;
|
|
||||||
|
|
||||||
FIdleCaptionColor := $0060655F;
|
FIdleCaptionColor := $0060655F;
|
||||||
FIdleGradientFromColor := rgb(250, 250, 250);
|
FIdleGradientFromColor := rgb(250, 250, 250);
|
||||||
FIdleGradientToColor := rgb(250, 250, 250);
|
FIdleGradientToColor := rgb(250, 250, 250);
|
||||||
FIdleGradientType := bkSolid;
|
FIdleGradientType := bkSolid;
|
||||||
|
FGutterFrameColor := $00BEBEBE;
|
||||||
FGutterGradientFromColor := rgb(239, 239, 239);
|
FGutterGradientFromColor := rgb(239, 239, 239);
|
||||||
FGutterGradientToColor := rgb(239, 239, 239);
|
FGutterGradientToColor := rgb(239, 239, 239);
|
||||||
FGutterGradientType := bkSolid;
|
FGutterGradientType := bkSolid;
|
||||||
@ -2052,9 +2049,8 @@ begin
|
|||||||
FCheckedGradientFromColor := $00F7EFE8;
|
FCheckedGradientFromColor := $00F7EFE8;
|
||||||
FCheckedGradientToColor := FCheckedGradientFromColor;
|
FCheckedGradientToColor := FCheckedGradientFromColor;
|
||||||
FCheckedGradientType := bkSolid;
|
FCheckedGradientType := bkSolid;
|
||||||
|
|
||||||
FDisabledCaptionColor := rgb(192, 192, 192);
|
FDisabledCaptionColor := rgb(192, 192, 192);
|
||||||
FDividerLineColor := $00D2D0CF;
|
FGutterFrameColor := $00D2D0CF;
|
||||||
FGutterGradientFromColor := rgb(239, 239, 239);
|
FGutterGradientFromColor := rgb(239, 239, 239);
|
||||||
FGutterGradientToColor := rgb(239, 239, 239);
|
FGutterGradientToColor := rgb(239, 239, 239);
|
||||||
FGutterGradientType := bkSolid;
|
FGutterGradientType := bkSolid;
|
||||||
@ -2096,7 +2092,7 @@ begin
|
|||||||
FCheckedGradientToColor := FCheckedGradientFromColor;
|
FCheckedGradientToColor := FCheckedGradientFromColor;
|
||||||
FCheckedGradientType := bkSolid;
|
FCheckedGradientType := bkSolid;
|
||||||
FDisabledCaptionColor := $787878;
|
FDisabledCaptionColor := $787878;
|
||||||
FDividerLineColor := $000000;
|
FGutterFrameColor := $000000;
|
||||||
FGutterGradientFromColor := clBlack;
|
FGutterGradientFromColor := clBlack;
|
||||||
FGutterGradientToColor := clBlack;
|
FGutterGradientToColor := clBlack;
|
||||||
FGutterGradientType := bkSolid;
|
FGutterGradientType := bkSolid;
|
||||||
@ -2139,8 +2135,8 @@ begin
|
|||||||
Add(' CheckedGradientType := %s;', [GradientTypeName(FCheckedGradientType)]);
|
Add(' CheckedGradientType := %s;', [GradientTypeName(FCheckedGradientType)]);
|
||||||
|
|
||||||
Add(' DisabledCaptionColor := $%.8x;', [FDisabledCaptionColor]);
|
Add(' DisabledCaptionColor := $%.8x;', [FDisabledCaptionColor]);
|
||||||
Add(' DividerLineColor := $%.8x;', [FDividerLineColor]);
|
|
||||||
|
|
||||||
|
Add(' GutterFrameColor := $%.8x;', [FGutterFrameColor]);
|
||||||
Add(' GutterGradientFromColor := $%.8x;', [FGutterGradientFromColor]);
|
Add(' GutterGradientFromColor := $%.8x;', [FGutterGradientFromColor]);
|
||||||
Add(' GutterGradientToColor := $%.8x;', [FGutterGradientToColor]);
|
Add(' GutterGradientToColor := $%.8x;', [FGutterGradientToColor]);
|
||||||
Add(' GutterGradientType := %s;', [GradientTypeName(FGutterGradientType)]);
|
Add(' GutterGradientType := %s;', [GradientTypeName(FGutterGradientType)]);
|
||||||
@ -2185,9 +2181,6 @@ begin
|
|||||||
Subnode := Node['DisabledCaptionColor', true];
|
Subnode := Node['DisabledCaptionColor', true];
|
||||||
Subnode.TextAsColor := FDisabledCaptionColor;
|
Subnode.TextAsColor := FDisabledCaptionColor;
|
||||||
|
|
||||||
Subnode := Node['DividerLineColor', true];
|
|
||||||
Subnode.TextAsColor := FDividerlineColor;
|
|
||||||
|
|
||||||
Subnode := Node['IdleGradientType', true];
|
Subnode := Node['IdleGradientType', true];
|
||||||
Subnode.TextAsInteger := integer(FIdleGradientType);
|
Subnode.TextAsInteger := integer(FIdleGradientType);
|
||||||
|
|
||||||
@ -2195,9 +2188,6 @@ begin
|
|||||||
Subnode := Node['IdleCaptionColor', true];
|
Subnode := Node['IdleCaptionColor', true];
|
||||||
Subnode.TextAsColor := FIdleCaptionColor;
|
Subnode.TextAsColor := FIdleCaptionColor;
|
||||||
|
|
||||||
// Subnode := Node['IdleFrameColor', true];
|
|
||||||
// Subnode.TextAsColor := FIdleFrameColor;
|
|
||||||
|
|
||||||
Subnode := Node['IdleGradientFromColor', true];
|
Subnode := Node['IdleGradientFromColor', true];
|
||||||
Subnode.TextAsColor := FIdleGradientFromColor;
|
Subnode.TextAsColor := FIdleGradientFromColor;
|
||||||
|
|
||||||
@ -2206,15 +2196,11 @@ begin
|
|||||||
|
|
||||||
Subnode := Node['IdleGradientType', true];
|
Subnode := Node['IdleGradientType', true];
|
||||||
Subnode.TextAsInteger := integer(FIdleGradientType);
|
Subnode.TextAsInteger := integer(FIdleGradientType);
|
||||||
{
|
|
||||||
Subnode := Node['IdleInnerLightColor', true];
|
|
||||||
Subnode.TextAsColor := FIdleInnerLightColor;
|
|
||||||
|
|
||||||
Subnode := Node['IdleInnerDarkColor', true];
|
|
||||||
Subnode.TextAsColor := FIdleInnerDarkColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gutter
|
// Gutter
|
||||||
|
Subnode := Node['GutterFrameColor', true];
|
||||||
|
Subnode.TextAsColor := FGutterFrameColor;
|
||||||
|
|
||||||
Subnode := Node['GutterGradientFromColor', true];
|
Subnode := Node['GutterGradientFromColor', true];
|
||||||
Subnode.TextAsColor := FGutterGradientFromColor;
|
Subnode.TextAsColor := FGutterGradientFromColor;
|
||||||
|
|
||||||
@ -2301,9 +2287,9 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpkPopupMenuAppearance.SetDividerLineColor(const Value: TColor);
|
procedure TSpkPopupMenuAppearance.SetGutterFrameColor(const Value: TColor);
|
||||||
begin
|
begin
|
||||||
FDividerLineColor := Value;
|
FGutterFrameColor := Value;
|
||||||
if FDispatch <> nil then
|
if FDispatch <> nil then
|
||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user