mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 09:00:25 +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;
|
||||
var
|
||||
TabWidget: TQtTabWidget;
|
||||
Offs: TRect;
|
||||
begin
|
||||
Result := Rect(-1, -1, -1, -1);
|
||||
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
||||
Exit;
|
||||
TabWidget := TQtTabWidget(ATabControl.Handle);
|
||||
Offs := TabWidget.getGeometry;
|
||||
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
||||
case ATabControl.TabPosition of
|
||||
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
||||
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
||||
tpRight: OffsetRect(Result, Result.Left, 0);
|
||||
tpBottom: OffsetRect(Result, Result.Top, 0);
|
||||
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
|
||||
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -442,17 +442,19 @@ class function TQtWSCustomTabControl.GetTabRect(const ATabControl: TCustomTabCon
|
||||
const AIndex: Integer): TRect;
|
||||
var
|
||||
TabWidget: TQtTabWidget;
|
||||
Offs: TRect;
|
||||
begin
|
||||
Result := Rect(-1, -1, -1, -1);
|
||||
if not WSCheckHandleAllocated(ATabControl, 'GetTabRect') then
|
||||
Exit;
|
||||
TabWidget := TQtTabWidget(ATabControl.Handle);
|
||||
Offs := TabWidget.getGeometry;
|
||||
Result := TabWidget.TabBar.GetTabRect(AIndex);
|
||||
case ATabControl.TabPosition of
|
||||
tpTop: OffsetRect(Result, 0, -Result.Bottom);
|
||||
tpLeft: OffsetRect(Result, -Result.Right, 0);
|
||||
tpRight: OffsetRect(Result, Result.Left, 0);
|
||||
tpBottom: OffsetRect(Result, Result.Top, 0);
|
||||
tpRight: OffsetRect(Result, Offs.Width - Result.Right, 0);
|
||||
tpBottom: OffsetRect(Result, 0, Offs.Height - Result.Bottom);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user