mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Automatically apply theme when combo box selection changed
This commit is contained in:
parent
f82cabfab1
commit
a9fa73e2a6
1 changed files with 8 additions and 2 deletions
|
@ -446,6 +446,12 @@ private void UpdateThemeControls()
|
|||
cbThemes.Enabled = btnThemeRemove.Enabled = btnApplyTheme.Enabled = cbThemes.Items.Count > 0;
|
||||
}
|
||||
|
||||
private void ApplySelectedTheme()
|
||||
{
|
||||
Program.MainForm.UpdateTheme();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
}
|
||||
|
||||
private void CbThemes_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Program.Settings.SelectedTheme = cbThemes.SelectedIndex;
|
||||
|
@ -460,6 +466,7 @@ private void CbThemes_SelectedIndexChanged(object sender, EventArgs e)
|
|||
}
|
||||
|
||||
UpdateThemeControls();
|
||||
ApplySelectedTheme();
|
||||
}
|
||||
|
||||
private void BtnThemeAdd_Click(object sender, EventArgs e)
|
||||
|
@ -505,8 +512,7 @@ private void BtnApplyTheme_Click(object sender, EventArgs e)
|
|||
Program.Settings.Themes[index] = (ShareXTheme)pgTheme.SelectedObject;
|
||||
cbThemes.Items[index] = Program.Settings.Themes[index];
|
||||
UpdateThemeControls();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
Program.MainForm.UpdateTheme();
|
||||
ApplySelectedTheme();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue