diff --git a/Docs/ConfigurationDialog.png b/Docs/ConfigurationDialog.png new file mode 100644 index 0000000..aed6fbb Binary files /dev/null and b/Docs/ConfigurationDialog.png differ diff --git a/Docs/MainMenu.png b/Docs/MainMenu.png new file mode 100644 index 0000000..f00ab8d Binary files /dev/null and b/Docs/MainMenu.png differ diff --git a/Docs/releasenotes.md b/Docs/releasenotes.md new file mode 100644 index 0000000..a24213b --- /dev/null +++ b/Docs/releasenotes.md @@ -0,0 +1,13 @@ +# Release Notes + +## v1.5.0 - 2020-01-01 + +- Added options for Restore Window Positions on Startup and Restore Desktop Icons on Startup +- Restructured Docs + +## v1.4.2 - 2019-12-07 + +- Major Refactoring into classes and consistent functionality +- Fixed Window spanning +- Introduced Window Position and Desktop Icon functionality +- Added Configuration dialog diff --git a/Docs/todo.md b/Docs/todo.md new file mode 100644 index 0000000..cbbc8e0 --- /dev/null +++ b/Docs/todo.md @@ -0,0 +1,8 @@ +# To Do + +- Move Window Positions Menu to Context Menu (Option?) +- Move Saved Desktop Icon Positions Menu to Context Menu (Option?) +- History list of Saved Window Positions +- History list of Saved Desktop Icon Positions +- Add icons to other context menu items +- Support other config value types as required diff --git a/Lib/UserConfig.ahk b/Lib/UserConfig.ahk index 35833ac..b857a1d 100644 --- a/Lib/UserConfig.ahk +++ b/Lib/UserConfig.ahk @@ -31,6 +31,10 @@ class UserConfig readValue := defaultValue } } + else if (type == "boolean") + { + readValue := (readValue) ? true : false + } } return readValue diff --git a/README.md b/README.md index c911419..776b8f1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,58 @@ -# WindowMenu -AutoHotKey Window Menu for fine grained control of positioning +# Window Extensions + +AutoHotKey Window Menu and Extensions for fine grained control of positioning + +## Basic Usage: + +To invoke: + +- Right click the right half of any Window Caption bar +- Press `Win-W` + +Brings up the main menu. + +Selecting any of the entries applies to the target window, shown at the top of the menu. + +> Except: `Save / Restore Window Positions` and `Save / Restore Desktop Icons` + +![Main Menu](Docs/MainMenu.png) + +A Configuration dialog, available from the tray icon, allows controlling some aspects of the functionality. + +![Configuration Dialog](Docs/ConfigurationDialog.png) + +## Features + +### Optimum Positioning + +Window Extensions has menu options dedicated to Optimum positioning. + +There are 5 or so menu items that position windows with increasing indentation. (Configurable) + +### Window Control + +There are other options for controlling window positioning, eg: + +- Dedicated positions (Corners, columns, etc.) +- Centring +- Controlling transparency +- Rolling up to just a title bar +- Spanning multiple monitors if more than 1 monitor is available + +### Window Positions + +Window Extensions has the ability to save window positions and restore them on demand. + +This was originally intended as a remedy to the widely known Multi-Monitor bug in Windows that doesn't restore window positions when unlocking or activating / deactivating monitors. + +Window positions are saved to a file in the Users data folder (E.g. %APPDATA%\Roaming\WindowExtensions) + +### Desktop Icons + +Window Extensions has the ability to save desktop icon positions and restore them on demand. + +There are other tools available which are dedicated to this task, with perhaps more functionality. This feature was added to Window Extensions due to restrictions in being able to use these tools on some sites that I visit. + +Desktop Icon positions are saved to a file in the Users data folder (E.g. %APPDATA%\Roaming\WindowExtensions) + +## [To Do](Docs/todo.md) diff --git a/Setup/WindowMenu_Setup.iss b/Setup/WindowMenu_Setup.iss index f8974c3..5b6b4b7 100644 --- a/Setup/WindowMenu_Setup.iss +++ b/Setup/WindowMenu_Setup.iss @@ -1,6 +1,6 @@ #define AppName "WindowExtensions" #define AppTitle "Window Extensions" -#define AppVersion "1.4.2" +#define AppVersion "1.5.0" [Setup] AppName={#AppName} diff --git a/WindowExtensions.ahk b/WindowExtensions.ahk index aa4ccfe..3912b88 100644 --- a/WindowExtensions.ahk +++ b/WindowExtensions.ahk @@ -7,11 +7,6 @@ SetFormat, float, 0.0 SetBatchLines, 10ms SetTitleMatchMode, 2 -;-------------------------------------------------------------------------------- -; ToDo -; ==== -; Support other config value types - ;-------------------------------------------------------------------------------- ; Initialisation AppName := "WindowExtensions" @@ -19,7 +14,7 @@ AppTitle := "Window Extensions" AppDescription := "Window Extensions Menu and HotKeys" AppNotes := "Concise and consistent control over Window Positions. Right-click right half of Window Caption bar to invoke, or hit WinKey-W" AppURL := "https://github.com/martinsmith1968/WindowExtensions" -AppVersion := "1.4.2.0" +AppVersion := "1.5.0.0" ;-------------------------------------------------------------------------------- ; Setup Tray Menu diff --git a/WindowExtensionsUserConfig.ahk b/WindowExtensionsUserConfig.ahk index 63d6577..3d421de 100644 --- a/WindowExtensionsUserConfig.ahk +++ b/WindowExtensionsUserConfig.ahk @@ -6,6 +6,8 @@ DefaultCascadeGutterSize := 30 DefaultColumnGutterSize := 5 DefaultGridGutterSize := 5 DefaultSpanMonitorGutterSize := 5 +DefaultRestoreDesktopIconsOnStartup := false +DefaultWindowPositionsOnStartup := false __New() { @@ -19,6 +21,8 @@ DefaultSpanMonitorGutterSize := 5 this.Properties.push("ColumnGutterSize") this.Properties.push("GridGutterSize") this.Properties.push("SpanMonitorGutterSize") + this.Properties.push("RestoreDesktopIconsOnStartup") + this.Properties.push("RestoreWindowPositionsOnStartup") } CascadeGutterSize @@ -68,4 +72,28 @@ DefaultSpanMonitorGutterSize := 5 base.SetValue("General", base.GetPropertyNameFromFunc(A_ThisFunc), value) } } + + RestoreDesktopIconsOnStartup + { + get + { + return base.GetValue("General", base.GetPropertyNameFromFunc(A_ThisFunc), this.DefaultRestoreDesktopIconsOnStartup, "boolean") + } + set + { + base.SetValue("General", base.GetPropertyNameFromFunc(A_ThisFunc), value) + } + } + + RestoreWindowPositionsOnStartup + { + get + { + return base.GetValue("General", base.GetPropertyNameFromFunc(A_ThisFunc), this.DefaultWindowPositionsOnStartup, "boolean") + } + set + { + base.SetValue("General", base.GetPropertyNameFromFunc(A_ThisFunc), value) + } + } } diff --git a/WindowExtensionsUserConfigGui.ahk b/WindowExtensionsUserConfigGui.ahk index ab2b9f9..b6b4d70 100644 --- a/WindowExtensionsUserConfigGui.ahk +++ b/WindowExtensionsUserConfigGui.ahk @@ -11,17 +11,23 @@ BuildUserConfigGui(windowExtensionsUserConfig) global columnGutterSize global gridGutterSize global spanMonitorGutterSize + global restoreDesktopIconsOnStartup + global restoreWindowPositionsOnStartup cascadeGutterSize := windowExtensionsUserConfig.CascadeGutterSize columnGutterSize := windowExtensionsUserConfig.ColumnGutterSize gridGutterSize := windowExtensionsUserConfig.GridGutterSize spanMonitorGutterSize := windowExtensionsUserConfig.SpanMonitorGutterSize + restoreDesktopIconsOnStartup := windowExtensionsUserConfig.RestoreDesktopIconsOnStartup ? 1 : 0 + restoreWindowPositionsOnStartup := windowExtensionsUserConfig.RestoreWindowPositionsOnStartup ? 1 : 0 Gui, Config:New, -SysMenu Gui, Config:Add, Text,, Cascade Gutter Size: Gui, Config:Add, Text,, Column Gutter Size: Gui, Config:Add, Text,, Grid Gutter Size: Gui, Config:Add, Text,, Span Monitor Gutter Size: + Gui, Config:Add, Text,, Restore Desktop Icons on Startup: + Gui, Config:Add, Text,, Restore Window Positions on Startup: Gui, Config:Add, Edit, ym w80 Gui, Config:Add, UpDown, vcascadeGutterSize Range0-100, %cascadeGutterSize% Gui, Config:Add, Edit, w80 @@ -30,8 +36,10 @@ BuildUserConfigGui(windowExtensionsUserConfig) Gui, Config:Add, UpDown, vgridGutterSize Range0-100, %gridGutterSize% Gui, Config:Add, Edit, w80 Gui, Config:Add, UpDown, vspanMonitorGutterSize Range0-100, %spanMonitorGutterSize% - Gui, Config:Add, Button, default x50 y120 w80, OK ; The label ButtonOK (if it exists) will be run when the button is pressed. - Gui, Config:Add, Button, x140 y120 w80, Cancel ; The label ButtonCancel (if it exists) will be run when the button is pressed. + Gui, Config:Add, Checkbox, vrestoreDesktopIconsOnStartup Checked%restoreDesktopIconsOnStartup%, + Gui, Config:Add, Checkbox, vrestoreWindowPositionsOnStartup Checked%restoreWindowPositionsOnStartup%, `n + Gui, Config:Add, Button, default x50 y180 w80, OK ; The label ButtonOK (if it exists) will be run when the button is pressed. + Gui, Config:Add, Button, x140 y180 w80, Cancel ; The label ButtonCancel (if it exists) will be run when the button is pressed. } DestroyConfigGui() @@ -79,6 +87,8 @@ ConfigButtonOK: G_UserConfig.ColumnGutterSize := columnGutterSize G_UserConfig.GridGutterSize := gridGutterSize G_UserConfig.SpanMonitorGutterSize := spanMonitorGutterSize + G_UserConfig.RestoreDesktopIconsOnStartup := restoreDesktopIconsOnStartup + G_UserConfig.RestoreWindowPositionsOnStartup := restoreWindowPositionsOnStartup G_UserConfig.Save() DestroyConfigGui() diff --git a/WindowMenu.ahk b/WindowMenu.ahk index 097c947..66ec23f 100644 --- a/WindowMenu.ahk +++ b/WindowMenu.ahk @@ -157,6 +157,17 @@ menuIndex := AddWindowMenuItem("&Cancel", "NullHandler", "", menuIndex) ; for any reason: OnExit, ExitSub +;-------------------------------------------------------------------------------- +; Apply Startup options ? +if (G_UserConfig.RestoreDesktopIconsOnStartup) +{ + RestoreDesktopIcons() +} +if (G_UserConfig.RestoreWindowPositionsOnStartup) +{ + RestoreWindowPositions() +} + return ; End of script's auto-execute section. ExitSub: