mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 05:19:25 +02:00
LCL, added metrics to fix grid's auto scrollbar issue #14799
git-svn-id: trunk@22535 -
This commit is contained in:
parent
812b84fe1f
commit
1ab6860b98
@ -3981,10 +3981,12 @@ begin
|
||||
// get client bounds free of bars
|
||||
ClientW := ClientWidth;
|
||||
ClientH := ClientHeight;
|
||||
BarW := GetSystemMetrics(SM_CXVSCROLL);
|
||||
BarW := GetSystemMetrics(SM_CXVSCROLL) +
|
||||
GetSystemMetrics(SM_SWSCROLLBARSPACING);
|
||||
if ScrollBarIsVisible(SB_VERT) then
|
||||
ClientW := ClientW + BarW;
|
||||
BarH := GetSystemMetrics(SM_CYHSCROLL);
|
||||
BarH := GetSystemMetrics(SM_CYHSCROLL) +
|
||||
GetSystemMetrics(SM_SWSCROLLBARSPACING);
|
||||
if ScrollBarIsVisible(SB_HORZ) then
|
||||
ClientH := ClientH + BarH;
|
||||
|
||||
|
@ -78,6 +78,7 @@ type
|
||||
lgsToolBar, // toolbar
|
||||
lgsToolButton, // button placed on toolbar
|
||||
lgsCalendar, // button placed on toolbar
|
||||
lgsScrolledWindow,
|
||||
// user defined
|
||||
lgsUserDefined
|
||||
);
|
||||
@ -109,6 +110,7 @@ const
|
||||
'toolbar',
|
||||
'toolbutton',
|
||||
'calendar',
|
||||
'scrolled window',
|
||||
''
|
||||
);
|
||||
|
||||
|
@ -8038,6 +8038,11 @@ begin
|
||||
lgs:=lgsToolButton;
|
||||
StyleObject^.Widget := gtk_toolbar_append_item(PGtkToolBar(GetStyleWidget(lgsToolBar)), 'B', nil, nil, nil, nil, nil);
|
||||
end
|
||||
else
|
||||
if CompareText(WName,LazGtkStyleNames[lgsScrolledWindow])=0 then begin
|
||||
lgs:=lgsScrolledWindow;
|
||||
StyleObject^.Widget := gtk_scrolled_window_new(nil, nil);
|
||||
end
|
||||
else
|
||||
If CompareText(WName,LazGtkStyleNames[lgsGTK_Default])=0 then begin
|
||||
lgs:=lgsGTK_Default;
|
||||
|
@ -6165,6 +6165,21 @@ begin
|
||||
begin
|
||||
Assert(False, 'Trace:TODO: [TGtkWidgetSet.GetSystemMetrics] --> SM_SWAPBUTTON ');
|
||||
end;
|
||||
SM_SWSCROLLBARSPACING:
|
||||
begin
|
||||
P := GetStyleWidget(lgsScrolledWindow);
|
||||
if P <> nil then begin
|
||||
{$IFDEF GTK2}
|
||||
result := GTK_SCROLLED_WINDOW_CLASS(gtk_widget_get_class(P))^.scrollbar_spacing;
|
||||
if result<0 then
|
||||
gtk_widget_style_get(P, 'scrollbar-spacing', @result, nil);
|
||||
{$ELSE}
|
||||
result := PGtkScrolledWindowClass(PGtkTypeObject(P)^.klass)^.scrollbar_spacing;
|
||||
if result<0 then
|
||||
result := 3;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Assert(False, Format('Trace:< [TGtkWidgetSet.GetSystemMetrics] %d --> 0x%x (%d)', [nIndex, Result, Result]));
|
||||
end;
|
||||
|
@ -1704,6 +1704,8 @@ const
|
||||
SM_CMONITORS = 80;
|
||||
SM_SAMEDISPLAYFORMAT = 81;
|
||||
|
||||
SM_SWSCROLLBARSPACING = 120;
|
||||
|
||||
//==============================================
|
||||
// SystemParametersInfo constants
|
||||
//==============================================
|
||||
|
Loading…
Reference in New Issue
Block a user