Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions IndexerGUI/DefaultUserSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
<SelectedDrives xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></SelectedDrives>
<WndHeight>700</WndHeight>
<WndWidth>1000</WndWidth>
<Xpos>500</Xpos>
<Ypos>500</Ypos>
</UserSettings>
6 changes: 5 additions & 1 deletion IndexerGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
StateChanged="Window_StateChanged"
LostKeyboardFocus="Window_LostKeyboardFocus"
GotKeyboardFocus="Window_GotKeyboardFocus"
mc:Ignorable="d">
mc:Ignorable="d"
Top="{Binding Top, Source=indexer:UserSettings.XPos, Mode=TwoWay}"
Left="{Binding Left, Source=indexer:UserSettings.YPos, Mode=TwoWay}"
Height="{Binding Height, Source=indexer:UserSettings.WndHeight, Mode=TwoWay}"
Width="{Binding Height, Source=indexer:UserSettings.WndWidth, Mode=TwoWay}">
<!--PreviewMouseWheel="MainWindow_OnMouseWheel"-->

<Window.Resources>
Expand Down
4 changes: 4 additions & 0 deletions IndexerGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private void InitPart2()
ExcludeHiddenAndSystem = settings.ExcludeHiddenAndSystem;
ExcludeFiles = settings.ExcludeFiles;
ExcludeFolders = settings.ExcludeFolders;
Left = settings.XPos;
Top = settings.YPos;

var initialDirPath = CmdArgumentsParser.FilterDirPath;
if (string.IsNullOrWhiteSpace(initialDirPath))
Expand Down Expand Up @@ -468,6 +470,8 @@ private void MainWindow_OnClosing(object sender, CancelEventArgs cancelEventArgs
{
Log.Instance.Debug("MainWindow_OnClosing called.");

UserSettings.Instance.XPos = this.Left;
UserSettings.Instance.YPos = this.Top;
UserSettings.Instance.Save(this);

if (SystemConfigFlagsWrapper.Instance().PipeManager)
Expand Down
10 changes: 10 additions & 0 deletions IndexerGUI/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ private UserSettings()
ExcludeHiddenAndSystem = saved.ExcludeHiddenAndSystem;
ExcludeFolders = saved.ExcludeFolders;
ExcludeFiles = saved.ExcludeFiles;
YPos = saved.YPos;
XPos = saved.XPos;
}
catch (Exception ex)
{
Expand Down Expand Up @@ -75,6 +77,12 @@ private UserSettings()
[DataMember]
public bool ExcludeFiles { get; set; }

[DataMember]
public double XPos { get; set; }

[DataMember]
public double YPos { get; set; }

public void Save(MainWindow w)
{
WndHeight = w.Height;
Expand All @@ -83,6 +91,8 @@ public void Save(MainWindow w)
ExcludeHiddenAndSystem = w.ExcludeHiddenAndSystem;
ExcludeFolders = w.ExcludeFolders;
ExcludeFiles = w.ExcludeFiles;
XPos = w.Top;
YPos = w.Left;

SelectedDrives.Clear();

Expand Down