|
|
|
@ -16,6 +16,7 @@ FriendWidget::FriendWidget(int FriendId, QString id)
@@ -16,6 +16,7 @@ FriendWidget::FriendWidget(int FriendId, QString id)
|
|
|
|
|
|
|
|
|
|
avatar.setPixmap(QPixmap("img/contact list icons/contact.png")); |
|
|
|
|
name.setText(id); |
|
|
|
|
//statusPic.setAlignment(Qt::AlignHCenter);
|
|
|
|
|
statusPic.setPixmap(QPixmap("img/status/dot_away.png")); |
|
|
|
|
QFont small; |
|
|
|
|
small.setPixelSize(10); |
|
|
|
@ -37,6 +38,9 @@ FriendWidget::FriendWidget(int FriendId, QString id)
@@ -37,6 +38,9 @@ FriendWidget::FriendWidget(int FriendId, QString id)
|
|
|
|
|
layout.addSpacing(5); |
|
|
|
|
layout.addWidget(&statusPic); |
|
|
|
|
layout.addSpacing(5); |
|
|
|
|
|
|
|
|
|
int isActiveWidget = 0; |
|
|
|
|
int isCursorOver = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FriendWidget::mouseReleaseEvent (QMouseEvent*) |
|
|
|
@ -62,8 +66,43 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
@@ -62,8 +66,43 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FriendWidget::mousePressEvent(QMouseEvent *event) |
|
|
|
|
{ |
|
|
|
|
if ((event->buttons() & Qt::LeftButton) == Qt::LeftButton) |
|
|
|
|
{ |
|
|
|
|
QPalette pal; |
|
|
|
|
pal.setColor(QPalette::Background, QColor(85,85,85,255)); |
|
|
|
|
this->setPalette(pal); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FriendWidget::enterEvent(QEvent*) |
|
|
|
|
{ |
|
|
|
|
isCursorOver = 1; |
|
|
|
|
if (isActiveWidget != 1) |
|
|
|
|
{ |
|
|
|
|
QPalette pal; |
|
|
|
|
pal.setColor(QPalette::Background, QColor(75,75,75,255)); |
|
|
|
|
lastColor = this->palette().background().color(); |
|
|
|
|
this->setPalette(pal); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FriendWidget::leaveEvent(QEvent*) |
|
|
|
|
{ |
|
|
|
|
if (isActiveWidget != 1) |
|
|
|
|
{ |
|
|
|
|
QPalette pal; |
|
|
|
|
pal.setColor(QPalette::Background, lastColor); |
|
|
|
|
this->setPalette(pal); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FriendWidget::setAsActiveChatroom() |
|
|
|
|
{ |
|
|
|
|
isActiveWidget = 1; |
|
|
|
|
|
|
|
|
|
QFont small; |
|
|
|
|
small.setPixelSize(10); |
|
|
|
|
statusMessage.setFont(small); |
|
|
|
@ -81,6 +120,8 @@ void FriendWidget::setAsActiveChatroom()
@@ -81,6 +120,8 @@ void FriendWidget::setAsActiveChatroom()
|
|
|
|
|
|
|
|
|
|
void FriendWidget::setAsInactiveChatroom() |
|
|
|
|
{ |
|
|
|
|
isActiveWidget = 0; |
|
|
|
|
|
|
|
|
|
QFont small; |
|
|
|
|
small.setPixelSize(10); |
|
|
|
|
statusMessage.setFont(small); |
|
|
|
|