mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 04:38:13 +02:00
LCL: fixed GetDefaultColor for TStaticText, TNoteBook, TTabSheet, TGroupBox, bug #26535
git-svn-id: trunk@46021 -
This commit is contained in:
parent
1dfcf970e9
commit
fe227ded7f
@ -48,8 +48,8 @@ uses
|
||||
FPReadJpeg, FPWriteJpeg, // jpg support
|
||||
FPReadTiff, FPTiffCmn, // tiff support
|
||||
FPReadGif,
|
||||
IntfGraphics,
|
||||
AvgLvlTree,
|
||||
IntfGraphics,
|
||||
LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache,
|
||||
GraphType, IcnsTypes, GraphMath, WSReferences;
|
||||
|
||||
|
@ -1266,8 +1266,8 @@ end;
|
||||
function TControl.GetDefaultColor(const DefaultColorType: TDefaultColorType): TColor;
|
||||
const
|
||||
DefColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clForm,
|
||||
{ dctFont } clBtnText
|
||||
{ dctBrush } clWindow,
|
||||
{ dctFont } clWindowText
|
||||
);
|
||||
begin
|
||||
Result := TWSControlClass(WidgetSetClass).GetDefaultColor(Self, DefaultColorType);
|
||||
|
@ -1101,13 +1101,8 @@ end;
|
||||
{ TGtk3WSButtonControl }
|
||||
|
||||
class function TGtk3WSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
|
||||
const
|
||||
DefColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clBtnFace,
|
||||
{ dctFont } clBtnText
|
||||
);
|
||||
begin
|
||||
Result := DefColors[ADefaultColorType];
|
||||
Result := DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -90,6 +90,8 @@ type
|
||||
|
||||
TWSTabSheet = class(TWSCustomPage)
|
||||
published
|
||||
class function GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor; override;
|
||||
end;
|
||||
|
||||
{ TWSPageControl }
|
||||
@ -260,6 +262,14 @@ implementation
|
||||
uses
|
||||
LResources;
|
||||
|
||||
{ TWSTabSheet }
|
||||
|
||||
class function TWSTabSheet.GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor;
|
||||
begin
|
||||
Result:=DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
{ TWSCustomPage }
|
||||
|
||||
class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage);
|
||||
@ -401,13 +411,8 @@ begin
|
||||
end;
|
||||
|
||||
class function TWSStatusBar.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
|
||||
const
|
||||
DefColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clBtnFace,
|
||||
{ dctFont } clBtnText
|
||||
);
|
||||
begin
|
||||
Result := DefColors[ADefaultColorType];
|
||||
Result := DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
{ TWSCustomListView }
|
||||
|
@ -34,17 +34,22 @@ interface
|
||||
// the uses clause of the XXXintf.pp
|
||||
////////////////////////////////////////////////////
|
||||
uses
|
||||
Classes,
|
||||
Classes, Types,
|
||||
////////////////////////////////////////////////////
|
||||
// To get as little as posible circles,
|
||||
// To get as little as possible circles,
|
||||
// uncomment only when needed for registration
|
||||
////////////////////////////////////////////////////
|
||||
Controls, Graphics, LCLType, Types,
|
||||
Controls, Graphics, LCLType,
|
||||
////////////////////////////////////////////////////
|
||||
WSLCLClasses, WSImgList,
|
||||
{ TODO: remove when CreateHandle/Component code moved }
|
||||
InterfaceBase, WSFactory;
|
||||
|
||||
const
|
||||
DefBtnColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clBtnFace,
|
||||
{ dctFont } clBtnText
|
||||
);
|
||||
type
|
||||
{ TWSDragImageList }
|
||||
|
||||
|
@ -53,6 +53,8 @@ type
|
||||
|
||||
TWSNotebook = class(TWSCustomControl)
|
||||
published
|
||||
class function GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor; override;
|
||||
end;
|
||||
|
||||
{ TWSShape }
|
||||
@ -173,6 +175,14 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
{ TWSNotebook }
|
||||
|
||||
class function TWSNotebook.GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor;
|
||||
begin
|
||||
Result:=DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
{ TWSCustomTrayIcon }
|
||||
|
||||
class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||
@ -332,13 +342,8 @@ end;
|
||||
{ TWSCustomPanel }
|
||||
|
||||
class function TWSCustomPanel.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
|
||||
const
|
||||
DefColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clBtnFace,
|
||||
{ dctFont } clBtnText
|
||||
);
|
||||
begin
|
||||
Result := DefColors[ADefaultColorType];
|
||||
Result := DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -35,13 +35,14 @@ interface
|
||||
// the uses clause of the XXXintf.pp
|
||||
////////////////////////////////////////////////////
|
||||
uses
|
||||
Classes,
|
||||
////////////////////////////////////////////////////
|
||||
// To get as little as posible circles,
|
||||
// To get as little as possible circles,
|
||||
// uncomment only when needed for registration
|
||||
////////////////////////////////////////////////////
|
||||
Graphics, Controls, StdCtrls,
|
||||
////////////////////////////////////////////////////
|
||||
WSLCLClasses, WSControls, Classes, WSFactory, Clipbrd;
|
||||
Clipbrd, WSLCLClasses, WSControls, WSFactory;
|
||||
|
||||
type
|
||||
{ TWSScrollBar }
|
||||
@ -63,6 +64,7 @@ type
|
||||
|
||||
TWSGroupBox = class(TWSCustomGroupBox)
|
||||
published
|
||||
class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override;
|
||||
end;
|
||||
|
||||
{ TWSCustomComboBox }
|
||||
@ -198,6 +200,8 @@ type
|
||||
published
|
||||
class procedure SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment); virtual;
|
||||
class procedure SetStaticBorderStyle(const ACustomStaticText: TCustomStaticText; const NewBorderStyle: TStaticBorderStyle); virtual;
|
||||
class function GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor; override;
|
||||
end;
|
||||
|
||||
{ TWSStaticText }
|
||||
@ -271,6 +275,14 @@ implementation
|
||||
uses
|
||||
LResources;
|
||||
|
||||
{ TWSGroupBox }
|
||||
|
||||
class function TWSGroupBox.GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor;
|
||||
begin
|
||||
Result:=DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
{ TWSScrollBar }
|
||||
|
||||
class procedure TWSScrollBar.SetParams(const AScrollBar: TCustomScrollBar);
|
||||
@ -624,6 +636,12 @@ begin
|
||||
// nothing
|
||||
end;
|
||||
|
||||
class function TWSCustomStaticText.GetDefaultColor(const AControl: TControl;
|
||||
const ADefaultColorType: TDefaultColorType): TColor;
|
||||
begin
|
||||
Result:=DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
{ TWSButton }
|
||||
|
||||
class procedure TWSButton.SetDefault(const AButton: TCustomButton; ADefault: Boolean);
|
||||
@ -811,13 +829,8 @@ end;
|
||||
{ TWSButtonControl }
|
||||
|
||||
class function TWSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
|
||||
const
|
||||
DefColors: array[TDefaultColorType] of TColor = (
|
||||
{ dctBrush } clBtnFace,
|
||||
{ dctFont } clBtnText
|
||||
);
|
||||
begin
|
||||
Result := DefColors[ADefaultColorType];
|
||||
Result := DefBtnColors[ADefaultColorType];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user