mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 12:40:36 +02:00
Gtk3: do not ask for scrollbars if policy is never or external.
This commit is contained in:
parent
3d4c31ed33
commit
2df92eabfa
@ -2483,6 +2483,7 @@ function TGtk3WidgetSet.GetScrollbarVisible(Handle: HWND; SBStyle: Integer
|
|||||||
): boolean;
|
): boolean;
|
||||||
var
|
var
|
||||||
AWidget: TGtk3Widget absolute Handle;
|
AWidget: TGtk3Widget absolute Handle;
|
||||||
|
HScrollPolicy, VScrollPolicy: TGtkPolicyType;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if not IsValidHandle(Handle) then
|
if not IsValidHandle(Handle) then
|
||||||
@ -2493,11 +2494,21 @@ begin
|
|||||||
begin
|
begin
|
||||||
if wtScrollingWin in AWidget.WidgetType then
|
if wtScrollingWin in AWidget.WidgetType then
|
||||||
begin
|
begin
|
||||||
|
TGtk3ScrollableWin(AWidget).getScrolledWindow^.get_policy(@HScrollPolicy, @VScrollPolicy);
|
||||||
if SBStyle = SB_Horz then
|
if SBStyle = SB_Horz then
|
||||||
Result := Assigned(TGtk3ScrollableWin(AWidget).getHorizontalScrollbar) and (TGtk3ScrollableWin(AWidget).getHorizontalScrollbar^.get_visible)
|
begin
|
||||||
else
|
if HScrollPolicy >= GTK_POLICY_NEVER then
|
||||||
|
Result := False
|
||||||
|
else
|
||||||
|
Result := Assigned(TGtk3ScrollableWin(AWidget).getHorizontalScrollbar) and (TGtk3ScrollableWin(AWidget).getHorizontalScrollbar^.get_visible)
|
||||||
|
end else
|
||||||
if SBStyle = SB_Vert then
|
if SBStyle = SB_Vert then
|
||||||
Result := Assigned(TGtk3ScrollableWin(AWidget).getVerticalScrollbar) and TGtk3ScrollableWin(AWidget).getVerticalScrollbar^.get_visible;
|
begin
|
||||||
|
if VScrollPolicy >= GTK_POLICY_NEVER then
|
||||||
|
Result := False
|
||||||
|
else
|
||||||
|
Result := Assigned(TGtk3ScrollableWin(AWidget).getVerticalScrollbar) and TGtk3ScrollableWin(AWidget).getVerticalScrollbar^.get_visible;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4017,6 +4028,21 @@ var
|
|||||||
Adjustment^.value := ATarget;
|
Adjustment^.value := ATarget;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (ScrollInfo.FMask and SIF_UPDATEPOLICY <> 0) then
|
||||||
|
begin
|
||||||
|
if ScrollInfo.nTrackPos = SB_POLICY_CONTINUOUS then
|
||||||
|
begin
|
||||||
|
//TODO: Set tracking value into control to true and listen value-changed,
|
||||||
|
//there's no more gtk2 gtk_range_set_update_policy.
|
||||||
|
end else
|
||||||
|
if ScrollInfo.nTrackPos = SB_POLICY_DISCONTINUOUS then
|
||||||
|
begin
|
||||||
|
//TODO: Set tracking value to false into control to true and don't listen value-changed
|
||||||
|
//until button is released - then send value
|
||||||
|
//there's no more gtk2 gtk_range_set_update_policy.
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
gtk_adjustment_changed(Adjustment);
|
gtk_adjustment_changed(Adjustment);
|
||||||
{$IFDEF GTK3DEBUGSCROLL}
|
{$IFDEF GTK3DEBUGSCROLL}
|
||||||
DebugLn(Format('Updated Adjustment: lower=%.2f, upper=%.2f, page_size=%.2f, value=%.2f, page_increment=%.2f InUpdate %s',
|
DebugLn(Format('Updated Adjustment: lower=%.2f, upper=%.2f, page_size=%.2f, value=%.2f, page_increment=%.2f InUpdate %s',
|
||||||
|
Loading…
Reference in New Issue
Block a user