X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=examples%2FJexerTilingWindowManager2.java;h=cb7f0d0263659a4be295d7c0397f3836ce0d3098;hb=a524aa2e24b0ddeb5aa8105f1bed1c1c7b75e1c7;hp=bef3637119b7d676ce2ecd27dbcc406979d3e074;hpb=469c2b3cf74f88072a9a1e5758379f24b14f469e;p=nikiroo-utils.git diff --git a/examples/JexerTilingWindowManager2.java b/examples/JexerTilingWindowManager2.java index bef3637..cb7f0d0 100644 --- a/examples/JexerTilingWindowManager2.java +++ b/examples/JexerTilingWindowManager2.java @@ -97,9 +97,16 @@ public class JexerTilingWindowManager2 extends TApplication { active.getY(), active.getWidth(), active.getHeight(), new TAction() { public void DO() { - // TODO + if (source.getParent() instanceof TSplitPane) { + ((TSplitPane) source.getParent()).removeSplit(source, true); + } else if (source == root) { + assert (root != null); + root.remove(); + root = null; + } } })); + if (active == root) { root = split; } @@ -116,7 +123,13 @@ public class JexerTilingWindowManager2 extends TApplication { active.getY(), active.getWidth(), active.getHeight(), new TAction() { public void DO() { - // TODO + if (source.getParent() instanceof TSplitPane) { + ((TSplitPane) source.getParent()).removeSplit(source, true); + } else if (source == root) { + assert (root != null); + root.remove(); + root = null; + } } })); return true; @@ -134,10 +147,9 @@ public class JexerTilingWindowManager2 extends TApplication { getDesktop().getWidth(), getDesktop().getHeight(), new TAction() { public void DO() { - TWidget target = (TWidget) data; - if (target.getParent() instanceof TPanel) { - ((TSplitPane) target.getParent().getParent()).removeSplit(target, true); - } else { + if (source.getParent() instanceof TSplitPane) { + ((TSplitPane) source.getParent()).removeSplit(source, true); + } else if (source == root) { assert (root != null); root.remove(); root = null;