From f5a405e6f1ac73dc51e4d76f598da4c4b66ea084 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 12 Jul 2017 16:53:42 +0300 Subject: [PATCH] Fix auto media download settings box layout. --- Telegram/SourceFiles/boxes/connection_box.cpp | 2 +- Telegram/SourceFiles/boxes/edit_privacy_box.cpp | 2 +- Telegram/SourceFiles/ui/widgets/checkbox.cpp | 2 +- Telegram/SourceFiles/ui/widgets/widgets.style | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index d23d6be4b..61be4df67 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -264,7 +264,7 @@ AutoDownloadBox::AutoDownloadBox(QWidget *parent) , _gifPrivate(this, lang(lng_media_auto_private_chats), !(cAutoDownloadGif() & dbiadNoPrivate), st::defaultBoxCheckbox) , _gifGroups(this, lang(lng_media_auto_groups), !(cAutoDownloadGif() & dbiadNoGroups), st::defaultBoxCheckbox) , _gifPlay(this, lang(lng_media_auto_play), cAutoPlayGif(), st::defaultBoxCheckbox) -, _sectionHeight(st::boxTitleHeight + 2 * (st::defaultBoxCheckbox.height + st::setLittleSkip)) { +, _sectionHeight(st::boxTitleHeight + 2 * (st::defaultCheck.diameter + st::setLittleSkip)) { } void AutoDownloadBox::prepare() { diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 0de16c101..9df16a692 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -145,7 +145,7 @@ int EditPrivacyBox::countDefaultHeight(int newWidth) { if (!_controller->hasOption(option)) { return 0; } - return st::editPrivacyOptionMargin.top() + st::defaultBoxCheckbox.height + st::editPrivacyOptionMargin.bottom(); + return st::editPrivacyOptionMargin.top() + st::defaultCheck.diameter + st::editPrivacyOptionMargin.bottom(); }; auto labelHeight = [this, newWidth](const QString &text, const style::FlatLabel &st, style::margins padding) { if (text.isEmpty()) { diff --git a/Telegram/SourceFiles/ui/widgets/checkbox.cpp b/Telegram/SourceFiles/ui/widgets/checkbox.cpp index 7644a72b6..f5dcfcfcd 100644 --- a/Telegram/SourceFiles/ui/widgets/checkbox.cpp +++ b/Telegram/SourceFiles/ui/widgets/checkbox.cpp @@ -397,7 +397,7 @@ void Checkbox::onStateChanged(State was, StateChangeSource source) { } int Checkbox::resizeGetHeight(int newWidth) { - return _st.height ? _st.height : _check->getSize().height(); + return _check->getSize().height(); } QImage Checkbox::prepareRippleMask() const { diff --git a/Telegram/SourceFiles/ui/widgets/widgets.style b/Telegram/SourceFiles/ui/widgets/widgets.style index ccea3b47d..18ed3a9ba 100644 --- a/Telegram/SourceFiles/ui/widgets/widgets.style +++ b/Telegram/SourceFiles/ui/widgets/widgets.style @@ -135,7 +135,6 @@ Checkbox { textFg: color; width: pixels; - height: pixels; margin: margins; textPosition: point;