This commit is contained in:
Ben Olden-Cooligan 2024-03-15 18:59:43 -07:00
parent f90374717a
commit 3186ffdda2
2 changed files with 6 additions and 5 deletions

View File

@ -65,7 +65,7 @@ public class GtkEtoPlatform : EtoPlatform
public override void SetFrame(Control container, Control control, Point location, Size size, bool inOverlay)
{
var overlay = (GTK.Overlay) container.ToNative();
var overlay = (GTK.Overlay) ((GTK.EventBox) container.ToNative()).Child;
var widget = control.ToNative();
if (inOverlay)
{
@ -90,7 +90,7 @@ public class GtkEtoPlatform : EtoPlatform
public override void AddToContainer(Control container, Control control, bool inOverlay)
{
var overlay = (GTK.Overlay) container.ToNative();
var overlay = (GTK.Overlay) ((GTK.EventBox) container.ToNative()).Child;
var widget = control.ToNative();
if (inOverlay)
{
@ -108,7 +108,7 @@ public class GtkEtoPlatform : EtoPlatform
public override void RemoveFromContainer(Control container, Control control)
{
var overlay = (GTK.Overlay) container.ToNative();
var overlay = (GTK.Overlay) ((GTK.EventBox) container.ToNative()).Child;
var widget = control.ToNative();
overlay.Remove(widget);
var panel = (GTK.Fixed) overlay.Children[0];
@ -118,7 +118,7 @@ public class GtkEtoPlatform : EtoPlatform
public override void SetContainerSize(Window _window, Control container, Size size, int padding)
{
var overlay = (GTK.Overlay) container.ToNative();
var overlay = (GTK.Overlay) ((GTK.EventBox) container.ToNative()).Child;
if (!_window.Resizable)
{
// This ensures the window has the appropriate margins, otherwise with resizable=false it changes to fit

View File

@ -63,6 +63,7 @@ public class GtkListView<T> : IListView<T> where T : notnull
}
_scrolledWindow.Add(eventBox);
_scrolledWindow.StyleContext.AddClass("listview");
Control = _scrolledWindow.ToEto();
}
private void OnButtonPress(object o, ButtonPressEventArgs args)
@ -83,7 +84,7 @@ public class GtkListView<T> : IListView<T> where T : notnull
public ScrolledWindow NativeControl => _scrolledWindow;
public Control Control => _scrolledWindow.ToEto();
public Control Control { get; }
public ContextMenu? ContextMenu { get; set; }