From b49ba8b98f66bbcca200096a323174c9baf73ad4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 4 Oct 2013 12:13:09 +0000 Subject: [PATCH] Changed the additional buttons of ChatLobbyDialog and AudioPopupChatDialog to QToolButton. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6798 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- plugins/VOIP/gui/AudioPopupChatDialog.cpp | 22 +++++++++---------- plugins/VOIP/gui/AudioPopupChatDialog.h | 6 ++--- .../src/gui/chat/ChatLobbyDialog.cpp | 6 +++-- retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 6 +++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/plugins/VOIP/gui/AudioPopupChatDialog.cpp b/plugins/VOIP/gui/AudioPopupChatDialog.cpp index f78119a51..afa150ef2 100644 --- a/plugins/VOIP/gui/AudioPopupChatDialog.cpp +++ b/plugins/VOIP/gui/AudioPopupChatDialog.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include "AudioPopupChatDialog.h" @@ -11,7 +11,7 @@ AudioPopupChatDialog::AudioPopupChatDialog(QWidget *parent) : PopupChatDialog(parent) { - audioListenToggleButton = new QPushButton ; + audioListenToggleButton = new QToolButton ; audioListenToggleButton->setMinimumSize(QSize(28,28)) ; audioListenToggleButton->setMaximumSize(QSize(28,28)) ; audioListenToggleButton->setText(QString()) ; @@ -20,34 +20,34 @@ AudioPopupChatDialog::AudioPopupChatDialog(QWidget *parent) std::cerr << "****** VOIPLugin: Creating new AudioPopupChatDialog !!" << std::endl; QIcon icon ; - icon.addPixmap(QPixmap(":/images/deafened_self.svg")) ; + icon.addPixmap(QPixmap(":/images/deafened_self.svg")) ; icon.addPixmap(QPixmap(":/images/self_undeafened.svg"),QIcon::Normal,QIcon::On) ; icon.addPixmap(QPixmap(":/images/self_undeafened.svg"),QIcon::Disabled,QIcon::On) ; icon.addPixmap(QPixmap(":/images/self_undeafened.svg"),QIcon::Active,QIcon::On) ; - icon.addPixmap(QPixmap(":/images/self_undeafened.svg"),QIcon::Selected,QIcon::On) ; + icon.addPixmap(QPixmap(":/images/self_undeafened.svg"),QIcon::Selected,QIcon::On) ; audioListenToggleButton->setIcon(icon) ; audioListenToggleButton->setIconSize(QSize(22,22)) ; - audioListenToggleButton->setFlat(true) ; - audioListenToggleButton->setCheckable(true); + audioListenToggleButton->setAutoRaise(true) ; + audioListenToggleButton->setCheckable(true); - audioMuteCaptureToggleButton = new QPushButton ; + audioMuteCaptureToggleButton = new QToolButton ; audioMuteCaptureToggleButton->setMinimumSize(QSize(28,28)) ; audioMuteCaptureToggleButton->setMaximumSize(QSize(28,28)) ; audioMuteCaptureToggleButton->setText(QString()) ; audioMuteCaptureToggleButton->setToolTip(tr("Start Call")); QIcon icon2 ; - icon2.addPixmap(QPixmap(":/images/call-start-22.png")) ; + icon2.addPixmap(QPixmap(":/images/call-start-22.png")) ; icon2.addPixmap(QPixmap(":/images/call-stop-22.png"),QIcon::Normal,QIcon::On) ; icon2.addPixmap(QPixmap(":/images/call-stop-22.png"),QIcon::Disabled,QIcon::On) ; icon2.addPixmap(QPixmap(":/images/call-stop-22.png"),QIcon::Active,QIcon::On) ; - icon2.addPixmap(QPixmap(":/images/call-stop-22.png"),QIcon::Selected,QIcon::On) ; + icon2.addPixmap(QPixmap(":/images/call-stop-22.png"),QIcon::Selected,QIcon::On) ; audioMuteCaptureToggleButton->setIcon(icon2) ; audioMuteCaptureToggleButton->setIconSize(QSize(22,22)) ; - audioMuteCaptureToggleButton->setFlat(true) ; - audioMuteCaptureToggleButton->setCheckable(true) ; + audioMuteCaptureToggleButton->setAutoRaise(true) ; + audioMuteCaptureToggleButton->setCheckable(true) ; connect(audioListenToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioListen())); connect(audioMuteCaptureToggleButton, SIGNAL(clicked()), this , SLOT(toggleAudioMuteCapture())); diff --git a/plugins/VOIP/gui/AudioPopupChatDialog.h b/plugins/VOIP/gui/AudioPopupChatDialog.h index 5410bf6c0..41859761f 100644 --- a/plugins/VOIP/gui/AudioPopupChatDialog.h +++ b/plugins/VOIP/gui/AudioPopupChatDialog.h @@ -4,7 +4,7 @@ #include #include -class QPushButton; +class QToolButton; #define VOIP_SOUND_INCOMING_CALL "VOIP_incoming_call" @@ -37,7 +37,7 @@ class AudioPopupChatDialog: public PopupChatDialog virtual void updateStatus(int status) ; - QPushButton *audioListenToggleButton ; - QPushButton *audioMuteCaptureToggleButton ; + QToolButton *audioListenToggleButton ; + QToolButton *audioMuteCaptureToggleButton ; }; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 8a872f455..db2b5f224 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -66,10 +66,11 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WF // Add a button to invite friends. // - inviteFriendsButton = new QPushButton ; + inviteFriendsButton = new QToolButton ; inviteFriendsButton->setMinimumSize(QSize(28,28)) ; inviteFriendsButton->setMaximumSize(QSize(28,28)) ; inviteFriendsButton->setText(QString()) ; + inviteFriendsButton->setAutoRaise(true) ; inviteFriendsButton->setToolTip(tr("Invite friends to this lobby")); { @@ -83,10 +84,11 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WF getChatWidget()->addChatBarWidget(inviteFriendsButton) ; - unsubscribeButton = new QPushButton ; + unsubscribeButton = new QToolButton ; unsubscribeButton->setMinimumSize(QSize(28,28)) ; unsubscribeButton->setMaximumSize(QSize(28,28)) ; unsubscribeButton->setText(QString()) ; + unsubscribeButton->setAutoRaise(true) ; unsubscribeButton->setToolTip(tr("Leave this lobby (Unsubscribe)")); { diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index d13bb941f..3ffa5e7e9 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -26,6 +26,8 @@ #include "ui_ChatLobbyDialog.h" #include "ChatDialog.h" +class QToolButton; + class ChatLobbyDialog: public ChatDialog { Q_OBJECT @@ -85,8 +87,8 @@ private: QString _lobby_name ; time_t lastUpdateListTime; - QPushButton *inviteFriendsButton ; - QPushButton *unsubscribeButton ; + QToolButton *inviteFriendsButton ; + QToolButton *unsubscribeButton ; /** Qt Designer generated object */ Ui::ChatLobbyDialog ui;