CtrlLib: Option: SetColor

git-svn-id: svn://ultimatepp.org/upp/trunk@11016 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-04-17 07:43:42 +00:00
parent 2289cfb203
commit ccf287001a
4 changed files with 46 additions and 25 deletions

View file

@ -70,13 +70,14 @@ void DirDiffDlg::Compare()
void DirDiffDlg::ShowResult()
{
static Color cs[] = {SColorText(), Red, Green()};
static Color cs[] = { SColorText(), Red(), Green() };
files.Clear();
for(int i = 0; i < list.GetCount(); i++)
{
int n = list[i].d;
if( (n==0 && modified) || (n==1 && removed) || (n==2 && added))
files.Add(list[i].a, NativePathIcon(FileExists(list[i].b) ? list[i].b : list[i].c), StdFont(),cs[list[i].d]);
if(n == 0 && modified || n == 1 && removed || n == 2 && added)
files.Add(list[i].a, NativePathIcon(FileExists(list[i].b) ? list[i].b : list[i].c),
StdFont(), cs[list[i].d]);
}
info = AsString(files.GetCount()) + " files";
}
@ -124,9 +125,9 @@ DirDiffDlg::DirDiffDlg()
hidden.SetLabel(t_("Hidden"));
added.SetLabel(t_("New"));
added.SetColor(Green()).SetLabel(t_("New"));
modified.SetLabel(t_("Modified"));
removed.SetLabel(t_("Removed"));
removed.SetColor(Red()).SetLabel(t_("Removed"));
compare.SetLabel(t_("Compare"));
int bcy = compare.GetStdSize().cy;
@ -160,9 +161,9 @@ DirDiffDlg::DirDiffDlg()
dir1 <<= THISBACK(ClearFiles);
dir2 <<= THISBACK(ClearFiles);
modified << [=]() {ShowResult();};
removed << [=]() {ShowResult();};
added << [=]() {ShowResult();};
modified << [=] { ShowResult(); };
removed << [=] { ShowResult(); };
added << [=] { ShowResult(); };
files.WhenSel = THISBACK(File);