diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-30 20:02:46 +0200 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-11-30 20:02:46 +0200 |
commit | eae069ad93a6822e8cb96522708115793c01c5d7 (patch) | |
tree | e44b67a82110051f90ce8555a3520f62456be02b /include | |
parent | Create directories for related files (diff) | |
download | nheko-eae069ad93a6822e8cb96522708115793c01c5d7.tar.xz |
Group emoji and dialogs with namespaces
Diffstat (limited to 'include')
-rw-r--r-- | include/RoomList.h | 6 | ||||
-rw-r--r-- | include/TextInputWidget.h | 4 | ||||
-rw-r--r-- | include/TopRoomBar.h | 5 | ||||
-rw-r--r-- | include/UserInfoWidget.h | 5 | ||||
-rw-r--r-- | include/dialogs/ImageOverlay.h (renamed from include/dialogs/ImageOverlayDialog.h) | 7 | ||||
-rw-r--r-- | include/dialogs/JoinRoom.h (renamed from include/dialogs/JoinRoomDialog.h) | 8 | ||||
-rw-r--r-- | include/dialogs/LeaveRoom.h (renamed from include/dialogs/LeaveRoomDialog.h) | 7 | ||||
-rw-r--r-- | include/dialogs/Logout.h (renamed from include/dialogs/LogoutDialog.h) | 7 | ||||
-rw-r--r-- | include/emoji/Category.h (renamed from include/emoji/EmojiCategory.h) | 15 | ||||
-rw-r--r-- | include/emoji/ItemDelegate.h (renamed from include/emoji/EmojiItemDelegate.h) | 11 | ||||
-rw-r--r-- | include/emoji/Panel.h (renamed from include/emoji/EmojiPanel.h) | 15 | ||||
-rw-r--r-- | include/emoji/PickButton.h (renamed from include/emoji/EmojiPickButton.h) | 11 | ||||
-rw-r--r-- | include/emoji/Provider.h (renamed from include/emoji/EmojiProvider.h) | 5 |
13 files changed, 67 insertions, 39 deletions
diff --git a/include/RoomList.h b/include/RoomList.h index aa7c919c..f75f7ba4 100644 --- a/include/RoomList.h +++ b/include/RoomList.h @@ -24,7 +24,8 @@ #include <QVBoxLayout> #include <QWidget> -class JoinRoomDialog; +#include "dialogs/LeaveRoom.h" + class LeaveRoomDialog; class MatrixClient; class OverlayModal; @@ -82,10 +83,9 @@ private: QPushButton *joinRoomButton_; OverlayModal *joinRoomModal_; - JoinRoomDialog *joinRoomDialog_; QSharedPointer<OverlayModal> leaveRoomModal_; - QSharedPointer<LeaveRoomDialog> leaveRoomDialog_; + QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_; QMap<QString, QSharedPointer<RoomInfoListItem>> rooms_; diff --git a/include/TextInputWidget.h b/include/TextInputWidget.h index ede7b18a..3c338fe3 100644 --- a/include/TextInputWidget.h +++ b/include/TextInputWidget.h @@ -28,7 +28,7 @@ #include "Image.h" #include "LoadingIndicator.h" -#include "emoji/EmojiPickButton.h" +#include "emoji/PickButton.h" namespace msgs = matrix::events::messages; @@ -107,5 +107,5 @@ private: FlatButton *sendFileBtn_; FlatButton *sendMessageBtn_; - EmojiPickButton *emojiBtn_; + emoji::PickButton *emojiBtn_; }; diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index 2f65428d..7bd10356 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -26,10 +26,11 @@ #include <QSharedPointer> #include <QVBoxLayout> +#include "dialogs/LeaveRoom.h" + class Avatar; class FlatButton; class Label; -class LeaveRoomDialog; class Menu; class OverlayModal; class RoomSettings; @@ -79,7 +80,7 @@ private: FlatButton *settingsBtn_; QSharedPointer<OverlayModal> leaveRoomModal_; - QSharedPointer<LeaveRoomDialog> leaveRoomDialog_; + QSharedPointer<dialogs::LeaveRoom> leaveRoomDialog_; Avatar *avatar_; diff --git a/include/UserInfoWidget.h b/include/UserInfoWidget.h index 2acfedb8..3c20380f 100644 --- a/include/UserInfoWidget.h +++ b/include/UserInfoWidget.h @@ -20,9 +20,10 @@ #include <QLabel> #include <QLayout> +#include "dialogs/Logout.h" + class Avatar; class FlatButton; -class LogoutDialog; class OverlayModal; class UserInfoWidget : public QWidget @@ -68,7 +69,7 @@ private: QImage avatar_image_; QSharedPointer<OverlayModal> logoutModal_; - QSharedPointer<LogoutDialog> logoutDialog_; + QSharedPointer<dialogs::Logout> logoutDialog_; int logoutButtonSize_; }; diff --git a/include/dialogs/ImageOverlayDialog.h b/include/dialogs/ImageOverlay.h index 5159c665..682999ef 100644 --- a/include/dialogs/ImageOverlayDialog.h +++ b/include/dialogs/ImageOverlay.h @@ -21,11 +21,13 @@ #include <QMouseEvent> #include <QPixmap> -class ImageOverlayDialog : public QWidget +namespace dialogs { + +class ImageOverlay : public QWidget { Q_OBJECT public: - ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr); + ImageOverlay(QPixmap image, QWidget *parent = nullptr); protected: void mousePressEvent(QMouseEvent *event) override; @@ -44,3 +46,4 @@ private: QRect close_button_; QRect screen_; }; +} // dialogs diff --git a/include/dialogs/JoinRoomDialog.h b/include/dialogs/JoinRoom.h index 84184733..dbc06bdf 100644 --- a/include/dialogs/JoinRoomDialog.h +++ b/include/dialogs/JoinRoom.h @@ -5,11 +5,13 @@ class FlatButton; -class JoinRoomDialog : public QFrame +namespace dialogs { + +class JoinRoom : public QFrame { Q_OBJECT public: - JoinRoomDialog(QWidget *parent = nullptr); + JoinRoom(QWidget *parent = nullptr); signals: void closing(bool isJoining, QString roomAlias); @@ -20,3 +22,5 @@ private: QLineEdit *roomAliasEdit_; }; + +} // dialogs diff --git a/include/dialogs/LeaveRoomDialog.h b/include/dialogs/LeaveRoom.h index eab022f7..98e4938d 100644 --- a/include/dialogs/LeaveRoomDialog.h +++ b/include/dialogs/LeaveRoom.h @@ -4,11 +4,13 @@ class FlatButton; -class LeaveRoomDialog : public QFrame +namespace dialogs { + +class LeaveRoom : public QFrame { Q_OBJECT public: - explicit LeaveRoomDialog(QWidget *parent = nullptr); + explicit LeaveRoom(QWidget *parent = nullptr); protected: void paintEvent(QPaintEvent *event) override; @@ -20,3 +22,4 @@ private: FlatButton *confirmBtn_; FlatButton *cancelBtn_; }; +} // dialogs diff --git a/include/dialogs/LogoutDialog.h b/include/dialogs/Logout.h index a1a5ee4f..cfefb970 100644 --- a/include/dialogs/LogoutDialog.h +++ b/include/dialogs/Logout.h @@ -21,11 +21,13 @@ class FlatButton; -class LogoutDialog : public QFrame +namespace dialogs { + +class Logout : public QFrame { Q_OBJECT public: - explicit LogoutDialog(QWidget *parent = nullptr); + explicit Logout(QWidget *parent = nullptr); protected: void paintEvent(QPaintEvent *event) override; @@ -37,3 +39,4 @@ private: FlatButton *confirmBtn_; FlatButton *cancelBtn_; }; +} // dialogs diff --git a/include/emoji/EmojiCategory.h b/include/emoji/Category.h index be0110f2..0310a4f3 100644 --- a/include/emoji/EmojiCategory.h +++ b/include/emoji/Category.h @@ -22,17 +22,17 @@ #include <QListView> #include <QStandardItemModel> -#include "EmojiItemDelegate.h" +#include "ItemDelegate.h" -class EmojiProvider; +namespace emoji { -class EmojiCategory : public QWidget +class Category : public QWidget { Q_OBJECT public: - EmojiCategory(QString category, QList<Emoji> emoji, QWidget *parent = nullptr); - ~EmojiCategory(); + Category(QString category, QList<Emoji> emoji, QWidget *parent = nullptr); + ~Category(); signals: void emojiSelected(const QString &emoji); @@ -52,8 +52,9 @@ private: QStandardItemModel *itemModel_; QListView *emojiListView_; - Emoji *data_; - EmojiItemDelegate *delegate_; + emoji::Emoji *data_; + emoji::ItemDelegate *delegate_; QLabel *category_; }; +} // namespace emoji diff --git a/include/emoji/EmojiItemDelegate.h b/include/emoji/ItemDelegate.h index 15d61f49..e0456308 100644 --- a/include/emoji/EmojiItemDelegate.h +++ b/include/emoji/ItemDelegate.h @@ -21,15 +21,17 @@ #include <QStandardItemModel> #include <QStyledItemDelegate> -#include "EmojiProvider.h" +#include "Provider.h" -class EmojiItemDelegate : public QStyledItemDelegate +namespace emoji { + +class ItemDelegate : public QStyledItemDelegate { Q_OBJECT public: - explicit EmojiItemDelegate(QObject *parent = nullptr); - ~EmojiItemDelegate(); + explicit ItemDelegate(QObject *parent = nullptr); + ~ItemDelegate(); void paint(QPainter *painter, const QStyleOptionViewItem &option, @@ -38,3 +40,4 @@ public: private: Emoji *data_; }; +} // namespace emoji diff --git a/include/emoji/EmojiPanel.h b/include/emoji/Panel.h index 9eecc8e0..523a855e 100644 --- a/include/emoji/EmojiPanel.h +++ b/include/emoji/Panel.h @@ -19,16 +19,18 @@ #include <QScrollArea> -#include "EmojiProvider.h" +#include "Provider.h" -class EmojiCategory; +namespace emoji { -class EmojiPanel : public QWidget +class Category; + +class Panel : public QWidget { Q_OBJECT public: - EmojiPanel(QWidget *parent = nullptr); + Panel(QWidget *parent = nullptr); signals: void mouseLeft(); @@ -39,9 +41,9 @@ protected: void paintEvent(QPaintEvent *event); private: - void showEmojiCategory(const EmojiCategory *category); + void showCategory(const Category *category); - EmojiProvider emoji_provider_; + Provider emoji_provider_; QScrollArea *scrollArea_; @@ -53,3 +55,4 @@ private: int categoryIconSize_; }; +} // namespace emoji diff --git a/include/emoji/EmojiPickButton.h b/include/emoji/PickButton.h index 8ef9be9e..d0026828 100644 --- a/include/emoji/EmojiPickButton.h +++ b/include/emoji/PickButton.h @@ -22,13 +22,15 @@ #include "FlatButton.h" -class EmojiPanel; +namespace emoji { -class EmojiPickButton : public FlatButton +class Panel; + +class PickButton : public FlatButton { Q_OBJECT public: - explicit EmojiPickButton(QWidget *parent = nullptr); + explicit PickButton(QWidget *parent = nullptr); signals: void emojiSelected(const QString &emoji); @@ -44,5 +46,6 @@ private: // Horizontal distance from panel's bottom right corner. int horizontal_distance_ = 70; - QSharedPointer<EmojiPanel> panel_; + QSharedPointer<Panel> panel_; }; +} // namespace emoji diff --git a/include/emoji/EmojiProvider.h b/include/emoji/Provider.h index 847157fd..8754dabc 100644 --- a/include/emoji/EmojiProvider.h +++ b/include/emoji/Provider.h @@ -19,6 +19,8 @@ #include <QList> +namespace emoji { + struct Emoji { // Unicode code. @@ -27,7 +29,7 @@ struct Emoji QString shortname; }; -class EmojiProvider +class Provider { public: static const QList<Emoji> people; @@ -39,3 +41,4 @@ public: static const QList<Emoji> symbols; static const QList<Emoji> flags; }; +} // namespace emoji |