mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 12:00:18 +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;
|
function TQtTabWidget.tabAt(APoint: TPoint): Integer;
|
||||||
var
|
var
|
||||||
AQtPoint: TQtPoint;
|
AQtPoint: TQtPoint;
|
||||||
|
R: TRect;
|
||||||
begin
|
begin
|
||||||
if (APoint.Y < 0) or (APoint.X < 0) then
|
if (APoint.Y < 0) or (APoint.X < 0) then
|
||||||
begin
|
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);
|
QWidget_pos(getStackWidget, @AQtPoint);
|
||||||
AQtPoint.x := AQtPoint.x + APoint.x;
|
AQtPoint.x := AQtPoint.x + APoint.x;
|
||||||
AQtPoint.y := AQtPoint.y + APoint.y;
|
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
|
end else
|
||||||
AQtPoint := QtPoint(APoint.x, APoint.y);
|
AQtPoint := QtPoint(APoint.x, APoint.y);
|
||||||
Result := QTabBar_tabAt(QTabBarH(TabBar.Widget), @AQtPoint);
|
Result := QTabBar_tabAt(QTabBarH(TabBar.Widget), @AQtPoint);
|
||||||
|
Loading…
Reference in New Issue
Block a user