|
| 1 | +/****************************************************************************** |
| 2 | + * Copyright (c) 2005-2007 ognize.com and others. |
| 3 | + * All rights reserved. This program and the accompanying materials |
| 4 | + * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | + * which accompanies this distribution, and is available at |
| 6 | + * http://www.eclipse.org/legal/epl-v10.html |
| 7 | + * |
| 8 | + * Web: |
| 9 | + * http://j2s.sourceforge.net/ |
| 10 | + * http://sourceforge.net/projects/j2s/ |
| 11 | + * Contributors: |
| 12 | + * ognize.com - initial API and implementation |
| 13 | + *****************************************************************************/ |
| 14 | +/******* |
| 15 | + * @author zhou renjian |
| 16 | + * @create Jan 17, 2007 |
| 17 | + *******/ |
| 18 | + |
| 19 | +/* |
| 20 | + * ShellManager is optional for SWT applications. When ShellManager is |
| 21 | + * activated, there are an automatically-hidden side bar for all windows, |
| 22 | + * and there are no title bar for maximized Shells but with an automatically- |
| 23 | + * hidden top bar. By using ShellManager, much of the inner browser window |
| 24 | + * space will be used, and minimize or maximize windows will be much more |
| 25 | + * user-friendly. |
| 26 | + * |
| 27 | + * Example: |
| 28 | +<script> |
| 29 | +... |
| 30 | +ClazzLoader.loadClass ("org.eclipse.swt.widgets.ShellManager", function () { |
| 31 | + ClazzLoader.loadClass ("com.example.Notepad", function () { |
| 32 | + com.example.Notepad.main([]); |
| 33 | + }); |
| 34 | +}); |
| 35 | +</script> |
| 36 | + */ |
1 | 37 | $_L(["$wt.widgets.Shell"], "$wt.widgets.ShellManager", null, function(){ |
2 | 38 | $WTC$$.registerCSS ("$wt.widgets.ShellManager"); |
3 | 39 | //ShellManager = new Object (); |
@@ -151,12 +187,7 @@ sm.syncItems = function () { |
151 | 187 | }; |
152 | 188 | sm.isAroundTopBar = function (x) { |
153 | 189 | var x1, x2, barWidth; |
154 | | - var length = 0; //this.items.length; |
155 | | - if (length == 0) { |
156 | | - barWidth = 320; |
157 | | - } else { |
158 | | - barWidth = 320 + 20; // TODO |
159 | | - } |
| 190 | + barWidth = 320; |
160 | 191 | var height = document.body.clientWidth; |
161 | 192 | var offset = Math.round ((height - barWidth) / 2); |
162 | 193 | x1 = offset - 72; |
@@ -218,7 +249,7 @@ sm.returnTopMaximized = function (shell) { |
218 | 249 | if (shell != null && lastShell != shell) return; |
219 | 250 | if (lastShell == null || lastShell.titleBar == null) return; |
220 | 251 |
|
221 | | - // move the title bar elements into topbarEl |
| 252 | + // move the title bar elements back to Shell's title bar |
222 | 253 | var els = []; |
223 | 254 | for (var i = 0; i < this.topbarEl.childNodes.length; i++) { |
224 | 255 | els[i] = this.topbarEl.childNodes[i]; |
|
0 commit comments