File tree 1 file changed +31
-0
lines changed 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ '''
2
+ Created on 2013-7-12
3
+
4
+ @author: SuShiting
5
+ '''
6
+ import win32gui ,win32con
7
+ import vim
8
+
9
+ def setWindowTransp ():
10
+ hwnd = win32gui .FindWindow ("Vim" ,None )
11
+ if hwnd :
12
+ s = win32gui .GetWindowLong (hwnd ,win32con .GWL_EXSTYLE )
13
+ win32gui .SetWindowLong (hwnd , win32con .GWL_EXSTYLE , s | win32con .WS_EX_LAYERED )
14
+ opCode = vim .eval ("g:alphaOp" )
15
+ alphaValue = int (vim .eval ("g:alphaValue" ))
16
+ stepValue = int (vim .eval ("g:stepValue" ))
17
+
18
+ if opCode == "plus" :
19
+ alphaValue = alphaValue + stepValue
20
+ else :
21
+ alphaValue = alphaValue - stepValue
22
+
23
+ if alphaValue < 200 or alphaValue > 255 :
24
+ vim .command ("echo 'AlphaValue exceed!'" )
25
+ else :
26
+ vim .command ("let g:alphaValue=" + str (alphaValue ))
27
+ win32gui .SetLayeredWindowAttributes (hwnd , 0 , alphaValue ,win32con .LWA_ALPHA )
28
+
29
+ setWindowTransp ()
30
+
31
+
You can’t perform that action at this time.
0 commit comments