Skip to content

Commit

Permalink
rebuild;
Browse files Browse the repository at this point in the history
lastdockstatus is saved instead of DockedTo
  • Loading branch information
Carl Chang committed Oct 22, 2017
1 parent d9bfa55 commit c714c2a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static void Quit(bool savesetting)
{
win.CurrentSetting.Win_Pos = new Point(win.Left, win.Top);
win.CurrentSetting.Win_Size = new Size(win.Width, win.Height);
win.CurrentSetting.DockedTo = (int)win.DockedTo;
win.CurrentSetting.DockedTo = (int)win.lastdockstatus;
}
}
DesktopNote.Properties.Settings.Default.Save();
Expand Down
24 changes: 13 additions & 11 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e)
}

//tray icon double click
App.TrayIcon.TrayMouseDoubleClick += (obj, args) =>
{
foreach (var win in App.MainWindows)
{
win.Activate();
win.UnDock();
}
};
App.TrayIcon.TrayMouseDoubleClick += TrayIcon_TrayMouseDoubleClick;
}

//check and merge previous settings
Expand All @@ -418,7 +411,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e)
Top = CurrentSetting.Win_Pos.Y;

lastdockstatus = (DockStatus)CurrentSetting.DockedTo;
DockedTo = lastdockstatus;
//DockedTo = DockStatus.None;
RTB_Main.FontFamily = new FontFamily(CurrentSetting.Font);
RTB_Main.Foreground = new SolidColorBrush(CurrentSetting.FontColor);
RTB_Main.Background = new SolidColorBrush(CurrentSetting.BackColor);
Expand Down Expand Up @@ -498,7 +491,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e)
RTB_Main.IsUndoEnabled = true;
//without the above two lines, Load actions can be undone.

App.CurrScrnRect = new GetCurrentMonitor().GetInfo(this);
if (CurrentSetting.AutoDock) DockToSide(true);

var task_save = new Thread(SaveNotes) { IsBackground = true };
task_save.Start();
Expand All @@ -507,7 +500,7 @@ private void Win_Main_Loaded(object sender, RoutedEventArgs e)
source.AddHook(WndProc);

}

private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
if (msg == SingleInstance.RegisteredWM)
Expand Down Expand Up @@ -556,6 +549,15 @@ private void TM_NewNote_Click(object sender, RoutedEventArgs e)
{
Win_Format.NewNote();
}

private void TrayIcon_TrayMouseDoubleClick(object sender, RoutedEventArgs e)
{
foreach (var win in App.MainWindows)
{
win.Activate();
win.UnDock();
}
}
#endregion


Expand Down
Binary file modified bin/Release/DesktopNote.exe
Binary file not shown.

0 comments on commit c714c2a

Please sign in to comment.