2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Some macOS improvements for animations and retina support.

This commit is contained in:
John Preston
2016-12-05 11:45:56 +03:00
parent 3e6d483939
commit a3c406dd00
14 changed files with 142 additions and 70 deletions

View File

@@ -251,7 +251,12 @@ bool History::paintSendAction(Painter &p, int x, int y, int availableWidth, int
availableWidth -= animationWidth;
p.setPen(color);
_sendActionText.drawElided(p, x, y, availableWidth);
updateSendActionAnimationAreas();
// App::histories().sendActionAnimationUpdated().notify({
// this,
// animationWidth,
// st::normalFont->height,
// false
// });
return true;
}
return false;
@@ -334,18 +339,16 @@ bool History::updateSendActionNeedsAnimating(TimeMs ms, bool force) {
}
auto result = (!_typing.isEmpty() || !_sendActions.isEmpty());
if (changed || result) {
updateSendActionAnimationAreas();
App::histories().sendActionAnimationUpdated().notify({
this,
_sendActionAnimation.width(),
st::normalFont->height,
changed
});
}
return result;
}
void History::updateSendActionAnimationAreas() {
updateChatListEntry();
if (App::main()->historyPeer() == peer) {
App::main()->topBar()->update();
}
}
ChannelHistory::ChannelHistory(const PeerId &peer) : History(peer)
, _joinedMessage(nullptr) {
}
@@ -2066,11 +2069,11 @@ void History::addChatListEntryByLetter(Dialogs::Mode list, QChar letter, Dialogs
}
void History::updateChatListEntry() const {
if (MainWidget *m = App::main()) {
if (auto main = App::main()) {
if (inChatList(Dialogs::Mode::All)) {
m->dlgUpdated(Dialogs::Mode::All, mainChatListLink(Dialogs::Mode::All));
main->dlgUpdated(Dialogs::Mode::All, mainChatListLink(Dialogs::Mode::All));
if (inChatList(Dialogs::Mode::Important)) {
m->dlgUpdated(Dialogs::Mode::Important, mainChatListLink(Dialogs::Mode::Important));
main->dlgUpdated(Dialogs::Mode::Important, mainChatListLink(Dialogs::Mode::Important));
}
}
}