mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 06:59:19 +02:00
Qt: fix TQtTabWidget.tabAt(), it must take into account theme tab geometry (eg. macOsX)
git-svn-id: trunk@23547 -
This commit is contained in:
parent
bd405b7edf
commit
15f98d8c3f
@ -6163,12 +6163,22 @@ end;
|
||||
function TQtTabWidget.tabAt(APoint: TPoint): Integer;
|
||||
var
|
||||
AQtPoint: TQtPoint;
|
||||
R: TRect;
|
||||
begin
|
||||
if (APoint.Y < 0) or (APoint.X < 0) then
|
||||
begin
|
||||
{some themes (eg. MacOSX) moves tab buttons
|
||||
into the middle of parent, so we must
|
||||
take it's geometry into account.}
|
||||
R := TabBar.getGeometry;
|
||||
QWidget_pos(getStackWidget, @AQtPoint);
|
||||
AQtPoint.x := AQtPoint.x + APoint.x;
|
||||
AQtPoint.y := AQtPoint.y + APoint.y;
|
||||
|
||||
if R.Left <> 0 then
|
||||
dec(AQtPoint.x, R.Left);
|
||||
if R.Top <> 0 then
|
||||
dec(AQtPoint.y, R.Top);
|
||||
end else
|
||||
AQtPoint := QtPoint(APoint.x, APoint.y);
|
||||
Result := QTabBar_tabAt(QTabBarH(TabBar.Widget), @AQtPoint);
|
||||
|
Loading…
Reference in New Issue
Block a user