mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 09:17:36 +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;
|
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)
|
private void CbThemes_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.Settings.SelectedTheme = cbThemes.SelectedIndex;
|
Program.Settings.SelectedTheme = cbThemes.SelectedIndex;
|
||||||
|
@ -460,6 +466,7 @@ private void CbThemes_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateThemeControls();
|
UpdateThemeControls();
|
||||||
|
ApplySelectedTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnThemeAdd_Click(object sender, EventArgs e)
|
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;
|
Program.Settings.Themes[index] = (ShareXTheme)pgTheme.SelectedObject;
|
||||||
cbThemes.Items[index] = Program.Settings.Themes[index];
|
cbThemes.Items[index] = Program.Settings.Themes[index];
|
||||||
UpdateThemeControls();
|
UpdateThemeControls();
|
||||||
ShareXResources.ApplyTheme(this);
|
ApplySelectedTheme();
|
||||||
Program.MainForm.UpdateTheme();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue