@@ -491,41 +491,41 @@ function TAddButtonControl.GetPolygons: IChromeTabPolygons;
491491 Result := TChromeTabPolygons.Create;
492492
493493 Result.AddPolygon(BidiPolygon(
494- NewPolygon(BidiControlRect, [Point(7 , RectHeight(BidiControlRect)),
495- Point(4 , RectHeight(BidiControlRect) - 2 ),
496- Point(0 , 2 ),
497- Point(1 , 0 ),
498- Point(RectWidth(BidiControlRect) - 7 , 0 ),
499- Point(RectWidth(BidiControlRect) - 4 , 2 ),
500- Point(RectWidth(BidiControlRect), RectHeight(BidiControlRect) - 2 ),
494+ NewPolygon(BidiControlRect, [Point(MulDiv( 7 ,Screen.PixelsPerInch, 96 ) , RectHeight(BidiControlRect)),
495+ Point(MulDiv( 4 ,Screen.PixelsPerInch, 96 ), RectHeight(BidiControlRect) - MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
496+ Point(0 , MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
497+ Point(MulDiv( 1 ,Screen.PixelsPerInch, 96 ) , 0 ),
498+ Point(RectWidth(BidiControlRect) - MulDiv( 7 ,Screen.PixelsPerInch, 96 ) , 0 ),
499+ Point(RectWidth(BidiControlRect) - MulDiv( 4 ,Screen.PixelsPerInch, 96 ), MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
500+ Point(RectWidth(BidiControlRect), RectHeight(BidiControlRect) - MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
501501 Point(RectWidth(BidiControlRect), RectHeight(BidiControlRect))],
502502 ChromeTabs.GetOptions.Display.Tabs.Orientation)),
503503 GetButtonBrush,
504504 GetButtonPen);
505505
506506 if ChromeTabs.GetOptions.Display.AddButton.ShowPlusSign then
507507 begin
508- LeftOffset := (ChromeTabs.GetOptions.Display.AddButton.Width div 2 ) - 4 ;
509- TopOffset := (ChromeTabs.GetOptions.Display.AddButton.Height div 2 ) - 4 ;
508+ LeftOffset := (ChromeTabs.GetOptions.Display.AddButton.Width div 2 ) - MulDiv( 4 ,Screen.PixelsPerInch, 96 ) ;
509+ TopOffset := (ChromeTabs.GetOptions.Display.AddButton.Height div 2 ) - MulDiv( 4 ,Screen.PixelsPerInch, 96 ) ;
510510
511511 Result.AddPolygon(BidiPolygon(
512512 NewPolygon(Rect(BidiControlRect.Left + LeftOffset,
513513 BidiControlRect.Top + TopOffset,
514514 BidiControlRect.Right - LeftOffset,
515515 BidiControlRect.Bottom - TopOffset),
516- [Point(0 , 3 ),
517- Point(3 , 3 ),
518- Point(3 , 0 ),
519- Point(6 , 0 ),
520- Point(6 , 3 ),
521- Point(9 , 3 ),
522- Point(9 , 6 ),
523- Point(6 , 6 ),
524- Point(6 , 9 ),
525- Point(3 , 9 ),
526- Point(3 , 6 ),
527- Point(0 , 6 ),
528- Point(0 , 3 )],
516+ [Point(0 , MulDiv( 3 ,Screen.PixelsPerInch, 96 ) ),
517+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ), MulDiv( 3 ,Screen.PixelsPerInch, 96 ) ),
518+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ) , 0 ),
519+ Point(MulDiv( 6 ,Screen.PixelsPerInch, 96 ) , 0 ),
520+ Point(MulDiv( 6 ,Screen.PixelsPerInch, 96 ), MulDiv( 3 ,Screen.PixelsPerInch, 96 ) ),
521+ Point(MulDiv( 9 ,Screen.PixelsPerInch, 96 ), MulDiv( 3 ,Screen.PixelsPerInch, 96 ) ),
522+ Point(MulDiv( 9 ,Screen.PixelsPerInch, 96 ), MulDiv( 6 ,Screen.PixelsPerInch, 96 ) ),
523+ Point(MulDiv( 6 ,Screen.PixelsPerInch, 96 ), MulDiv( 6 ,Screen.PixelsPerInch, 96 ) ),
524+ Point(MulDiv( 6 ,Screen.PixelsPerInch, 96 ), MulDiv( 9 ,Screen.PixelsPerInch, 96 ) ),
525+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ), MulDiv( 9 ,Screen.PixelsPerInch, 96 ) ),
526+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ), MulDiv( 6 ,Screen.PixelsPerInch, 96 ) ),
527+ Point(0 , MulDiv( 6 ,Screen.PixelsPerInch, 96 ) ),
528+ Point(0 , MulDiv( 3 ,Screen.PixelsPerInch, 96 ) )],
529529 ChromeTabs.GetOptions.Display.Tabs.Orientation)),
530530 GetSymbolBrush,
531531 GetSymbolPen);
@@ -558,7 +558,6 @@ procedure TAddButtonControl.SetStylePropertyClasses;
558558constructor TAddButtonControl.Create(ChromeTabs: IChromeTabs);
559559begin
560560 inherited Create(ChromeTabs);
561-
562561 FControlType := itAddButton;
563562
564563 FButtonStyle := ChromeTabs.GetLookAndFeel.AddButton.Button.Normal;
@@ -813,16 +812,16 @@ function TChromeTabControl.GetPolygons: IChromeTabPolygons;
813812 Result := TChromeTabPolygons.Create;
814813
815814 Result.AddPolygon(NewPolygon(BidiControlRect, [Point(0 , RectHeight(ControlRect)),
816- Point(4 , RectHeight(ControlRect) - 3 ),
817- Point(12 , 3 ),
818- Point(13 , 2 ),
819- Point(14 , 1 ),
820- Point(16 , 0 ),
821- Point(RectWidth(ControlRect) - 16 , 0 ),
822- Point(RectWidth(ControlRect) - 14 , 1 ),
823- Point(RectWidth(ControlRect) - 13 , 2 ),
824- Point(RectWidth(ControlRect) - 12 , 3 ),
825- Point(RectWidth(ControlRect) - 4 , RectHeight(ControlRect) - 3 ),
815+ Point(MulDiv( 4 , Screen.PixelsPerInch, 96 ), RectHeight(ControlRect) - MulDiv( 3 , Screen.PixelsPerInch, 96 ) ),
816+ Point(MulDiv( 12 , Screen.PixelsPerInch, 96 ), MulDiv( 3 , Screen.PixelsPerInch, 96 ) ),
817+ Point(MulDiv( 13 , Screen.PixelsPerInch, 96 ), MulDiv( 2 , Screen.PixelsPerInch, 96 ) ),
818+ Point(MulDiv( 14 , Screen.PixelsPerInch, 96 ), MulDiv( 1 , Screen.PixelsPerInch, 96 ) ),
819+ Point(MulDiv( 16 , Screen.PixelsPerInch, 96 ) , 0 ),
820+ Point(RectWidth(ControlRect) - MulDiv( 16 , Screen.PixelsPerInch, 96 ) , 0 ),
821+ Point(RectWidth(ControlRect) - MulDiv( 14 , Screen.PixelsPerInch, 96 ), MulDiv( 1 , Screen.PixelsPerInch, 96 ) ),
822+ Point(RectWidth(ControlRect) - MulDiv( 13 , Screen.PixelsPerInch, 96 ), MulDiv( 2 , Screen.PixelsPerInch, 96 ) ),
823+ Point(RectWidth(ControlRect) - MulDiv( 12 , Screen.PixelsPerInch, 96 ), MulDiv( 3 , Screen.PixelsPerInch, 96 ) ),
824+ Point(RectWidth(ControlRect) - MulDiv( 4 , Screen.PixelsPerInch, 96 ), RectHeight(ControlRect) - MulDiv( 3 , Screen.PixelsPerInch, 96 ) ),
826825 Point(RectWidth(ControlRect), RectHeight(ControlRect))],
827826 ChromeTabs.GetOptions.Display.Tabs.Orientation),
828827 GetTabBrush,
@@ -958,7 +957,7 @@ procedure TChromeTabControl.CalculateRects(var ImageRect, TextRect,
958957
959958 if CloseButtonVisible then
960959 begin
961- RightOffset := CloseButtonRect.Left - 1
960+ RightOffset := CloseButtonRect.Left - MulDiv( 1 ,Screen.PixelsPerInch, 96 )
962961 end
963962 else
964963 begin
@@ -1034,14 +1033,14 @@ procedure TChromeTabControl.CalculateRects(var ImageRect, TextRect,
10341033 LeftOffset + ImageWidth,
10351034 (ControlRect.Top + (RectHeight(ControlRect) div 2 ) - (ImageHeight div 2 )) + ImageHeight);
10361035
1037- LeftOffset := LeftOffset + ImageWidth + 1 ;
1036+ LeftOffset := LeftOffset + ImageWidth + MulDiv( 1 ,Screen.PixelsPerInch, 96 ) ;
10381037 end ;
10391038 end ;
10401039
10411040 // Does the Text fit?
10421041 TextVisible := ((not ChromeTab.GetPinned) or
10431042 (ChromeTabs.GetOptions.Display.Tabs.ShowPinnedTabText)) and
1044- (RightOffset - LeftOffset >= 5 );
1043+ (RightOffset - LeftOffset >= MulDiv( 5 ,Screen.PixelsPerInch, 96 ) );
10451044
10461045 if TextVisible then
10471046 begin
@@ -1619,10 +1618,10 @@ function TScrollButtonControl.GetArrowPolygons(
16191618 drLeft:
16201619 begin
16211620 Result.AddPolygon(BidiPolygon(
1622- NewPolygon(BidiControlRect, [Point(3 , RectHeight(ControlRect) div 2 ),
1623- Point(RectWidth(ControlRect) - 3 , 2 ),
1624- Point(RectWidth(ControlRect) - 3 , RectHeight(ControlRect) - 2 ),
1625- Point(3 , RectHeight(ControlRect) div 2 )],
1621+ NewPolygon(BidiControlRect, [Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ) , RectHeight(ControlRect) div 2 ),
1622+ Point(RectWidth(ControlRect) - MulDiv( 3 ,Screen.PixelsPerInch, 96 ), MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
1623+ Point(RectWidth(ControlRect) - MulDiv( 3 ,Screen.PixelsPerInch, 96 ), RectHeight(ControlRect) - MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
1624+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ) , RectHeight(ControlRect) div 2 )],
16261625 ChromeTabs.GetOptions.Display.Tabs.Orientation)),
16271626 GetSymbolBrush,
16281627 GetSymbolPen);
@@ -1631,10 +1630,10 @@ function TScrollButtonControl.GetArrowPolygons(
16311630 drRight:
16321631 begin
16331632 Result.AddPolygon(BidiPolygon(
1634- NewPolygon(BidiControlRect, [Point(RectWidth(ControlRect) - 3 , RectHeight(ControlRect) div 2 ),
1635- Point(3 , 2 ),
1636- Point(3 , RectHeight(ControlRect) - 2 ),
1637- Point(RectWidth(ControlRect) - 3 , RectHeight(ControlRect) div 2 )],
1633+ NewPolygon(BidiControlRect, [Point(RectWidth(ControlRect) - MulDiv( 3 ,Screen.PixelsPerInch, 96 ) , RectHeight(ControlRect) div 2 ),
1634+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ), MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
1635+ Point(MulDiv( 3 ,Screen.PixelsPerInch, 96 ), RectHeight(ControlRect) - MulDiv( 2 ,Screen.PixelsPerInch, 96 ) ),
1636+ Point(RectWidth(ControlRect) - MulDiv( 3 ,Screen.PixelsPerInch, 96 ) , RectHeight(ControlRect) div 2 )],
16381637 ChromeTabs.GetOptions.Display.Tabs.Orientation)),
16391638 GetSymbolBrush,
16401639 GetSymbolPen);
0 commit comments