Save window location when relaunching
This commit is contained in:
parent
a3e09c2407
commit
5a8a5baa33
84
App.config
Normal file
84
App.config
Normal file
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="unison.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<userSettings>
|
||||
<unison.Properties.Settings>
|
||||
<setting name="mpd_host" serializeAs="String">
|
||||
<value>192.168.0.1</value>
|
||||
</setting>
|
||||
<setting name="mpd_port" serializeAs="String">
|
||||
<value>6600</value>
|
||||
</setting>
|
||||
<setting name="mpd_password" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="snapcast_startup" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="snapcast_window" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="snapcast_path" serializeAs="String">
|
||||
<value>snapclient_0.26.0-1_win64</value>
|
||||
</setting>
|
||||
<setting name="snapcast_port" serializeAs="String">
|
||||
<value>1704</value>
|
||||
</setting>
|
||||
<setting name="volume_offset" serializeAs="String">
|
||||
<value>5</value>
|
||||
</setting>
|
||||
<setting name="nextTrack_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="nextTrack_vk" serializeAs="String">
|
||||
<value>176</value>
|
||||
</setting>
|
||||
<setting name="previousTrack_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="previousTrack_vk" serializeAs="String">
|
||||
<value>177</value>
|
||||
</setting>
|
||||
<setting name="playPause_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="playPause_vk" serializeAs="String">
|
||||
<value>179</value>
|
||||
</setting>
|
||||
<setting name="volumeUp_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="volumeUp_vk" serializeAs="String">
|
||||
<value>175</value>
|
||||
</setting>
|
||||
<setting name="volumeDown_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="volumeDown_vk" serializeAs="String">
|
||||
<value>174</value>
|
||||
</setting>
|
||||
<setting name="volumeMute_mod" serializeAs="String">
|
||||
<value>2</value>
|
||||
</setting>
|
||||
<setting name="volumeMute_vk" serializeAs="String">
|
||||
<value>173</value>
|
||||
</setting>
|
||||
<setting name="showWindow_mod" serializeAs="String">
|
||||
<value>3</value>
|
||||
</setting>
|
||||
<setting name="showWindow_vk" serializeAs="String">
|
||||
<value>13</value>
|
||||
</setting>
|
||||
<setting name="MainWindowTop" serializeAs="String">
|
||||
<value>100</value>
|
||||
</setting>
|
||||
<setting name="MainWindowLeft" serializeAs="String">
|
||||
<value>100</value>
|
||||
</setting>
|
||||
</unison.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
26
Properties/Settings.Designer.cs
generated
26
Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace unison.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
@ -286,5 +286,29 @@ namespace unison.Properties {
|
||||
this["showWindow_vk"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("100")]
|
||||
public double MainWindowTop {
|
||||
get {
|
||||
return ((double)(this["MainWindowTop"]));
|
||||
}
|
||||
set {
|
||||
this["MainWindowTop"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("100")]
|
||||
public double MainWindowLeft {
|
||||
get {
|
||||
return ((double)(this["MainWindowLeft"]));
|
||||
}
|
||||
set {
|
||||
this["MainWindowLeft"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,5 +68,11 @@
|
||||
<Setting Name="showWindow_vk" Type="System.UInt32" Scope="User">
|
||||
<Value Profile="(Default)">13</Value>
|
||||
</Setting>
|
||||
<Setting Name="MainWindowTop" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">100</Value>
|
||||
</Setting>
|
||||
<Setting Name="MainWindowLeft" Type="System.Double" Scope="User">
|
||||
<Value Profile="(Default)">100</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
@ -6,7 +6,7 @@
|
||||
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
|
||||
xmlns:properties="clr-namespace:unison.Resources"
|
||||
mc:Ignorable="d"
|
||||
Title="unison" Closing="Window_Closing" Icon="/Resources/icon-full.ico" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
|
||||
Title="unison" Closing="Window_Closing" LocationChanged="Window_LocationChanged" Icon="/Resources/icon-full.ico" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
|
||||
|
||||
<Window.Resources>
|
||||
<Style TargetType="Border" x:Key="UnselectedButton">
|
||||
|
@ -27,6 +27,8 @@ namespace unison
|
||||
InitializeComponent();
|
||||
DefaultState(true);
|
||||
WindowState = WindowState.Minimized;
|
||||
Top = Properties.Settings.Default.MainWindowTop;
|
||||
Left = Properties.Settings.Default.MainWindowLeft;
|
||||
|
||||
_settingsWin = new Settings();
|
||||
_radiosWin = new Radios();
|
||||
@ -336,5 +338,12 @@ namespace unison
|
||||
WindowState = WindowState.Minimized;
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void Window_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.MainWindowTop = Top;
|
||||
Properties.Settings.Default.MainWindowLeft = Left;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user