Skip to content

Commit e10306e

Browse files
committed
Restore collapsed node state after reset
1 parent d89ed85 commit e10306e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

OpenHardwareMonitor/UI/MainForm.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public sealed partial class MainForm : Form
4646
private readonly UnitManager _unitManager;
4747
private readonly UpdateVisitor _updateVisitor = new();
4848
private readonly WmiProvider _wmiProvider;
49-
private readonly Timer checkUpdatesTimer;
49+
private readonly Timer _checkUpdatesTimer;
5050

5151
private int _delayCount;
5252
private bool _selectionDragging;
@@ -68,9 +68,9 @@ public MainForm()
6868
Icon = Icon.ExtractAssociatedIcon(Updater.CurrentFileLocation);
6969
#if DEBUG
7070
//start check updates timer (silent for errors)
71-
checkUpdatesTimer = new Timer { Interval = 60 * 60 * 1000 };
72-
checkUpdatesTimer.Tick += (o, e) => Updater.CheckForUpdates(true);
73-
checkUpdatesTimer.Start();
71+
_checkUpdatesTimer = new Timer { Interval = 60 * 60 * 1000 };
72+
_checkUpdatesTimer.Tick += (_, _) => Updater.CheckForUpdates(true);
73+
_checkUpdatesTimer.Start();
7474
#endif
7575
portableModeMenuItem.Checked = _settings.IsPortable;
7676

@@ -949,7 +949,7 @@ private void ResetMinMaxMenuItem_Click(object sender, EventArgs e)
949949
sensorClick.ResetMax();
950950
}));
951951
}
952-
952+
953953
private void MainForm_MoveOrResize(object sender, EventArgs e)
954954
{
955955
if (WindowState != FormWindowState.Minimized)
@@ -969,6 +969,7 @@ private void ResetClick(object sender, EventArgs e)
969969
_computer.Reset();
970970
// restore the MainIcon setting
971971
_systemTray.IsMainIconEnabled = _minimizeToTray.Value;
972+
RestoreCollapsedNodeState(treeView);
972973
}
973974

974975
private void TreeView_MouseMove(object sender, MouseEventArgs e)

0 commit comments

Comments
 (0)