| 123 | } |
| 124 | |
| 125 | void AddFeaturesList( |
| 126 | not_null<Ui::VerticalLayout*> container, |
| 127 | const Ui::BoostFeatures &features, |
| 128 | int startFromLevel, |
| 129 | bool group) { |
| 130 | const auto add = [&]( |
| 131 | rpl::producer<TextWithEntities> text, |
| 132 | const style::icon &st) { |
| 133 | const auto label = container->add( |
| 134 | object_ptr<Ui::FlatLabel>( |
| 135 | container, |
| 136 | std::move(text), |
| 137 | st::boostFeatureLabel), |
| 138 | st::boostFeaturePadding); |
| 139 | object_ptr<Info::Profile::FloatingIcon>( |
| 140 | label, |
| 141 | st, |
| 142 | st::boostFeatureIconPosition); |
| 143 | }; |
| 144 | const auto lowMax = std::max({ |
| 145 | features.linkLogoLevel, |
| 146 | features.profileIconLevel, |
| 147 | features.autotranslateLevel, |
| 148 | features.transcribeLevel, |
| 149 | features.emojiPackLevel, |
| 150 | features.emojiStatusLevel, |
| 151 | features.wallpaperLevel, |
| 152 | features.customWallpaperLevel, |
| 153 | (features.nameColorsByLevel.empty() |
| 154 | ? 0 |
| 155 | : features.nameColorsByLevel.back().first), |
| 156 | (features.linkStylesByLevel.empty() |
| 157 | ? 0 |
| 158 | : features.linkStylesByLevel.back().first), |
| 159 | (features.profileColorsByLevel.empty() |
| 160 | ? 0 |
| 161 | : features.profileColorsByLevel.back().first), |
| 162 | }); |
| 163 | const auto highMax = std::max(lowMax, features.sponsoredLevel); |
| 164 | auto nameColors = 0; |
| 165 | auto linkStyles = 0; |
| 166 | auto profileColors = 0; |
| 167 | for (auto i = std::max(startFromLevel, 1); i <= highMax; ++i) { |
| 168 | if ((i > lowMax) && (i < highMax)) { |
| 169 | continue; |
| 170 | } |
| 171 | const auto unlocks = (i == startFromLevel); |
| 172 | { |
| 173 | const auto badge = container->add( |
| 174 | MakeFeaturesBadge( |
| 175 | container, |
| 176 | (unlocks |
| 177 | ? tr::lng_boost_level_unlocks |
| 178 | : tr::lng_boost_level)( |
| 179 | lt_count, |
| 180 | rpl::single(float64(i)))), |
| 181 | st::boostLevelBadgePadding, |
| 182 | style::al_top); |
no test coverage detected