@@ -589,7 +589,7 @@ public void run() {
589589 DragAndDrop dnd = new DragAndDrop ();
590590 dnd .addDragListener (new ShellFrameDND () {
591591 public boolean isDraggable (HTMLEventWrapper e ) {
592- if (super .isDraggable (e )) {
592+ if (super .isDraggable (e ) && ! getMaximized () ) {
593593 String cssName = e .target .className ;
594594 if (cssName .indexOf ("shell-title-text" ) != -1
595595 && oldBounds != null ) {
@@ -1703,7 +1703,16 @@ public void setMaximized (boolean maximized) {
17031703 height = OS .getFixedBodyClientHeight ();
17041704 }
17051705 int titleHeight = ((style & SWT .TITLE ) != 0 ) ? 20 : 0 ;
1706- setBounds (computeTrim (0 , 0 , width , height - titleHeight ));
1706+ boolean isOptMaximized = false ;
1707+ /**
1708+ * @j2sNative
1709+ * isOptMaximized = window["ShellManagerSideBar"] != null;
1710+ */ {}
1711+ if (!isOptMaximized ) {
1712+ setBounds (computeTrim (0 , 0 , width , height - titleHeight ));
1713+ } else {
1714+ setBounds (computeTrim (0 , -titleHeight , width , height ));
1715+ }
17071716 }
17081717 ResizeSystem .register (this , SWT .MAX );
17091718 if (titleBar != null ) {
@@ -2024,8 +2033,15 @@ public void run() {
20242033 titleBar .appendChild (shellMin );
20252034 shellMin .onclick = new RunnableCompatibility () {
20262035 public void run () {
2027- ResizeSystem .unregister (Decorations .this , SWT .MIN );
2036+ Decorations shell = Decorations .this ;
2037+ ResizeSystem .unregister (shell , SWT .MIN );
20282038 setMinimized (true );
2039+ /**
2040+ * @j2sNative
2041+ * if (window["ShellManagerSideBar"] != null) {
2042+ * ShellManagerSideBar.returnTopMaximized (shell);
2043+ * }
2044+ */ { }
20292045 }
20302046 };
20312047 }
@@ -2037,6 +2053,13 @@ public void run() {
20372053 shellMax .onclick = new RunnableCompatibility () {
20382054 public void run () {
20392055 setMaximized (!getMaximized ());
2056+ Decorations shell = Decorations .this ;
2057+ /**
2058+ * @j2sNative
2059+ * if (window["ShellManagerSideBar"] != null) {
2060+ * ShellManagerSideBar.returnTopMaximized (shell);
2061+ * }
2062+ */ { shell .bringToTop (); }
20402063 display .timerExec (25 , new Runnable () {
20412064 public void run () {
20422065 layout ();
@@ -2054,6 +2077,12 @@ public void run() {
20542077 public void run () {
20552078 if (Decorations .this instanceof Shell ) {
20562079 Shell shell = (Shell ) Decorations .this ;
2080+ /**
2081+ * @j2sNative
2082+ * if (window["ShellManagerSideBar"] != null) {
2083+ * ShellManagerSideBar.returnTopMaximized (shell);
2084+ * }
2085+ */ { }
20572086 shell .close ();
20582087 }
20592088 }
@@ -2242,29 +2271,7 @@ protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y
22422271 contentHandle .style .height = ((height - dh >= 0 ) ? height - dh : 0 ) + "px" ;
22432272 contentHandle .style .width = ((width - dw ) > 0 ? width - dw : 0 ) + "px" ;
22442273 titleBar .style .width = ((width - dww ) > 0 ? width - dww : 0 ) + "px" ;
2245- int ww = 18 ;
2246- int w = ww ;
2247- if (shellClose != null ) {
2248- shellClose .style .left = (width - 8 - 2 - w ) + "px" ;
2249- w += ww ;
2250- }
2251- if (shellMax != null ) {
2252- shellMax .style .left = (width - 8 - 2 - w ) + "px" ;
2253- w += ww ;
2254- }
2255- if (shellMin != null ) {
2256- shellMin .style .left = (width - 8 - 2 - w ) + "px" ;
2257- w += ww ;
2258- }
2259- w -= ww ;
2260- if (shellIcon != null ) {
2261- shellIcon .style .left = 2 + "px" ;
2262- shellTitle .style .left = (4 + ww ) + "px" ;
2263- w += ww ;
2264- } else {
2265- shellTitle .style .left = 4 + "px" ;
2266- }
2267- shellTitle .style .width = (width - 8 - 8 - w ) + "px" ;
2274+ updateShellTitle (width );
22682275 } else {
22692276 width -= 4 ;
22702277 height -= 4 ;
@@ -2294,6 +2301,32 @@ protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y
22942301// return super.SetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
22952302}
22962303
2304+ protected void updateShellTitle (int width ) {
2305+ int ww = 18 ;
2306+ int w = ww ;
2307+ if (shellClose != null ) {
2308+ shellClose .style .left = (width - 8 - 2 - w ) + "px" ;
2309+ w += ww ;
2310+ }
2311+ if (shellMax != null ) {
2312+ shellMax .style .left = (width - 8 - 2 - w ) + "px" ;
2313+ w += ww ;
2314+ }
2315+ if (shellMin != null ) {
2316+ shellMin .style .left = (width - 8 - 2 - w ) + "px" ;
2317+ w += ww ;
2318+ }
2319+ w -= ww ;
2320+ if (shellIcon != null ) {
2321+ shellIcon .style .left = 2 + "px" ;
2322+ shellTitle .style .left = (4 + ww ) + "px" ;
2323+ w += ww ;
2324+ } else {
2325+ shellTitle .style .left = 4 + "px" ;
2326+ }
2327+ shellTitle .style .width = (width - 8 - 8 - w ) + "px" ;
2328+ }
2329+
22972330/*
22982331void sort (Image [] images, ImageData [] datas, int width, int height, int depth) {
22992332 /* Shell Sort from K&R, pg 108 *-/
0 commit comments