@@ -53,8 +53,8 @@ public static class WindowManager
5353 //alpha control variables
5454 private static IntPtr lastWindowAlphaHandle = IntPtr . Zero ;
5555 private static byte lastWindowAlpha = 0 ;
56- private const byte WindowAlphaIncrement = 32 ;
57- private const byte MinWindowAlpha = 32 ;
56+ private const byte WindowAlphaIncrement = 16 ;
57+ private const byte MinWindowAlpha = 16 ;
5858
5959 #region Setup and teardown
6060 static WindowManager ( )
@@ -254,7 +254,6 @@ public static void LoadHotKeys(VariablesFile settingsFile)
254254 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_RestoreLayout3" , "|^!D3" ) . String , out hk ) )
255255 snapHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , RestoreLayout3 ) ) ;
256256 //corner move hotkeys - with defaults
257- //if (HotKey.TryParseHotKey(settingsFile.variables.GetVariable("HotKey_MoveActiveWindowToBottomLeft", "|^+G").String, out hk))
258257 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_MoveActiveWindowToBottomLeft" , "|^!End" ) . String , out hk ) )
259258 snapHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToBottomLeft ) ) ;
260259 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_MoveActiveWindowToBottomRight" , "|^!PageDown" ) . String , out hk ) )
@@ -263,8 +262,8 @@ public static void LoadHotKeys(VariablesFile settingsFile)
263262 snapHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToTopLeft ) ) ;
264263 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_MoveActiveWindowToTopRight" , "|^!PageUp" ) . String , out hk ) )
265264 snapHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToTopRight ) ) ;
266- // if (HotKey.TryParseHotKey(settingsFile.variables.GetVariable("HotKey_MoveActiveWindowToCenter", "|^!+NumPad5 ").String, out hk)) //broken because of shift numpad
267- // snapHotKeys.Add(new HotKey(hk.Modifiers, hk.Key, MoveActiveWindowToTopRight ));
265+ if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_MoveActiveWindowToCenter" , "|^!Multiply " ) . String , out hk ) )
266+ snapHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToCenter ) ) ;
268267
269268 //altsnap hotkeys - with defaults
270269 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_Alt_SnapActiveWindowToBottomLeft" , "|^!Oemcomma" ) . String , out hk ) )
@@ -291,10 +290,10 @@ public static void LoadHotKeys(VariablesFile settingsFile)
291290 miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToLeftScreen ) ) ;
292291 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_MoveActiveWindowToRightScreen" , "|^+S" ) . String , out hk ) )
293292 miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , MoveActiveWindowToRightScreen ) ) ;
294- if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_IncreaseWindowTranspancy " , "^!Add" ) . String , out hk ) )
295- miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , IncreaseWindowTranspancy ) ) ;
296- if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_DecreaseWindowTranspancy " , "^!Subtract" ) . String , out hk ) )
297- miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , DecreaseWindowTranspancy ) ) ;
293+ if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_IncreaseWindowTransparency " , "^!Add" ) . String , out hk ) )
294+ miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , IncreaseWindowTransparency ) ) ;
295+ if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_DecreaseWindowTransparency " , "^!Subtract" ) . String , out hk ) )
296+ miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , DecreaseWindowTransparency ) ) ;
298297 if ( HotKey . TryParseHotKey ( settingsFile . variables . GetVariable ( "HotKey_SendActiveWindowToBack" , "|^!W" ) . String , out hk ) )
299298 miscHotKeys . Add ( new HotKey ( hk . Modifiers , hk . Key , SendActiveWindowToBack ) ) ;
300299
@@ -595,7 +594,7 @@ private static void MoveActiveWindowTo(int x, int y, int newWidth, int newHeight
595594 }
596595 }
597596
598- private static void SetWindowTransparancy ( int d )
597+ private static void SetWindowTransparency ( int d )
599598 {
600599 byte a ;
601600 IntPtr handle = GetForegroundWindow ( ) ;
@@ -623,7 +622,7 @@ private static void SetWindowTransparancy(int d)
623622
624623 //Enable extended layered style on window if not enabled
625624 SetWindowLong ( handle , GWL_EXSTYLE , GetWindowLong ( handle , GWL_EXSTYLE ) | WS_EX_LAYERED ) ;
626- //set window transparency
625+ //set window Transparency
627626 SetLayeredWindowAttributes ( handle , 0 , a , LWA_ALPHA ) ;
628627
629628 lastWindowAlpha = a ;
@@ -729,7 +728,7 @@ private static void SnapActiveWindow(SnapDirection dir)
729728 }
730729
731730
732- private static void MoveActiveWindowToCorner ( SnapDirection dir )
731+ private static void MoveActiveWindowTo ( SnapDirection dir )
733732 {
734733 //keep window size and move to a given corner or center
735734 if ( ! ( dir == SnapDirection . TopLeft || dir == SnapDirection . TopRight || dir == SnapDirection . BottomLeft || dir == SnapDirection . BottomRight || dir == SnapDirection . Center ) )
@@ -807,30 +806,30 @@ public static void SnapActiveWindowToBottomRight(object o, HotKeyEventArgs args)
807806 }
808807 #endregion
809808
810- #region Move active window to all 4 corners
809+ #region Move active window to all 4 corners & center
811810 public static void MoveActiveWindowToTopLeft ( object o , HotKeyEventArgs args )
812811 {
813- MoveActiveWindowToCorner ( SnapDirection . TopLeft ) ;
812+ MoveActiveWindowTo ( SnapDirection . TopLeft ) ;
814813 }
815814
816815 public static void MoveActiveWindowToTopRight ( object o , HotKeyEventArgs args )
817816 {
818- MoveActiveWindowToCorner ( SnapDirection . TopRight ) ;
817+ MoveActiveWindowTo ( SnapDirection . TopRight ) ;
819818 }
820819
821820 public static void MoveActiveWindowToBottomLeft ( object o , HotKeyEventArgs args )
822821 {
823- MoveActiveWindowToCorner ( SnapDirection . BottomLeft ) ;
822+ MoveActiveWindowTo ( SnapDirection . BottomLeft ) ;
824823 }
825824
826825 public static void MoveActiveWindowToBottomRight ( object o , HotKeyEventArgs args )
827826 {
828- MoveActiveWindowToCorner ( SnapDirection . BottomRight ) ;
827+ MoveActiveWindowTo ( SnapDirection . BottomRight ) ;
829828 }
830829
831830 public static void MoveActiveWindowToCenter ( object o , HotKeyEventArgs args )
832831 {
833- MoveActiveWindowToCorner ( SnapDirection . Center ) ;
832+ MoveActiveWindowTo ( SnapDirection . Center ) ;
834833 }
835834 #endregion
836835
@@ -839,14 +838,14 @@ public static void SendActiveWindowToBack(object sender = null, HotKeyEventArgs
839838 SendActiveWindowToBack ( ) ;
840839 }
841840
842- public static void IncreaseWindowTranspancy ( object sender = null , HotKeyEventArgs e = null )
841+ public static void IncreaseWindowTransparency ( object sender = null , HotKeyEventArgs e = null )
843842 {
844- SetWindowTransparancy ( 1 ) ;
843+ SetWindowTransparency ( 1 ) ;
845844 }
846845
847- public static void DecreaseWindowTranspancy ( object sender = null , HotKeyEventArgs e = null )
846+ public static void DecreaseWindowTransparency ( object sender = null , HotKeyEventArgs e = null )
848847 {
849- SetWindowTransparancy ( - 1 ) ;
848+ SetWindowTransparency ( - 1 ) ;
850849 }
851850
852851 public static void SaveLayout1 ( object sender = null , HotKeyEventArgs e = null )
0 commit comments