mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 03:59:12 +02:00
Gtk3: cleanup TGtk3ScrollingWinControl constructor.
This commit is contained in:
parent
261e8f74d0
commit
59efce7694
@ -9106,37 +9106,8 @@ function TGtk3ScrollingWinControl.CreateWidget(const Params: TCreateParams
|
|||||||
): PGtkWidget;
|
): PGtkWidget;
|
||||||
begin
|
begin
|
||||||
FHasPaint := True;
|
FHasPaint := True;
|
||||||
//FWidgetType := [wtWidget, wtContainer, wtScrollingWin, wtScrollingWinControl];
|
|
||||||
Result := inherited CreateWidget(Params);
|
Result := inherited CreateWidget(Params);
|
||||||
include(FWidgetType, wtScrollingWinControl);
|
Include(FWidgetType, wtScrollingWinControl);
|
||||||
exclude(FWidgetType, wtCustomControl);
|
|
||||||
exit;
|
|
||||||
// PGtkScrolledWindow(TGtkScrolledWindow.new(nil, nil));
|
|
||||||
FCentralWidget := LCLGtkFixedNew;
|
|
||||||
FCentralWidget^.set_hexpand(True);
|
|
||||||
FCentralWidget^.set_vexpand(True);
|
|
||||||
FCentralWidget^.set_has_window(True);
|
|
||||||
FCentralWidget^.show;
|
|
||||||
|
|
||||||
PGtkScrolledWindow(Result)^.add_with_viewport(FCentralWidget);
|
|
||||||
|
|
||||||
PGtkViewport(PGtkScrolledWindow(Result)^.get_child)^.set_shadow_type(BorderStyleShadowMap[bsNone]);
|
|
||||||
PGtkScrolledWindow(Result)^.set_shadow_type(BorderStyleShadowMap[TScrollingWinControl(LCLObject).BorderStyle]);
|
|
||||||
PGtkScrolledWindow(Result)^.get_vscrollbar^.set_can_focus(False);
|
|
||||||
PGtkScrolledWindow(Result)^.get_hscrollbar^.set_can_focus(False);
|
|
||||||
PGtkScrolledWindow(Result)^.set_policy(GTK_POLICY_NEVER, GTK_POLICY_NEVER);
|
|
||||||
|
|
||||||
// this is very important
|
|
||||||
PGtkScrolledWindow(Result)^.set_can_focus(False);
|
|
||||||
FCentralWidget^.set_can_focus(True);
|
|
||||||
|
|
||||||
g_signal_connect_data(FCentralWidget,'size-allocate',TGCallback(@ScrollingWinControlFixedSizeAllocate), Self, nil, G_CONNECT_DEFAULT);
|
|
||||||
|
|
||||||
with PGtkScrolledWindow(Result)^.get_vadjustment^ do
|
|
||||||
LCLVAdj := gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size);
|
|
||||||
with PGtkScrolledWindow(Result)^.get_hadjustment^ do
|
|
||||||
LCLHAdj := gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size);
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TGtk3Window }
|
{ TGtk3Window }
|
||||||
|
Loading…
Reference in New Issue
Block a user