Changeset 581
- Timestamp:
- Dec 10, 2024, 4:50:34 PM (11 days ago)
- Location:
- Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/MetaCanvas.pas
r563 r581 150 150 procedure SetWidth(AValue: Integer); override; 151 151 function GetWidth: Integer; override; 152 procedure DoLine (x1,y1,x2,y2:integer); override;152 procedure DoLine(X1, Y1, X2, Y2: Integer); override; 153 153 procedure DoTextOut(X, Y: Integer; Text: string); override; 154 154 procedure DoRectangle(const Bounds: TRect); override; … … 563 563 end; 564 564 565 procedure TMetaCanvas.DoLine( x1, y1, x2, y2: integer);565 procedure TMetaCanvas.DoLine(X1, Y1, X2, Y2: integer); 566 566 var 567 567 NewObj: TCanvasLine; -
Common/RegistryEx.pas
r571 r581 36 36 function ReadFloatWithDefault(const Name: string; 37 37 DefaultValue: Double): Double; 38 function ReadDateTimeWithDefault(const Name: string; DefaultValue: TDateTime): TDateTime; 38 39 function DeleteKeyRecursive(const Key: string): Boolean; 39 40 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; … … 110 111 end; 111 112 113 function TRegistryEx.ReadDateTimeWithDefault(const Name: string; 114 DefaultValue: TDateTime): TDateTime; 115 begin 116 if ValueExists(Name) then Result := ReadDateTime(Name) 117 else begin 118 WriteDateTime(Name, DefaultValue); 119 Result := DefaultValue; 120 end; 121 end; 122 112 123 function TRegistryEx.DeleteKeyRecursive(const Key: string): Boolean; 113 124 var -
Common/Theme.pas
r563 r581 30 30 private 31 31 FTheme: TTheme; 32 function Gray(C: TColor): Byte; 32 33 procedure SetTheme(AValue: TTheme); 33 34 procedure SetThemeName(AValue: TTheme); … … 35 36 Used: Boolean; 36 37 Themes: TThemes; 38 function IsDarkTheme: Boolean; 37 39 procedure ApplyTheme(Component: TComponent); 38 40 constructor Create(AOwner: TComponent); override; … … 93 95 Strings.EndUpdate; 94 96 end; 97 end; 98 99 { TThemeManager } 100 101 function TThemeManager.Gray(C: TColor): Byte; 102 begin 103 Result := Trunc(Red(C) * 0.3 + Green(C) * 0.59 + Blue(C) * 0.11); 104 end; 105 106 function TThemeManager.IsDarkTheme: Boolean; 107 begin 108 Result := Gray(ColorToRGB(clWindow)) < Gray(ColorToRGB(clWindowText)); 95 109 end; 96 110
Note:
See TracChangeset
for help on using the changeset viewer.