Adapt settings label colors to light vs dark UI themes

This commit is contained in:
Vojtech Kral 2018-04-09 14:41:55 +02:00
parent 601185f113
commit 388deb71ab
3 changed files with 45 additions and 13 deletions

View file

@ -265,14 +265,14 @@ void Tab::update_changed_ui()
bool is_modified_value = true;
std::string sys_icon = wxMSW ? "sys_lock.png" : "lock.png";
std::string icon = wxMSW ? "action_undo.png" : "arrow_undo.png";
wxColour& color = *get_sys_label_clr();
wxColour color = get_sys_label_clr();
if (find(m_sys_options.begin(), m_sys_options.end(), opt_key) == m_sys_options.end()) {
is_nonsys_value = true;
sys_icon = m_nonsys_btn_icon;
if(find(m_dirty_options.begin(), m_dirty_options.end(), opt_key) == m_dirty_options.end())
color = wxSYS_COLOUR_WINDOWTEXT;
color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
else
color = *get_modified_label_clr();
color = get_modified_label_clr();
}
if (find(m_dirty_options.begin(), m_dirty_options.end(), opt_key) == m_dirty_options.end())
{
@ -343,7 +343,7 @@ void Tab::update_sys_ui_after_sel_preset()
field->m_Undo_to_sys_btn->SetBitmap(wxBitmap(from_u8(var(m_nonsys_btn_icon)), wxBITMAP_TYPE_PNG));
field->m_is_nonsys_value = true;
if (field->m_Label != nullptr){
field->m_Label->SetForegroundColour(wxSYS_COLOUR_WINDOWTEXT);
field->m_Label->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
field->m_Label->Refresh(true);
}
}
@ -386,11 +386,11 @@ void Tab::update_changed_tree_ui()
break;
}
if (sys_page)
m_treectrl->SetItemTextColour(cur_item, *get_sys_label_clr());
m_treectrl->SetItemTextColour(cur_item, get_sys_label_clr());
else if (modified_page)
m_treectrl->SetItemTextColour(cur_item, *get_modified_label_clr());
m_treectrl->SetItemTextColour(cur_item, get_modified_label_clr());
else
m_treectrl->SetItemTextColour(cur_item, wxSYS_COLOUR_WINDOWTEXT);
m_treectrl->SetItemTextColour(cur_item, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
page->m_is_nonsys_values = !sys_page;
page->m_is_modified_values = modified_page;