2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Edit groups and channels invite privacy.

This commit is contained in:
John Preston
2017-03-17 19:19:57 +03:00
parent 61c5b45d7a
commit 346daee421
7 changed files with 87 additions and 3 deletions

View File

@@ -74,7 +74,6 @@ void PrivacyExceptionsBoxController::prepareViewHook() {
void PrivacyExceptionsBoxController::rowClicked(PeerListBox::Row *row) {
view()->setRowChecked(row, !row->checked());
view()->updateRow(row);
}
std::unique_ptr<PrivacyExceptionsBoxController::Row> PrivacyExceptionsBoxController::createRow(History *history) {
@@ -190,12 +189,12 @@ int EditPrivacyBox::countDefaultHeight(int newWidth) {
auto value = static_cast<int>(Option::Everyone);
auto selected = false;
auto fake = object_ptr<OptionWidget>(nullptr, value, selected, label, description);
fake->resizeToWidth(newWidth);
fake->resizeToNaturalWidth(newWidth - st::editPrivacyOptionMargin.left() - st::editPrivacyOptionMargin.right());
return st::editPrivacyOptionMargin.top() + fake->heightNoMargins() + st::editPrivacyOptionMargin.bottom();
};
auto labelHeight = [this, newWidth](const QString &text, const style::FlatLabel &st) {
auto fake = object_ptr<Ui::FlatLabel>(nullptr, text, Ui::FlatLabel::InitType::Simple, st);
fake->resizeToWidth(newWidth);
fake->resizeToNaturalWidth(newWidth - st::editPrivacyPadding.left() - st::editPrivacyPadding.right());
return st::editPrivacyPadding.top() + fake->heightNoMargins() + st::editPrivacyPadding.bottom();
};
auto linkMargins = exceptionLinkMargins();