mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-01-20 15:30:28 +01:00
Improve handling of SharedData
This commit is contained in:
parent
0b86664002
commit
092f96a9ab
|
|
@ -29,6 +29,7 @@ namespace FanControl
|
|||
public FanControlForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
SharedData_Update();
|
||||
|
||||
Text += " v" + Application.ProductVersion.ToString();
|
||||
Instance.Open(Text, "Global\\FanControlOnce");
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ namespace PerformanceOverlay
|
|||
public Controller()
|
||||
{
|
||||
contextMenu = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
|
||||
|
||||
SharedData_Update();
|
||||
Instance.Open(TitleWithVersion, "Global\\PerformanceOverlay");
|
||||
|
||||
showItem = new ToolStripMenuItem("&Show OSD");
|
||||
|
|
|
|||
|
|
@ -126,8 +126,6 @@ namespace PowerControl
|
|||
|
||||
if (ActiveOption == null)
|
||||
ActiveOption = Options.First();
|
||||
if (SelectedOption == null)
|
||||
SelectedOption = ActiveOption;
|
||||
|
||||
onUpdateToolStrip();
|
||||
}
|
||||
|
|
@ -171,7 +169,7 @@ namespace PowerControl
|
|||
return;
|
||||
|
||||
foreach (ToolStripMenuItem item in toolStripItem.DropDownItems)
|
||||
item.Checked = (item.Tag.ToString() == SelectedOption.ToString());
|
||||
item.Checked = Object.Equals(item.Tag, SelectedOption ?? ActiveOption);
|
||||
|
||||
toolStripItem.Visible = Visible && Options.Count > 0;
|
||||
}
|
||||
|
|
@ -254,7 +252,7 @@ namespace PowerControl
|
|||
else
|
||||
output += Color(Name + ":", Colors.Blue).PadRight(30);
|
||||
|
||||
output += optionText(SelectedOption);
|
||||
output += optionText(SelectedOption ?? ActiveOption);
|
||||
|
||||
if (!Object.Equals(ActiveOption, SelectedOption))
|
||||
output += " (active: " + optionText(ActiveOption) + ")";
|
||||
|
|
|
|||
Loading…
Reference in a new issue