mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-11 08:48:14 +00:00
Closed beta 0.10.17.2: macOS animation improvements, multiselect design.
This commit is contained in:
parent
6d9173bca8
commit
a774e9b712
@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,10,17,0
|
||||
PRODUCTVERSION 0,10,17,0
|
||||
FILEVERSION 0,10,17,2
|
||||
PRODUCTVERSION 0,10,17,2
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -51,10 +51,10 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram Messenger LLP"
|
||||
VALUE "FileVersion", "0.10.17.0"
|
||||
VALUE "FileVersion", "0.10.17.2"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "0.10.17.0"
|
||||
VALUE "ProductVersion", "0.10.17.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,10,17,0
|
||||
PRODUCTVERSION 0,10,17,0
|
||||
FILEVERSION 0,10,17,2
|
||||
PRODUCTVERSION 0,10,17,2
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -43,10 +43,10 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Telegram Messenger LLP"
|
||||
VALUE "FileDescription", "Telegram Updater"
|
||||
VALUE "FileVersion", "0.10.17.0"
|
||||
VALUE "FileVersion", "0.10.17.2"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
|
||||
VALUE "ProductName", "Telegram Desktop"
|
||||
VALUE "ProductVersion", "0.10.17.0"
|
||||
VALUE "ProductVersion", "0.10.17.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@ -106,11 +106,11 @@ contactsMultiSelect: MultiSelect {
|
||||
font: normalFont;
|
||||
textBg: contactsBgOver;
|
||||
textFg: windowTextFg;
|
||||
textActiveBg: titleBg;
|
||||
textActiveBg: windowActiveBg;
|
||||
textActiveFg: white;
|
||||
deleteFg: white;
|
||||
deleteLeft: 9px;
|
||||
deleteStroke: 3px;
|
||||
deleteLeft: 10px;
|
||||
deleteStroke: 2px;
|
||||
duration: 150;
|
||||
minScale: 0.3;
|
||||
}
|
||||
|
@ -353,21 +353,9 @@ void ContactsBox::onFilterUpdate(const QString &filter) {
|
||||
}
|
||||
|
||||
void ContactsBox::addPeerToMultiSelect(PeerData *peer, bool skipAnimation) {
|
||||
auto getColor = [peer]() -> const style::color & {
|
||||
switch (peer->colorIndex) {
|
||||
case 1: return st::historyPeer2UserpicFg;
|
||||
case 2: return st::historyPeer3UserpicFg;
|
||||
case 3: return st::historyPeer4UserpicFg;
|
||||
case 4: return st::historyPeer5UserpicFg;
|
||||
case 5: return st::historyPeer6UserpicFg;
|
||||
case 6: return st::historyPeer7UserpicFg;
|
||||
case 7: return st::historyPeer8UserpicFg;
|
||||
default: return st::historyPeer1UserpicFg;
|
||||
}
|
||||
};
|
||||
using AddItemWay = Ui::MultiSelect::AddItemWay;
|
||||
auto addItemWay = skipAnimation ? AddItemWay::SkipAnimation : AddItemWay::Default;
|
||||
_select->entity()->addItem(peer->id, peer->shortName(), getColor(), PaintUserpicCallback(peer), addItemWay);
|
||||
_select->entity()->addItem(peer->id, peer->shortName(), st::windowActiveBg, PaintUserpicCallback(peer), addItemWay);
|
||||
}
|
||||
|
||||
void ContactsBox::onPeerSelectedChanged(PeerData *peer, bool checked) {
|
||||
@ -941,7 +929,7 @@ ContactsBox::Inner::ContactData *ContactsBox::Inner::contactData(Dialogs::Row *r
|
||||
return data;
|
||||
}
|
||||
|
||||
void ContactsBox::Inner::paintDialog(Painter &p, PeerData *peer, ContactData *data, bool sel) {
|
||||
void ContactsBox::Inner::paintDialog(Painter &p, uint64 ms, PeerData *peer, ContactData *data, bool sel) {
|
||||
UserData *user = peer->asUser();
|
||||
|
||||
if (_chat && _membersFilter == MembersFilter::Admins) {
|
||||
@ -967,7 +955,7 @@ void ContactsBox::Inner::paintDialog(Painter &p, PeerData *peer, ContactData *da
|
||||
paintDisabledCheckUserpic(p, peer, st::contactsPadding.left(), st::contactsPadding.top(), width());
|
||||
} else if (usingMultiSelect()) {
|
||||
checkedRatio = data->checkbox->checkedAnimationRatio();
|
||||
data->checkbox->paint(p, st::contactsPadding.left(), st::contactsPadding.top(), width());
|
||||
data->checkbox->paint(p, ms, st::contactsPadding.left(), st::contactsPadding.top(), width());
|
||||
} else {
|
||||
peer->paintUserpicLeft(p, st::contactsPhotoSize, st::contactsPadding.left(), st::contactsPadding.top(), width());
|
||||
}
|
||||
@ -1060,6 +1048,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
_time = unixtime();
|
||||
p.fillRect(r, st::white);
|
||||
|
||||
uint64 ms = getms();
|
||||
int32 yFrom = r.y(), yTo = r.y() + r.height();
|
||||
if (_filter.isEmpty()) {
|
||||
if (!_contacts->isEmpty() || !_byUsername.isEmpty()) {
|
||||
@ -1089,7 +1078,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
if ((*i)->pos() * _rowHeight >= yTo) {
|
||||
break;
|
||||
}
|
||||
paintDialog(p, (*i)->history()->peer, contactData(*i), (*i == _sel));
|
||||
paintDialog(p, ms, (*i)->history()->peer, contactData(*i), (*i == _sel));
|
||||
p.translate(0, _rowHeight);
|
||||
}
|
||||
yFrom -= _contacts->size() * _rowHeight;
|
||||
@ -1109,7 +1098,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
int32 to = ceilclamp(yTo, _rowHeight, 0, _byUsername.size());
|
||||
p.translate(0, from * _rowHeight);
|
||||
for (; from < to; ++from) {
|
||||
paintDialog(p, _byUsername[from], d_byUsername[from], (_byUsernameSel == from));
|
||||
paintDialog(p, ms, _byUsername[from], d_byUsername[from], (_byUsernameSel == from));
|
||||
p.translate(0, _rowHeight);
|
||||
}
|
||||
}
|
||||
@ -1156,7 +1145,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
int32 to = ceilclamp(yTo, _rowHeight, 0, _filtered.size());
|
||||
p.translate(0, from * _rowHeight);
|
||||
for (; from < to; ++from) {
|
||||
paintDialog(p, _filtered[from]->history()->peer, contactData(_filtered[from]), (_filteredSel == from));
|
||||
paintDialog(p, ms, _filtered[from]->history()->peer, contactData(_filtered[from]), (_filteredSel == from));
|
||||
p.translate(0, _rowHeight);
|
||||
}
|
||||
}
|
||||
@ -1173,7 +1162,7 @@ void ContactsBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
int32 to = ceilclamp(yTo, _rowHeight, 0, _byUsernameFiltered.size());
|
||||
p.translate(0, from * _rowHeight);
|
||||
for (; from < to; ++from) {
|
||||
paintDialog(p, _byUsernameFiltered[from], d_byUsernameFiltered[from], (_byUsernameSel == from));
|
||||
paintDialog(p, ms, _byUsernameFiltered[from], d_byUsernameFiltered[from], (_byUsernameSel == from));
|
||||
p.translate(0, _rowHeight);
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ private:
|
||||
void addAdminDone(const MTPUpdates &result, mtpRequestId req);
|
||||
bool addAdminFail(const RPCError &error, mtpRequestId req);
|
||||
|
||||
void paintDialog(Painter &p, PeerData *peer, ContactData *data, bool sel);
|
||||
void paintDialog(Painter &p, uint64 ms, PeerData *peer, ContactData *data, bool sel);
|
||||
void paintDisabledCheckUserpic(Painter &p, PeerData *peer, int x, int y, int outerWidth) const;
|
||||
|
||||
void changeCheckState(Dialogs::Row *row);
|
||||
|
@ -234,21 +234,9 @@ void ShareBox::onFilterUpdate(const QString &query) {
|
||||
}
|
||||
|
||||
void ShareBox::addPeerToMultiSelect(PeerData *peer, bool skipAnimation) {
|
||||
auto getColor = [peer]() -> const style::color & {
|
||||
switch (peer->colorIndex) {
|
||||
case 1: return st::historyPeer2UserpicFg;
|
||||
case 2: return st::historyPeer3UserpicFg;
|
||||
case 3: return st::historyPeer4UserpicFg;
|
||||
case 4: return st::historyPeer5UserpicFg;
|
||||
case 5: return st::historyPeer6UserpicFg;
|
||||
case 6: return st::historyPeer7UserpicFg;
|
||||
case 7: return st::historyPeer8UserpicFg;
|
||||
default: return st::historyPeer1UserpicFg;
|
||||
}
|
||||
};
|
||||
using AddItemWay = Ui::MultiSelect::AddItemWay;
|
||||
auto addItemWay = skipAnimation ? AddItemWay::SkipAnimation : AddItemWay::Default;
|
||||
_select->addItem(peer->id, peer->shortName(), getColor(), PaintUserpicCallback(peer), addItemWay);
|
||||
_select->addItem(peer->id, peer->shortName(), st::windowActiveBg, PaintUserpicCallback(peer), addItemWay);
|
||||
}
|
||||
|
||||
void ShareBox::onPeerSelectedChanged(PeerData *peer, bool checked) {
|
||||
@ -511,14 +499,14 @@ void ShareBox::Inner::setActive(int active) {
|
||||
emit mustScrollTo(y, y + _rowHeight);
|
||||
}
|
||||
|
||||
void ShareBox::Inner::paintChat(Painter &p, Chat *chat, int index) {
|
||||
void ShareBox::Inner::paintChat(Painter &p, uint64 ms, Chat *chat, int index) {
|
||||
auto x = _rowsLeft + qFloor((index % _columnCount) * _rowWidthReal);
|
||||
auto y = _rowsTop + (index / _columnCount) * _rowHeight;
|
||||
|
||||
auto outerWidth = width();
|
||||
auto photoLeft = (_rowWidth - (st::sharePhotoCheckbox.imageRadius * 2)) / 2;
|
||||
auto photoTop = st::sharePhotoTop;
|
||||
chat->checkbox.paint(p, x + photoLeft, y + photoTop, outerWidth);
|
||||
chat->checkbox.paint(p, ms, x + photoLeft, y + photoTop, outerWidth);
|
||||
|
||||
if (chat->nameFg.animating()) {
|
||||
p.setPen(chat->nameFg.current());
|
||||
@ -541,6 +529,7 @@ ShareBox::Inner::Chat::Chat(PeerData *peer, base::lambda_wrap<void()> updateCall
|
||||
void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
auto ms = getms();
|
||||
auto r = e->rect();
|
||||
p.setClipRect(r);
|
||||
p.fillRect(r, st::white);
|
||||
@ -556,7 +545,7 @@ void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
if (indexFrom >= indexTo) {
|
||||
break;
|
||||
}
|
||||
paintChat(p, getChat(*i), indexFrom);
|
||||
paintChat(p, ms, getChat(*i), indexFrom);
|
||||
++indexFrom;
|
||||
}
|
||||
} else {
|
||||
@ -577,7 +566,7 @@ void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
if (indexFrom >= _filtered.size()) {
|
||||
break;
|
||||
}
|
||||
paintChat(p, getChat(_filtered[indexFrom]), indexFrom);
|
||||
paintChat(p, ms, getChat(_filtered[indexFrom]), indexFrom);
|
||||
++indexFrom;
|
||||
}
|
||||
indexFrom -= filteredSize;
|
||||
@ -589,7 +578,7 @@ void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||
if (indexFrom >= d_byUsernameFiltered.size()) {
|
||||
break;
|
||||
}
|
||||
paintChat(p, d_byUsernameFiltered[indexFrom], filteredSize + indexFrom);
|
||||
paintChat(p, ms, d_byUsernameFiltered[indexFrom], filteredSize + indexFrom);
|
||||
++indexFrom;
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ private:
|
||||
Text name;
|
||||
ColorAnimation nameFg;
|
||||
};
|
||||
void paintChat(Painter &p, Chat *chat, int index);
|
||||
void paintChat(Painter &p, uint64 ms, Chat *chat, int index);
|
||||
void updateChat(PeerData *peer);
|
||||
void updateChatName(Chat *chat, PeerData *peer);
|
||||
void repaintChat(PeerData *peer);
|
||||
|
@ -22,9 +22,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
||||
|
||||
#include "core/utils.h"
|
||||
|
||||
#define BETA_VERSION_MACRO (0ULL)
|
||||
#define BETA_VERSION_MACRO (10017002ULL)
|
||||
|
||||
constexpr int AppVersion = 10017;
|
||||
constexpr str_const AppVersionStr = "0.10.17";
|
||||
constexpr bool AppAlphaVersion = true;
|
||||
constexpr bool AppAlphaVersion = false;
|
||||
constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO;
|
||||
|
@ -484,6 +484,15 @@ public:
|
||||
using ValueType = typename AnimType::ValueType;
|
||||
using Callback = base::lambda_unique<void()>;
|
||||
|
||||
void step(uint64 ms) {
|
||||
if (_data) {
|
||||
_data->a_animation.step(ms);
|
||||
if (_data && !_data->a_animation.animating()) {
|
||||
_data.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool animating() const {
|
||||
if (_data) {
|
||||
if (_data->a_animation.animating()) {
|
||||
@ -494,11 +503,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
bool animating(uint64 ms) {
|
||||
if (animating()) {
|
||||
_data->a_animation.step(ms);
|
||||
return animating();
|
||||
}
|
||||
return false;
|
||||
step(ms);
|
||||
return animating();
|
||||
}
|
||||
|
||||
ValueType current() const {
|
||||
|
@ -65,7 +65,14 @@ RoundImageCheckbox::RoundImageCheckbox(const style::RoundImageCheckbox &st, base
|
||||
prepareCheckCaches(&_st, _wideCheckBgCache, _wideCheckFullCache);
|
||||
}
|
||||
|
||||
void RoundImageCheckbox::paint(Painter &p, int x, int y, int outerWidth) {
|
||||
void RoundImageCheckbox::paint(Painter &p, uint64 ms, int x, int y, int outerWidth) {
|
||||
_selection.step(ms);
|
||||
for (auto &icon : _icons) {
|
||||
icon.fadeIn.step(ms);
|
||||
icon.fadeOut.step(ms);
|
||||
}
|
||||
removeFadeOutedIcons();
|
||||
|
||||
auto selectionLevel = _selection.current(_checked ? 1. : 0.);
|
||||
if (_selection.animating()) {
|
||||
auto userpicRadius = qRound(kWideScale * (_st.imageRadius + (_st.imageSmallRadius - _st.imageRadius) * selectionLevel));
|
||||
@ -101,7 +108,6 @@ void RoundImageCheckbox::paint(Painter &p, int x, int y, int outerWidth) {
|
||||
p.setRenderHint(QPainter::HighQualityAntialiasing, false);
|
||||
}
|
||||
|
||||
removeFadeOutedIcons();
|
||||
p.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||
for (auto &icon : _icons) {
|
||||
auto fadeIn = icon.fadeIn.current(1.);
|
||||
@ -149,10 +155,7 @@ void RoundImageCheckbox::setChecked(bool checked, SetStyle speed) {
|
||||
_icons.back().fadeIn.finish();
|
||||
}
|
||||
} else {
|
||||
_icons.back().fadeOut.start([this] {
|
||||
_updateCallback();
|
||||
removeFadeOutedIcons(); // this call can destroy current lambda
|
||||
}, 1, 0, _st.selectDuration);
|
||||
_icons.back().fadeOut.start(_updateCallback, 1, 0, _st.selectDuration);
|
||||
if (speed == SetStyle::Animated) {
|
||||
prepareWideCheckIconCache(&_icons.back());
|
||||
} else {
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
using PaintRoundImage = base::lambda_unique<void(Painter &p, int x, int y, int outerWidth, int size)>;
|
||||
RoundImageCheckbox(const style::RoundImageCheckbox &st, base::lambda_wrap<void()> updateCallback, PaintRoundImage paintRoundImage);
|
||||
|
||||
void paint(Painter &p, int x, int y, int outerWidth);
|
||||
void paint(Painter &p, uint64 ms, int x, int y, int outerWidth);
|
||||
float64 checkedAnimationRatio() const;
|
||||
|
||||
bool checked() const {
|
||||
|
@ -1438,6 +1438,14 @@ void InputField::touchEvent(QTouchEvent *e) {
|
||||
void InputField::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
auto ms = getms();
|
||||
if (_a_placeholderShift.animating()) {
|
||||
_a_placeholderShift.step(ms);
|
||||
}
|
||||
if (_a_placeholderFg.animating()) {
|
||||
_a_placeholderFg.step(ms);
|
||||
}
|
||||
|
||||
QRect r(rect().intersected(e->rect()));
|
||||
if (_st.textBg->c.alphaF() > 0.) {
|
||||
p.fillRect(r, _st.textBg);
|
||||
|
@ -579,6 +579,10 @@ int MultiSelect::Inner::resizeGetHeight(int newWidth) {
|
||||
void MultiSelect::Inner::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
auto ms = getms();
|
||||
_height.step(ms);
|
||||
_iconOpacity.step(ms);
|
||||
|
||||
auto paintRect = e->rect();
|
||||
p.fillRect(paintRect, st::windowBg);
|
||||
|
||||
@ -586,9 +590,8 @@ void MultiSelect::Inner::paintEvent(QPaintEvent *e) {
|
||||
p.translate(offset);
|
||||
paintRect.translate(-offset);
|
||||
|
||||
auto ms = getms();
|
||||
auto outerWidth = width() - _st.padding.left() - _st.padding.right();
|
||||
auto iconOpacity = _iconOpacity.current(ms, _items.empty() ? 1. : 0.);
|
||||
auto iconOpacity = _iconOpacity.current(_items.empty() ? 1. : 0.);
|
||||
if (iconOpacity > 0.) {
|
||||
p.setOpacity(iconOpacity);
|
||||
_st.fieldIcon.paint(p, 0, 0, outerWidth);
|
||||
|
@ -2,5 +2,5 @@ AppVersion 10017
|
||||
AppVersionStrMajor 0.10
|
||||
AppVersionStrSmall 0.10.17
|
||||
AppVersionStr 0.10.17
|
||||
AlphaChannel 1
|
||||
BetaVersion 0
|
||||
AlphaChannel 0
|
||||
BetaVersion 10017002
|
||||
|
Loading…
Reference in New Issue
Block a user