Improve join group call bar style.

This commit is contained in:
John Preston 2020-12-08 10:44:22 +04:00
parent ba185d1f6f
commit a527d5c535
5 changed files with 28 additions and 27 deletions

View File

@ -1848,7 +1848,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_invite_done_user" = "You invited {user} to the voice chat.";
"lng_group_call_invite_done_many#one" = "You invited **{count} member** to the voice chat.";
"lng_group_call_invite_done_many#other" = "You invited **{count} members** to the voice chat.";
"lng_group_call_no_members" = "No members";
"lng_group_call_no_members" = "click to join";
"lng_group_call_members#one" = "{count} member";
"lng_group_call_members#other" = "{count} members";
"lng_group_call_no_anonymous" = "Sorry, anonymous group admins can't join voice chats.";

View File

@ -591,9 +591,9 @@ groupCallTopBarUserpicSize: 28px;
groupCallTopBarUserpicShift: 8px;
groupCallTopBarUserpicStroke: 2px;
groupCallTopBarJoin: RoundButton(defaultActiveButton) {
width: -30px;
height: 28px;
textTop: 5px;
width: -26px;
height: 26px;
textTop: 4px;
}
groupCallBox: Box(defaultBox) {
button: RoundButton(defaultBoxButton) {

View File

@ -275,8 +275,7 @@ void Settings::addFromSerialized(const QByteArray &serialized) {
>> groupCallPushToTalkShortcut
>> groupCallPushToTalkDelay;
}
if (false && stream.status() != QDataStream::Ok) {
AssertIsDebug();
if (stream.status() != QDataStream::Ok) {
LOG(("App Error: "
"Bad data for Core::Settings::constructFromSerialized()"));
return;

View File

@ -1262,12 +1262,12 @@ void HistoryWidget::orderWidgets() {
if (_contactStatus) {
_contactStatus->raise();
}
if (_groupCallBar) {
_groupCallBar->raise();
}
if (_pinnedBar) {
_pinnedBar->raise();
}
if (_groupCallBar) {
_groupCallBar->raise();
}
_topShadow->raise();
if (_fieldAutocomplete) {
_fieldAutocomplete->raise();
@ -4448,17 +4448,17 @@ void HistoryWidget::updateControlsGeometry() {
moveFieldControls();
const auto pinnedBarTop = _topBar->bottomNoMargins();
if (_pinnedBar) {
_pinnedBar->move(0, pinnedBarTop);
_pinnedBar->resizeToWidth(width());
}
const auto groupCallTop = pinnedBarTop + (_pinnedBar ? _pinnedBar->height() : 0);
const auto groupCallTop = _topBar->bottomNoMargins();
if (_groupCallBar) {
_groupCallBar->move(0, groupCallTop);
_groupCallBar->resizeToWidth(width());
}
const auto contactStatusTop = groupCallTop + (_groupCallBar ? _groupCallBar->height() : 0);
const auto pinnedBarTop = groupCallTop + (_groupCallBar ? _groupCallBar->height() : 0);
if (_pinnedBar) {
_pinnedBar->move(0, pinnedBarTop);
_pinnedBar->resizeToWidth(width());
}
const auto contactStatusTop = pinnedBarTop + (_pinnedBar ? _pinnedBar->height() : 0);
if (_contactStatus) {
_contactStatus->move(0, contactStatusTop);
}

View File

@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "styles/style_chat.h"
#include "styles/style_calls.h"
#include "styles/style_info.h" // st::topBarArrowPadding, like TopBarWidget.
#include "styles/palette.h"
#include <QtGui/QtEvents>
@ -116,17 +117,7 @@ void GroupCallBar::setupInner() {
void GroupCallBar::paint(Painter &p) {
p.fillRect(_inner->rect(), st::historyComposeAreaBg);
auto left = st::msgReplyBarSkip;
if (!_content.userpics.isNull()) {
const auto imageSize = _content.userpics.size()
/ _content.userpics.devicePixelRatio();
// Skip shadow of the bar above.
const auto imageTop = (st::historyReplyHeight
- st::lineWidth
- imageSize.height()) / 2 + st::lineWidth;
p.drawImage(left, imageTop, _content.userpics);
left += imageSize.width() + st::msgReplyBarSkip;
}
const auto left = st::topBarArrowPadding.right();
const auto titleTop = st::msgReplyPadding.top();
const auto textTop = titleTop + st::msgServiceNameFont->height;
const auto width = _inner->width();
@ -142,6 +133,17 @@ void GroupCallBar::paint(Painter &p) {
(_content.count > 0
? tr::lng_group_call_members(tr::now, lt_count, _content.count)
: tr::lng_group_call_no_members(tr::now)));
if (!_content.userpics.isNull()) {
const auto imageSize = _content.userpics.size()
/ _content.userpics.devicePixelRatio();
// Skip shadow of the bar above.
const auto imageTop = (st::historyReplyHeight
- st::lineWidth
- imageSize.height()) / 2 + st::lineWidth;
const auto imageLeft = (_inner->width() - imageSize.width()) / 2;
p.drawImage(imageLeft, imageTop, _content.userpics);
}
}
void GroupCallBar::updateControlsGeometry(QRect wrapGeometry) {