Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc743ec8

Browse files
author
zhourenjian
committed
Clicking on half-transparent shadow will pass click to Shell underneath, if existed
1 parentd16c3c0 commitc743ec8

File tree

1 file changed

+48
-1
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets

1 file changed

+48
-1
lines changed

‎sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/Display.java‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4655,6 +4655,44 @@ static Tray getTray() {
46554655
returntray;
46564656
}
46574657

4658+
staticShell[]getAllVisibleShells() {
4659+
Shell[]shells =newShell[0];// auto-incremental array
4660+
int[]orders =newint[0];
4661+
Display[]disps =Displays;
4662+
for (intk =0;k <disps.length;k++) {
4663+
if (disps[k] ==null)continue;
4664+
Shell[]ss =disps[k].getShells ();
4665+
for (inti =0;i <ss.length;i++) {
4666+
if (!ss[i].isDisposed ()/*&& ss[i].parent == null*/
4667+
&&ss[i].isVisible()
4668+
&&ss[i].handle.style.display !="none") {
4669+
shells[shells.length] =ss[i];
4670+
Stringidx ="" +ss[i].handle.style.zIndex;
4671+
intzidx =0;
4672+
if (idx ==null ||idx.length() ==0) {
4673+
zidx =0;
4674+
}else {
4675+
zidx =Integer.parseInt (idx);
4676+
}
4677+
orders[orders.length] =zidx;
4678+
}
4679+
}
4680+
}
4681+
for (inti =0;i <shells.length;i++) {
4682+
for (intj =i +1;j <shells.length;j++) {
4683+
if (orders[i] <orders[j]) {
4684+
Shells =shells[i];
4685+
shells[i] =shells[j];
4686+
shells[j] =s;
4687+
intidx =orders[i];
4688+
orders[i] =orders[j];
4689+
orders[j] =idx;
4690+
}
4691+
}
4692+
}
4693+
returnshells;
4694+
}
4695+
46584696
staticShellgetTopShell() {
46594697
ShelllastShell =null;
46604698
intlastZIndex =0;
@@ -4868,7 +4906,16 @@ public void run() {
48684906
while (src !=null) {
48694907
StringclassName =src.className;
48704908
if (className !=null &&className.indexOf("shadow-") != -1) {
4871-
return;
4909+
Shell[]allVisibleShells =getAllVisibleShells();
4910+
for (inti =0;i <allVisibleShells.length;i++) {
4911+
Rectanglebounds =allVisibleShells[i].getBounds();
4912+
// border width is taking into consideration
4913+
if (evt.x >=bounds.x +2 &&evt.x <=bounds.x +bounds.width -4
4914+
&&evt.y >=bounds.y +2 &&evt.y <=bounds.y +bounds.height -4) {
4915+
allVisibleShells[i].bringToTop();
4916+
return;
4917+
}
4918+
}
48724919
}
48734920
if (OS.existedCSSClass(src,"shell-default")) {
48744921
Display[]displs =Displays;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp