[GTK/Paned] Fixed margin test failure

This commit is contained in:
Lluis Sanchez 2013-06-06 22:22:54 +02:00
Родитель 3d37ce6eb1
Коммит 598d5e47b0
1 изменённых файлов: 18 добавлений и 3 удалений

Просмотреть файл

@ -129,8 +129,8 @@ namespace Xwt.GtkBackend
((IGtkContainer)cont).ReplaceChild (oldWidget, newWidget);
}
else if (cont is Gtk.Notebook) {
Gtk.Notebook notebook = (Gtk.Notebook) cont;
Gtk.Notebook.NotebookChild nc = (Gtk.Notebook.NotebookChild) notebook[oldWidget];
Gtk.Notebook notebook = (Gtk.Notebook)cont;
Gtk.Notebook.NotebookChild nc = (Gtk.Notebook.NotebookChild)notebook [oldWidget];
var detachable = nc.Detachable;
var pos = nc.Position;
var reorderable = nc.Reorderable;
@ -140,12 +140,27 @@ namespace Xwt.GtkBackend
notebook.Remove (oldWidget);
notebook.InsertPage (newWidget, label, pos);
nc = (Gtk.Notebook.NotebookChild) notebook[newWidget];
nc = (Gtk.Notebook.NotebookChild)notebook [newWidget];
nc.Detachable = detachable;
nc.Reorderable = reorderable;
nc.TabExpand = tabExpand;
nc.TabFill = tabFill;
}
else if (cont is Gtk.Paned) {
var paned = (Gtk.Paned)cont;
var pc = (Gtk.Paned.PanedChild)paned[oldWidget];
var resize = pc.Resize;
var shrink = pc.Shrink;
var pos = paned.Position;
if (paned.Child1 == oldWidget) {
paned.Remove (oldWidget);
paned.Pack1 (newWidget, resize, shrink);
} else {
paned.Remove (oldWidget);
paned.Pack2 (newWidget, resize, shrink);
}
paned.Position = pos;
}
else if (cont is Gtk.Bin) {
((Gtk.Bin)cont).Remove (oldWidget);
((Gtk.Bin)cont).Child = newWidget;