Merge pull request #1941 from defnax/second-color-for-inactivity-status

Added second icon for inactivity status
This commit is contained in:
csoler 2020-05-17 22:01:32 +02:00 committed by GitHub
commit 39288a20d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -59,12 +59,14 @@
#define ROLE_SORT Qt::UserRole + 1 #define ROLE_SORT Qt::UserRole + 1
const static uint32_t timeToInactivity = 60 * 10; // in seconds const static uint32_t timeToInactivity = 60 * 10; // in seconds
const static uint32_t timeToInactivity2 = 60 * 5; // in seconds
/** Default constructor */ /** Default constructor */
ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags) ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags)
: ChatDialog(parent, flags), lobbyId(lid), mWindowedSetted(false), mPCWindow(nullptr), : ChatDialog(parent, flags), lobbyId(lid), mWindowedSetted(false), mPCWindow(nullptr),
bullet_red_128(":/icons/bullet_red_128.png"), bullet_grey_128(":/icons/bullet_grey_128.png"), bullet_red_128(":/icons/bullet_red_128.png"), bullet_grey_128(":/icons/bullet_grey_128.png"),
bullet_green_128(":/icons/bullet_green_128.png"), bullet_yellow_128(":/icons/bullet_yellow_128.png") bullet_green_128(":/icons/bullet_green_128.png"), bullet_yellow_128(":/icons/bullet_yellow_128.png"),
bullet_blue_128(":/icons/bullet_blue_128.png")
{ {
/* Invoke Qt Designer generated QObject setup routine */ /* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this); ui.setupUi(this);
@ -630,13 +632,15 @@ void ChatLobbyDialog::updateParticipantsList()
widgetitem->setIcon(COLUMN_ICON, bullet_red_128); widgetitem->setIcon(COLUMN_ICON, bullet_red_128);
else if (tLastAct + timeToInactivity < now) else if (tLastAct + timeToInactivity < now)
widgetitem->setIcon(COLUMN_ICON, bullet_grey_128); widgetitem->setIcon(COLUMN_ICON, bullet_grey_128);
else if (tLastAct + timeToInactivity2 < now)
widgetitem->setIcon(COLUMN_ICON, bullet_yellow_128);
else else
widgetitem->setIcon(COLUMN_ICON, bullet_green_128); widgetitem->setIcon(COLUMN_ICON, bullet_green_128);
RsGxsId gxs_id; RsGxsId gxs_id;
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id); rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, bullet_yellow_128); if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, bullet_blue_128);
widgetitem->updateBannedState(); widgetitem->updateBannedState();

View File

@ -134,7 +134,7 @@ private:
GxsIdChooser *ownIdChooser ; GxsIdChooser *ownIdChooser ;
//icons cache //icons cache
QIcon bullet_red_128, bullet_grey_128, bullet_green_128, bullet_yellow_128; QIcon bullet_red_128, bullet_grey_128, bullet_green_128, bullet_yellow_128, bullet_blue_128;
}; };
#endif #endif

View File

@ -57,7 +57,7 @@
#define IMAGE_MESSAGEREMOVE ":/icons/mail/delete.png" #define IMAGE_MESSAGEREMOVE ":/icons/mail/delete.png"
#define IMAGE_STAR_ON ":/images/star-on-16.png" #define IMAGE_STAR_ON ":/images/star-on-16.png"
#define IMAGE_STAR_OFF ":/images/star-off-16.png" #define IMAGE_STAR_OFF ":/images/star-off-16.png"
#define IMAGE_SYSTEM ":/images/user/user_request16.png" #define IMAGE_SYSTEM ":/icons/notification.png"
#define IMAGE_DECRYPTMESSAGE ":/images/decrypt-mail.png" #define IMAGE_DECRYPTMESSAGE ":/images/decrypt-mail.png"
#define IMAGE_AUTHOR_INFO ":/images/info16.png" #define IMAGE_AUTHOR_INFO ":/images/info16.png"
#define IMAGE_NOTFICATION ":/icons/notification.png" #define IMAGE_NOTFICATION ":/icons/notification.png"