mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 12:29:29 +02:00
LCL, gtk2 fix TTabControl tab's height (improves appareance, LazReport designer for example, and on some themes/distros fix Critical warnings)
git-svn-id: trunk@40557 -
This commit is contained in:
parent
c0878f5175
commit
f69ac681f1
@ -96,8 +96,8 @@ const
|
|||||||
'tooltip',
|
'tooltip',
|
||||||
'vertical paned',
|
'vertical paned',
|
||||||
'horizontal paned',
|
'horizontal paned',
|
||||||
'statusbar',
|
|
||||||
'notebook',
|
'notebook',
|
||||||
|
'statusbar',
|
||||||
'hscale',
|
'hscale',
|
||||||
'vscale',
|
'vscale',
|
||||||
'groupbox',
|
'groupbox',
|
||||||
|
@ -441,40 +441,13 @@ end;
|
|||||||
class function TGtk2WSCustomTabControl.GetNotebookMinTabHeight(
|
class function TGtk2WSCustomTabControl.GetNotebookMinTabHeight(
|
||||||
const AWinControl: TWinControl): integer;
|
const AWinControl: TWinControl): integer;
|
||||||
var
|
var
|
||||||
NBWidget: PGTKWidget;
|
FrameBorders: TRect;
|
||||||
BorderWidth: Integer;
|
|
||||||
Page: PGtkNotebookPage;
|
|
||||||
begin
|
begin
|
||||||
Result:=inherited GetNotebookMinTabHeight(AWinControl);
|
FrameBorders:=GetStyleNotebookFrameBorders;
|
||||||
|
Result := FrameBorders.Top + 2; // +1 for getting size, +1 to see border line
|
||||||
|
if Result<=0 then
|
||||||
|
Result:=inherited GetNotebookMinTabHeight(AWinControl);
|
||||||
//debugln('TGtkWSCustomTabControl.GetNotebookMinTabHeight A ',dbgs(Result));
|
//debugln('TGtkWSCustomTabControl.GetNotebookMinTabHeight A ',dbgs(Result));
|
||||||
exit;
|
|
||||||
|
|
||||||
debugln('TGtkWSCustomTabControl.GetNotebookMinTabHeight A ',dbgs(AWinControl.HandleAllocated));
|
|
||||||
if AWinControl.HandleAllocated then
|
|
||||||
NBWidget:={%H-}PGTKWidget(AWinControl.Handle)
|
|
||||||
else
|
|
||||||
NBWidget:=GetStyleWidget(lgsNotebook);
|
|
||||||
|
|
||||||
// ToDo: find out how to create a fully working hidden Notebook style widget
|
|
||||||
|
|
||||||
if (NBWidget=nil) then begin
|
|
||||||
Result:=TWSCustomTabControl.GetNotebookMinTabHeight(AWinControl);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
debugln('TGtkWSCustomTabControl.GetNotebookMinTabHeight NBWidget: ',GetWidgetDebugReport(NBWidget),
|
|
||||||
' ',dbgs(NBWidget^.allocation.width),'x',dbgs(NBWidget^.allocation.height));
|
|
||||||
|
|
||||||
BorderWidth:=(PGtkContainer(NBWidget)^.flag0 and bm_TGtkContainer_border_width)
|
|
||||||
shr bp_TGtkContainer_border_width;
|
|
||||||
if PGtkNoteBook(NBWidget)^.first_tab<>nil then
|
|
||||||
Page:=PGtkNoteBook(NBWidget)^.cur_page;
|
|
||||||
|
|
||||||
Result:=BorderWidth;
|
|
||||||
if (Page<>nil) then begin
|
|
||||||
debugln('TGtkWSCustomTabControl.RemovePage TODO');
|
|
||||||
end;
|
|
||||||
debugln('TGtkWSCustomTabControl.GetNotebookMinTabHeight END ',dbgs(Result),' ',
|
|
||||||
GetWidgetDebugReport(NBWidget));
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TGtk2WSCustomTabControl.GetNotebookMinTabWidth(
|
class function TGtk2WSCustomTabControl.GetNotebookMinTabWidth(
|
||||||
|
Loading…
Reference in New Issue
Block a user