diff --git a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs index ce8447bfac..e5c6f1ec14 100644 --- a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs +++ b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkEtoPlatform.cs @@ -65,7 +65,7 @@ public override IMemoryImage DrawHourglass(ImageContext imageContext, IMemoryIma 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 override Control CreateContainer() 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 override void AddToContainer(Control container, Control control, bool inO 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 override void RemoveFromContainer(Control container, Control control) 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 diff --git a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkListView.cs b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkListView.cs index bb2c48f2b4..4d30f50641 100644 --- a/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkListView.cs +++ b/NAPS2.Lib.Gtk/EtoForms/Gtk/GtkListView.cs @@ -63,6 +63,7 @@ public GtkListView(ListViewBehavior behavior) } _scrolledWindow.Add(eventBox); _scrolledWindow.StyleContext.AddClass("listview"); + Control = _scrolledWindow.ToEto(); } private void OnButtonPress(object o, ButtonPressEventArgs args) @@ -83,7 +84,7 @@ private void OnChildActivated(object o, ChildActivatedArgs args) public ScrolledWindow NativeControl => _scrolledWindow; - public Control Control => _scrolledWindow.ToEto(); + public Control Control { get; } public ContextMenu? ContextMenu { get; set; }