Clean up Top Bar

This commit is contained in:
Konstantinos Sideris 2018-04-21 17:21:44 +03:00
parent 4a2f1af090
commit 74ff905582
2 changed files with 0 additions and 25 deletions

View File

@ -31,7 +31,6 @@ class FlatButton;
class Label;
class Menu;
class OverlayModal;
class RoomSettings;
class TopRoomBar : public QWidget
{
@ -47,7 +46,6 @@ public:
void updateRoomName(const QString &name);
void updateRoomTopic(QString topic);
void updateRoomAvatarFromName(const QString &name);
void setRoomSettings(QSharedPointer<RoomSettings> settings);
void reset();
@ -68,10 +66,7 @@ private:
QLabel *nameLabel_;
Label *topicLabel_;
QSharedPointer<RoomSettings> roomSettings_;
QMenu *menu_;
QAction *toggleNotifications_;
QAction *leaveRoom_;
QAction *inviteUsers_;

View File

@ -85,11 +85,6 @@ TopRoomBar::TopRoomBar(QWidget *parent)
menu_ = new Menu(this);
toggleNotifications_ = new QAction(tr("Disable notifications"), this);
connect(toggleNotifications_, &QAction::triggered, this, [this]() {
roomSettings_->toggleNotifications();
});
inviteUsers_ = new QAction(tr("Invite users"), this);
connect(inviteUsers_, &QAction::triggered, this, [this]() {
MainWindow::instance()->openInviteUsersDialog(
@ -101,19 +96,10 @@ TopRoomBar::TopRoomBar(QWidget *parent)
MainWindow::instance()->openLeaveRoomDialog();
});
menu_->addAction(toggleNotifications_);
menu_->addAction(inviteUsers_);
menu_->addAction(leaveRoom_);
connect(settingsBtn_, &QPushButton::clicked, this, [this]() {
if (roomSettings_.isNull())
return;
if (roomSettings_->isNotificationsEnabled())
toggleNotifications_->setText(tr("Disable notifications"));
else
toggleNotifications_->setText(tr("Enable notifications"));
auto pos = mapToGlobal(settingsBtn_->pos());
menu_->popup(
QPoint(pos.x() + buttonSize_ - menu_->sizeHint().width(), pos.y() + buttonSize_));
@ -182,12 +168,6 @@ TopRoomBar::mousePressEvent(QMouseEvent *event)
}
}
void
TopRoomBar::setRoomSettings(QSharedPointer<RoomSettings> settings)
{
roomSettings_ = settings;
}
void
TopRoomBar::updateRoomAvatar(const QImage &avatar_image)
{