package_daemon: fix regressions from Set*UIColor merge.
Also use Set*UIColor where appropriate.
This commit is contained in:
parent
ed749c6221
commit
5d7e699ade
|
@ -210,25 +210,22 @@ ProblemWindow::_ClearProblemsGui()
|
||||||
void
|
void
|
||||||
ProblemWindow::_AddProblemsGui(BSolver* solver)
|
ProblemWindow::_AddProblemsGui(BSolver* solver)
|
||||||
{
|
{
|
||||||
rgb_color evenBackground = ui_color(B_LIST_BACKGROUND_COLOR);
|
|
||||||
rgb_color oddBackground = tint_color(evenBackground, 1.04);
|
|
||||||
|
|
||||||
int32 problemCount = solver->CountProblems();
|
int32 problemCount = solver->CountProblems();
|
||||||
for (int32 i = 0; i < problemCount; i++) {
|
for (int32 i = 0; i < problemCount; i++) {
|
||||||
_AddProblem(solver->ProblemAt(i),
|
_AddProblem(solver->ProblemAt(i),
|
||||||
(i & 1) == 0 ? evenBackground : oddBackground);
|
(i & 1) == 0 ? B_NO_TINT : 1.04);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProblemWindow::_AddProblem(BSolverProblem* problem,
|
ProblemWindow::_AddProblem(BSolverProblem* problem,
|
||||||
const rgb_color& backgroundColor)
|
const float backgroundTint)
|
||||||
{
|
{
|
||||||
BGroupView* problemGroup = new BGroupView(B_VERTICAL);
|
BGroupView* problemGroup = new BGroupView(B_VERTICAL);
|
||||||
fContainerView->AddChild(problemGroup);
|
fContainerView->AddChild(problemGroup);
|
||||||
problemGroup->GroupLayout()->SetInsets(B_USE_SMALL_INSETS);
|
problemGroup->GroupLayout()->SetInsets(B_USE_SMALL_INSETS);
|
||||||
problemGroup->SetViewColor(backgroundColor);
|
problemGroup->SetViewUIColor(B_LIST_BACKGROUND_COLOR, backgroundTint);
|
||||||
|
|
||||||
BStringView* problemView = new BStringView(NULL, problem->ToString());
|
BStringView* problemView = new BStringView(NULL, problem->ToString());
|
||||||
problemGroup->AddChild(problemView);
|
problemGroup->AddChild(problemView);
|
||||||
|
@ -236,6 +233,7 @@ ProblemWindow::_AddProblem(BSolverProblem* problem,
|
||||||
problemView->GetFont(&problemFont);
|
problemView->GetFont(&problemFont);
|
||||||
problemFont.SetFace(B_BOLD_FACE);
|
problemFont.SetFace(B_BOLD_FACE);
|
||||||
problemView->SetFont(&problemFont);
|
problemView->SetFont(&problemFont);
|
||||||
|
problemView->AdoptParentColors();
|
||||||
|
|
||||||
int32 solutionCount = problem->CountSolutions();
|
int32 solutionCount = problem->CountSolutions();
|
||||||
for (int32 k = 0; k < solutionCount; k++) {
|
for (int32 k = 0; k < solutionCount; k++) {
|
||||||
|
@ -257,6 +255,7 @@ ProblemWindow::_AddProblem(BSolverProblem* problem,
|
||||||
BString().SetToFormat("- %s",
|
BString().SetToFormat("- %s",
|
||||||
_SolutionElementText(element).String()));
|
_SolutionElementText(element).String()));
|
||||||
elementsGroup->AddView(elementView);
|
elementsGroup->AddView(elementView);
|
||||||
|
elementView->AdoptParentColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
fSolutions[solutionButton] = Solution(problem, solution);
|
fSolutions[solutionButton] = Solution(problem, solution);
|
||||||
|
|
|
@ -56,7 +56,7 @@ private:
|
||||||
void _ClearProblemsGui();
|
void _ClearProblemsGui();
|
||||||
void _AddProblemsGui(BSolver* solver);
|
void _AddProblemsGui(BSolver* solver);
|
||||||
void _AddProblem(BSolverProblem* problem,
|
void _AddProblem(BSolverProblem* problem,
|
||||||
const rgb_color& backgroundColor);
|
const float backgroundTint);
|
||||||
BString _SolutionElementText(
|
BString _SolutionElementText(
|
||||||
const BSolverProblemSolutionElement*
|
const BSolverProblemSolutionElement*
|
||||||
element) const;
|
element) const;
|
||||||
|
|
|
@ -89,15 +89,16 @@ ResultWindow::AddLocationChanges(const char* location,
|
||||||
|
|
||||||
locationGroup->GroupLayout()->SetInsets(B_USE_SMALL_INSETS);
|
locationGroup->GroupLayout()->SetInsets(B_USE_SMALL_INSETS);
|
||||||
|
|
||||||
rgb_color background = ui_color(B_LIST_BACKGROUND_COLOR);
|
float backgroundTint = B_NO_TINT;
|
||||||
if ((fContainerView->CountChildren() & 1) != 0)
|
if ((fContainerView->CountChildren() & 1) != 0)
|
||||||
background = tint_color(background, 1.04);
|
backgroundTint = 1.04;
|
||||||
locationGroup->SetViewColor(background);
|
locationGroup->SetViewUIColor(B_LIST_BACKGROUND_COLOR, backgroundTint);
|
||||||
|
|
||||||
BStringView* locationView = new BStringView(NULL,
|
BStringView* locationView = new BStringView(NULL,
|
||||||
BString().SetToFormat("in %s:", location));
|
BString().SetToFormat("in %s:", location));
|
||||||
locationGroup->AddChild(locationView);
|
locationGroup->AddChild(locationView);
|
||||||
locationView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
locationView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
|
locationView->AdoptParentColors();
|
||||||
BFont locationFont;
|
BFont locationFont;
|
||||||
locationView->GetFont(&locationFont);
|
locationView->GetFont(&locationFont);
|
||||||
locationFont.SetFace(B_BOLD_FACE);
|
locationFont.SetFace(B_BOLD_FACE);
|
||||||
|
@ -207,6 +208,7 @@ ResultWindow::_AddPackages(BGroupLayout* packagesGroup,
|
||||||
BStringView* packageView = new BStringView(NULL, text);
|
BStringView* packageView = new BStringView(NULL, text);
|
||||||
packagesGroup->AddView(packageView);
|
packagesGroup->AddView(packageView);
|
||||||
packageView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
packageView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
|
||||||
|
packageView->AdoptParentColors();
|
||||||
|
|
||||||
packagesAdded = true;
|
packagesAdded = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue