Skip to content

Commit abb6a36

Browse files
committed
Corrected the position of the star on the tray icons in auto mode
1 parent 70a3dda commit abb6a36

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

units/langtool.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function CreateTrayIconLang(Form: TForm; const ALang1: string; const ALang2: str
7878
IntfImg: TLazIntfImage;
7979
ImgHandle, ImgMaskHandle: HBitmap;
8080
rect, rect1, rect2: TRect;
81+
delta: integer;
8182
Value: string;
8283

8384
function FormatValue(const Value: string; DefSize: integer = 8): string;
@@ -148,12 +149,14 @@ function CreateTrayIconLang(Form: TForm; const ALang1: string; const ALang2: str
148149

149150
// lower half
150151
Value := FormatValue(ALang2, 7);
151-
rect2 := Types.Rect(rect.Left, (rect.Top + rect.Bottom) div 2, rect.Right, rect.Bottom);
152+
delta := ifthen(Value = DEF_AUTO, 3, 0);
153+
rect2 := Types.Rect(rect.Left, (rect.Top + rect.Bottom) div 2 + delta, rect.Right, rect.Bottom + delta);
152154
DrawText(Bmp.Canvas.Handle, PChar(Value), Length(Value), rect2,
153155
DT_CENTER or DT_VCENTER or DT_SINGLELINE);
154156
end;
155157

156158
IntfImg.LoadFromBitmap(Bmp.Handle, Bmp.MaskHandle);
159+
157160
// Copy it to a TBitmap
158161
IntfImg.CreateBitmaps(ImgHandle, ImgMaskHandle, False);
159162
Bmp.Handle := ImgHandle;

0 commit comments

Comments
 (0)