2018-04-30 21:41:47 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QImage>
|
|
|
|
|
|
|
|
#include "Cache.h"
|
|
|
|
|
|
|
|
class FlatButton;
|
|
|
|
class TextField;
|
|
|
|
class Avatar;
|
|
|
|
class QPixmap;
|
|
|
|
class QLayout;
|
|
|
|
class QLabel;
|
2018-05-13 01:31:58 +03:00
|
|
|
class QComboBox;
|
2018-04-30 21:41:47 +03:00
|
|
|
|
|
|
|
template<class T>
|
|
|
|
class QSharedPointer;
|
|
|
|
|
|
|
|
class TopSection : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
|
|
|
|
|
|
|
public:
|
2018-05-11 16:00:14 +03:00
|
|
|
TopSection(const RoomInfo &info, const QImage &img, QWidget *parent = nullptr);
|
|
|
|
QSize sizeHint() const override;
|
2018-04-30 21:41:47 +03:00
|
|
|
|
|
|
|
QColor textColor() const { return textColor_; }
|
|
|
|
void setTextColor(QColor &color) { textColor_ = color; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
static constexpr int AvatarSize = 72;
|
|
|
|
static constexpr int Padding = 5;
|
|
|
|
|
|
|
|
RoomInfo info_;
|
|
|
|
QPixmap avatar_;
|
|
|
|
QColor textColor_;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace dialogs {
|
|
|
|
|
|
|
|
class RoomSettings : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-05-08 20:30:09 +03:00
|
|
|
RoomSettings(const QString &room_id, QWidget *parent = nullptr);
|
2018-04-30 21:41:47 +03:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void closing();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
|
2018-05-13 01:31:58 +03:00
|
|
|
private slots:
|
|
|
|
void save_and_close();
|
|
|
|
|
2018-04-30 21:41:47 +03:00
|
|
|
private:
|
|
|
|
static constexpr int AvatarSize = 64;
|
|
|
|
|
|
|
|
void setAvatar(const QImage &img) { avatarImg_ = img; }
|
|
|
|
|
|
|
|
// Button section
|
|
|
|
FlatButton *saveBtn_;
|
|
|
|
FlatButton *cancelBtn_;
|
|
|
|
|
|
|
|
RoomInfo info_;
|
|
|
|
QString room_id_;
|
|
|
|
QImage avatarImg_;
|
2018-05-13 01:31:58 +03:00
|
|
|
|
|
|
|
QComboBox *accessCombo;
|
2018-04-30 21:41:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // dialogs
|