1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use crate::factory::{FactoryListView, FactoryView};
use gtk::glib;

impl<Widget> FactoryView<Widget> for panel::Paned
where
    Widget: glib::IsA<gtk::Widget>,
{
    type Position = ();
    type Root = Widget;

    fn add(&self, widget: &Widget, _position: &Self::Position) -> Widget {
        self.append(widget);
        widget.clone()
    }

    fn remove(&self, widget: &Widget) {
        self.remove(widget);
    }
}

impl<Widget> FactoryListView<Widget> for panel::Paned
where
    Widget: glib::IsA<gtk::Widget>,
{
    fn insert_after(&self, widget: &Widget, other: &Widget) -> Widget {
        self.insert_after(widget, other);
        widget.clone()
    }

    fn push_front(&self, widget: &Widget) -> Widget {
        self.insert(0, widget);
        widget.clone()
    }
}