mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +02:00
GTK3: Enabled resizing notebook children after insertion.
This allows fixing some problems but it is probably just a workaround. This fix is related to #40713.
This commit is contained in:
parent
180dcc8888
commit
b44cf28194
@ -4774,19 +4774,14 @@ procedure TGtk3NoteBook.InsertPage(ACustomPage: TCustomPage; AIndex: Integer);
|
||||
var
|
||||
Gtk3Page: TGtk3Page;
|
||||
AMinSize, ANaturalSize: gint;
|
||||
NB: PGtkNotebook;
|
||||
begin
|
||||
if IsWidgetOK then
|
||||
begin
|
||||
Gtk3Page := TGtk3Page(ACustomPage.Handle);
|
||||
NB:=PGtkNoteBook(GetContainerWidget);
|
||||
NB^.insert_page(Gtk3Page.Widget, Gtk3Page.FPageLabel, AIndex);
|
||||
NB^.get_preferred_width(@AMinSize, @ANaturalSize);
|
||||
NB^.get_preferred_height(@AMinSize, @ANaturalSize);
|
||||
if (gtk_notebook_get_n_pages(NB) > 1) then
|
||||
begin
|
||||
with PGtkNoteBook(GetContainerWidget)^ do begin
|
||||
insert_page(Gtk3Page.Widget, Gtk3Page.FPageLabel, AIndex);
|
||||
// Check why this give sometimes: Gtk-WARNING: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node notebook, owner GtkNotebook)
|
||||
//NB^.resize_children;
|
||||
resize_children;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user