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

Improve group call members list updating.

This commit is contained in:
John Preston
2020-11-27 17:50:41 +03:00
parent 8618fe41ee
commit a6b4cdd62d
11 changed files with 332 additions and 164 deletions

View File

@@ -426,9 +426,9 @@ bool PeerListRow::checked() const {
return _checkbox && _checkbox->checked();
}
void PeerListRow::setCustomStatus(const QString &status) {
void PeerListRow::setCustomStatus(const QString &status, bool active) {
setStatusText(status);
_statusType = StatusType::Custom;
_statusType = active ? StatusType::CustomActive : StatusType::Custom;
_statusValidTill = 0;
}
@@ -438,7 +438,10 @@ void PeerListRow::clearCustomStatus() {
}
void PeerListRow::refreshStatus() {
if (!_initialized || special() || _statusType == StatusType::Custom) {
if (!_initialized
|| special()
|| _statusType == StatusType::Custom
|| _statusType == StatusType::CustomActive) {
return;
}
_statusType = StatusType::LastSeen;
@@ -550,7 +553,8 @@ void PeerListRow::paintStatusText(
int availableWidth,
int outerWidth,
bool selected) {
auto statusHasOnlineColor = (_statusType == PeerListRow::StatusType::Online);
auto statusHasOnlineColor = (_statusType == PeerListRow::StatusType::Online)
|| (_statusType == PeerListRow::StatusType::CustomActive);
p.setFont(st::contactsStatusFont);
p.setPen(statusHasOnlineColor ? st.statusFgActive : (selected ? st.statusFgOver : st.statusFg));
_status.drawLeftElided(p, x, y, availableWidth, outerWidth);

View File

@@ -88,7 +88,7 @@ public:
[[nodiscard]] virtual auto generatePaintUserpicCallback()
-> PaintRoundImageCallback;
void setCustomStatus(const QString &status);
void setCustomStatus(const QString &status, bool active = false);
void clearCustomStatus();
// Box interface.
@@ -127,6 +127,7 @@ public:
Online,
LastSeen,
Custom,
CustomActive,
};
virtual void refreshStatus();
crl::time refreshStatusTime() const;