Skip to content

Commit

Permalink
Save minimap pinned state (Closes #655) (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian committed Apr 18, 2024
1 parent f54d95c commit 6b7478f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Daybreak/Configuration/Options/MinimapWindowOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Daybreak.Configuration.Options;
[OptionsSynchronizationIgnore]
public sealed class MinimapWindowOptions
{
public bool Pinned { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions Daybreak/Services/TradeChat/WordHighlightingService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Daybreak.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Media;

Expand Down
2 changes: 2 additions & 0 deletions Daybreak/Views/FocusView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ private void MinimapExtractButton_Clicked(object sender, EventArgs e)
};

var minimapWindowOptions = this.minimapWindowOptions.Value.ThrowIfNull();
this.minimapWindow.Pinned = minimapWindowOptions.Pinned;
var dpiScale = VisualTreeHelper.GetDpi(this.minimapWindow);
var minimapSize = new Rect
{
Expand Down Expand Up @@ -970,6 +971,7 @@ private void MinimapWindow_Closed(object? sender, EventArgs e)
options.Height = this.minimapWindow.Height;
options.DpiX = dpiScale.DpiScaleX;
options.DpiY = dpiScale.DpiScaleY;
options.Pinned = this.minimapWindow.Pinned;

this.minimapWindowOptions.UpdateOption();

Expand Down

0 comments on commit 6b7478f

Please sign in to comment.