From 226064c7e6898815ffa7b460f9cc418f0825f593 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Sun, 20 Mar 2016 09:39:15 -0400 Subject: [PATCH] lib/linux: move down add and remove logic to Layout only (where it was used) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/linux/ui.nit | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/linux/ui.nit b/lib/linux/ui.nit index a03eccb..252022c 100644 --- a/lib/linux/ui.nit +++ b/lib/linux/ui.nit @@ -99,13 +99,6 @@ redef class Control end redef class CompositeControl - redef type NATIVE: GtkContainer - - redef fun add(item) - do - super - native.add item.native - end end # On GNU/Linux, a window is implemented by placing the `view` in a `GtkStack` in the single GTK window @@ -120,8 +113,7 @@ redef class Window self.view = view end - # TODO skip local CompositeControl::add but call intro - #super + super end end @@ -134,10 +126,17 @@ end redef class Layout redef type NATIVE: GtkBox - redef fun remove(view) + + redef fun add(item) + do + super + if item isa View then native.add item.native + end + + redef fun remove(item) do super - native.remove view.native + if item isa View then native.remove item.native end end -- 1.7.9.5