@@ -149,19 +149,36 @@ private void addTrayLine () {
149
149
floatDiv1 .className = "tray-float-block" ;
150
150
Element floatDiv2 = document .createElement ("DIV" );
151
151
floatDiv2 .className = "tray-float-block" ;
152
- floatDiv1 .style .width = cellLines * 36 + "px" ;
153
- floatDiv2 .style .width = (cellLines * 36 - 18 ) + "px" ;
154
- allFloats [cellLines * 2 - 2 ] = floatDiv2 ;
155
- allFloats [cellLines * 2 - 1 ] = floatDiv1 ;
152
+ floatDiv1 .style .width = (cellLines * 36 + 18 ) + "px" ;
153
+ floatDiv2 .style .width = cellLines * 36 + "px" ;
154
+ Element floatDiv3 = null ;
155
+ if (cellLines == 1 ) {
156
+ floatDiv3 = document .createElement ("DIV" );
157
+ floatDiv3 .className = "tray-float-block" ;
158
+ floatDiv3 .style .width = (cellLines * 36 - 18 ) + "px" ;
159
+ allFloats [0 ] = floatDiv3 ;
160
+ }
161
+ allFloats [cellLines * 2 - 1 ] = floatDiv2 ;
162
+ allFloats [cellLines * 2 ] = floatDiv1 ;
156
163
Element panel = document .getElementById ("swt-desktop-panel" );
157
164
if (panel != null ) {
165
+ if (floatDiv3 != null ) {
166
+ if (panel .childNodes .length > 0 ) {
167
+ panel .insertBefore (floatDiv3 , panel .childNodes [0 ]);
168
+ } else {
169
+ panel .appendChild (floatDiv3 );
170
+ }
171
+ }
158
172
if (panel .childNodes .length > 0 ) {
159
173
panel .insertBefore (floatDiv2 , panel .childNodes [0 ]);
160
174
} else {
161
175
panel .appendChild (floatDiv2 );
162
176
}
163
177
panel .insertBefore (floatDiv1 , panel .childNodes [0 ]);
164
178
} else {
179
+ if (floatDiv3 != null ) {
180
+ document .body .insertBefore (floatDiv3 , document .body .childNodes [0 ]);
181
+ }
165
182
document .body .insertBefore (floatDiv2 , document .body .childNodes [0 ]);
166
183
document .body .insertBefore (floatDiv1 , document .body .childNodes [0 ]);
167
184
}
@@ -203,10 +220,14 @@ private void removeTrayLine () {
203
220
if (!supportNotificationCornerFloat ) {
204
221
return ;
205
222
}
223
+ OS .destroyHandle (allFloats [cellLines * 2 + 2 ]);
224
+ allFloats [cellLines * 2 + 2 ] = null ;
206
225
OS .destroyHandle (allFloats [cellLines * 2 + 1 ]);
207
226
allFloats [cellLines * 2 + 1 ] = null ;
208
- OS .destroyHandle (allFloats [cellLines * 2 ]);
209
- allFloats [cellLines * 2 ] = null ;
227
+ if (cellLines == 0 ) {
228
+ OS .destroyHandle (allFloats [0 ]);
229
+ allFloats [0 ] = null ;
230
+ }
210
231
}
211
232
212
233
void initialize () {
0 commit comments