mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 18:07:44 +01:00
Gtk2: fixed returning correct result from TGtk2WSCustomTabControl.GetTabRect. issue #18926
git-svn-id: trunk@44405 -
This commit is contained in:
parent
5047d8a8df
commit
f5a9af9123
@ -518,6 +518,8 @@ var
|
||||
TabWidget: PGtkWidget;
|
||||
PageWidget: PGtkWidget;
|
||||
Count: guint;
|
||||
X: gint;
|
||||
Y: gint;
|
||||
begin
|
||||
Result := inherited;
|
||||
if (ATabControl is TTabControl) then
|
||||
@ -532,7 +534,19 @@ begin
|
||||
begin
|
||||
TabWidget := gtk_notebook_get_tab_label(NoteBookWidget, PageWidget);
|
||||
if TabWidget <> nil then
|
||||
begin
|
||||
Result := RectFromGdkRect(TabWidget^.allocation);
|
||||
Y := PGtkWidget(NoteBookWidget)^.allocation.y;
|
||||
X := PGtkWidget(NoteBookWidget)^.allocation.x;
|
||||
if Y <= 0 then
|
||||
exit;
|
||||
case ATabControl.TabPosition of
|
||||
tpTop, tpBottom:
|
||||
OffsetRect(Result, 0, -Y);
|
||||
tpLeft, tpRight:
|
||||
OffsetRect(Result, -X, -Y);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user