mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 13:39:14 +02:00
Merged revision(s) 65395-65396 #77bfe9b324-#77bfe9b324 from trunk:
TPageControl: QT5: Fixed PageControl.GetTabRect, see project Issue #39166 ........ TPageControl: QT: Fixed PageControl.GetTabRect, see project Issue #39166 ........ git-svn-id: branches/fixes_2_2@65433 -
This commit is contained in:
parent
e790fe99ab
commit
d076d25f01
@ -441,17 +441,19 @@ class function TQtWSCustomTabControl.GetTabRect(const ATabControl: TCustomTabCon
|
|||||||
const AIndex: Integer): TRect;
|
const AIndex: Integer): TRect;
|
||||||
var
|
var
|
||||||
TabWidget: TQtTabWidget;
|
TabWidget: TQtTabWidget;
|
||||||
|
Offs: TRect;
|
||||||
begin
|
begin
|
||||||
Result := Rect(-1, -1, -1, -1);
|
Result := Rect(-1, -1, -1, -1);
|
||||||
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
||||||
Exit;
|
Exit;
|
||||||
TabWidget := TQtTabWidget(ATabControl.Handle);
|
TabWidget := TQtTabWidget(ATabControl.Handle);
|
||||||
|
Offs := TabWidget.getGeometry;
|
||||||
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
||||||
case ATabControl.TabPosition of
|
case ATabControl.TabPosition of
|
||||||
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
||||||
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
||||||
tpRight: OffsetRect(Result, Result.Left, 0);
|
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
|
||||||
tpBottom: OffsetRect(Result, Result.Top, 0);
|
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -442,17 +442,19 @@ class function TQtWSCustomTabControl.GetTabRect(const ATabControl: TCustomTabCon
|
|||||||
const AIndex: Integer): TRect;
|
const AIndex: Integer): TRect;
|
||||||
var
|
var
|
||||||
TabWidget: TQtTabWidget;
|
TabWidget: TQtTabWidget;
|
||||||
|
Offs: TRect;
|
||||||
begin
|
begin
|
||||||
Result := Rect(-1, -1, -1, -1);
|
Result := Rect(-1, -1, -1, -1);
|
||||||
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
||||||
Exit;
|
Exit;
|
||||||
TabWidget := TQtTabWidget(ATabControl.Handle);
|
TabWidget := TQtTabWidget(ATabControl.Handle);
|
||||||
|
Offs := TabWidget.getGeometry;
|
||||||
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
||||||
case ATabControl.TabPosition of
|
case ATabControl.TabPosition of
|
||||||
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
||||||
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
||||||
tpRight: OffsetRect(Result, Result.Left, 0);
|
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
|
||||||
tpBottom: OffsetRect(Result, Result.Top, 0);
|
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user