mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:39:18 +02:00
carbon: fix titlebar button drawing by ThemeManager (paul)
git-svn-id: trunk@41875 -
This commit is contained in:
parent
e4a431af6a
commit
558db885c8
@ -376,6 +376,7 @@ var
|
|||||||
WindowWidgetDrawInfo: HIThemeWindowWidgetDrawInfo;
|
WindowWidgetDrawInfo: HIThemeWindowWidgetDrawInfo;
|
||||||
BtnRect: HIRect;
|
BtnRect: HIRect;
|
||||||
WindowShape: HIShapeRef;
|
WindowShape: HIShapeRef;
|
||||||
|
WindowRegion: WindowRegionCode;
|
||||||
Offset: TPoint;
|
Offset: TPoint;
|
||||||
begin
|
begin
|
||||||
WindowWidgetDrawInfo.version := 0;
|
WindowWidgetDrawInfo.version := 0;
|
||||||
@ -390,21 +391,25 @@ begin
|
|||||||
WP_MDIMINBUTTON:
|
WP_MDIMINBUTTON:
|
||||||
begin
|
begin
|
||||||
WindowWidgetDrawInfo.widgetType := kThemeWidgetCollapseBox;
|
WindowWidgetDrawInfo.widgetType := kThemeWidgetCollapseBox;
|
||||||
|
WindowRegion := kWindowCollapseBoxRgn;
|
||||||
end;
|
end;
|
||||||
WP_MAXBUTTON:
|
WP_MAXBUTTON:
|
||||||
begin
|
begin
|
||||||
WindowWidgetDrawInfo.widgetType := kThemeWidgetZoomBox;
|
WindowWidgetDrawInfo.widgetType := kThemeWidgetZoomBox;
|
||||||
|
WindowRegion := kWindowZoomBoxRgn;
|
||||||
end;
|
end;
|
||||||
WP_CLOSEBUTTON,
|
WP_CLOSEBUTTON,
|
||||||
WP_SMALLCLOSEBUTTON,
|
WP_SMALLCLOSEBUTTON,
|
||||||
WP_MDICLOSEBUTTON:
|
WP_MDICLOSEBUTTON:
|
||||||
begin
|
begin
|
||||||
WindowWidgetDrawInfo.widgetType := kThemeWidgetCloseBox;
|
WindowWidgetDrawInfo.widgetType := kThemeWidgetCloseBox;
|
||||||
|
WindowRegion := kWindowCloseBoxRgn;
|
||||||
end;
|
end;
|
||||||
WP_RESTOREBUTTON,
|
WP_RESTOREBUTTON,
|
||||||
WP_MDIRESTOREBUTTON:
|
WP_MDIRESTOREBUTTON:
|
||||||
begin
|
begin
|
||||||
WindowWidgetDrawInfo.widgetType := kThemeWidgetZoomBox;
|
WindowWidgetDrawInfo.widgetType := kThemeWidgetZoomBox;
|
||||||
|
WindowRegion := kWindowZoomBoxRgn;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
Exit;
|
Exit;
|
||||||
@ -418,7 +423,7 @@ begin
|
|||||||
WindowDrawInfo.state := WindowWidgetDrawInfo.windowState;
|
WindowDrawInfo.state := WindowWidgetDrawInfo.windowState;
|
||||||
WindowDrawInfo.titleHeight := WindowWidgetDrawInfo.titleHeight;
|
WindowDrawInfo.titleHeight := WindowWidgetDrawInfo.titleHeight;
|
||||||
WindowDrawInfo.titleWidth := WindowWidgetDrawInfo.titleWidth;
|
WindowDrawInfo.titleWidth := WindowWidgetDrawInfo.titleWidth;
|
||||||
HIThemeGetWindowShape(BtnRect, WindowDrawInfo, kWindowTitleBarRgn, WindowShape);
|
HIThemeGetWindowShape(BtnRect, WindowDrawInfo, WindowRegion, WindowShape);
|
||||||
HIShapeGetBounds(WindowShape, BtnRect);
|
HIShapeGetBounds(WindowShape, BtnRect);
|
||||||
Offset := CGRectToRect(BtnRect).TopLeft;
|
Offset := CGRectToRect(BtnRect).TopLeft;
|
||||||
OffsetRect(R, -Offset.X, -Offset.Y);
|
OffsetRect(R, -Offset.X, -Offset.Y);
|
||||||
|
Loading…
Reference in New Issue
Block a user