equal
deleted
inserted
replaced
54 } |
54 } |
55 } |
55 } |
56 |
56 |
57 void FrameTeams::resetColors() |
57 void FrameTeams::resetColors() |
58 { |
58 { |
59 currentColor=availableColors.end() - 1; // ensure next color is the first one |
59 currentColor = availableColors.last(); // ensure next color is the first one |
60 } |
60 } |
61 |
61 |
62 QColor FrameTeams::getNextColor() const |
62 QColor FrameTeams::getNextColor() const |
63 { |
63 { |
64 QList<QColor>::ConstIterator nextColor=currentColor; |
64 int idx = availableColors.indexOf(currentColor); |
65 ++nextColor; |
65 |
66 if (nextColor==availableColors.end()) nextColor=availableColors.begin(); |
66 idx = ++idx % availableColors.size(); |
67 return *nextColor; |
67 |
|
68 return availableColors.at(idx); |
68 } |
69 } |
69 |
70 |
70 void FrameTeams::addTeam(HWTeam team, bool willPlay) |
71 void FrameTeams::addTeam(HWTeam team, bool willPlay) |
71 { |
72 { |
72 TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this); |
73 TeamShowWidget* pTeamShowWidget = new TeamShowWidget(team, willPlay, this); |