diff --git a/.clang-format b/.clang-format index d5606cd..42d7b6f 100644 --- a/.clang-format +++ b/.clang-format @@ -5,7 +5,6 @@ AlignAfterOpenBracket: Align AlignConsecutiveAssignments: true AllowShortFunctionsOnASingleLine: Empty BasedOnStyle: Mozilla -BreakBeforeBraces: Linux ColumnLimit: 100 IndentCaseLabels: false IndentWidth: 8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6415b91..22673e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,7 @@ set(SRC_FILES src/RoomList.cc src/RoomMessages.cc src/RoomState.cc + src/SideBarActions.cc src/Splitter.cc src/Sync.cc src/TextInputWidget.cc @@ -233,6 +234,7 @@ qt5_wrap_cpp(MOC_HEADERS include/RegisterPage.h include/RoomInfoListItem.h include/RoomList.h + include/SideBarActions.h include/Splitter.h include/TextInputWidget.h include/TimelineItem.h diff --git a/README.md b/README.md index 83ebad7..26356ef 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,7 @@ Here is a screen shot to get a feel for the UI, but things will probably change. ### Third party - [Emoji One](http://emojione.com) +- [Font Awesome](http://fontawesome.io/) - [Open Sans](https://fonts.google.com/specimen/Open+Sans) [Matrix]:https://matrix.org diff --git a/include/ChatPage.h b/include/ChatPage.h index 04464bc..be8fc12 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -27,6 +27,7 @@ #include "RoomList.h" #include "RoomSettings.h" #include "RoomState.h" +#include "SideBarActions.h" #include "Splitter.h" #include "TextInputWidget.h" #include "TimelineViewManager.h" @@ -96,6 +97,7 @@ private: RoomList *room_list_; TimelineViewManager *view_manager_; + SideBarActions *sidebarActions_; TopRoomBar *top_bar_; TextInputWidget *text_input_; diff --git a/include/Config.h b/include/Config.h index 2412a4d..b5e876c 100644 --- a/include/Config.h +++ b/include/Config.h @@ -4,72 +4,70 @@ // // Font sizes are in pixels. -namespace conf -{ +namespace conf { // Global settings. -static const int fontSize = 12; -static const int textInputFontSize = 14; -static const int emojiSize = 14; -static const int headerFontSize = 21; -static const int typingNotificationFontSize = 11; +static constexpr int fontSize = 12; +static constexpr int textInputFontSize = 14; +static constexpr int emojiSize = 14; +static constexpr int headerFontSize = 21; +static constexpr int typingNotificationFontSize = 11; // Window geometry. -namespace window -{ -static const int height = 600; -static const int width = 1066; +namespace window { +static constexpr int height = 600; +static constexpr int width = 1066; -static const int minHeight = 600; -static const int minWidth = 950; +static constexpr int minHeight = height; +static constexpr int minWidth = 950; +} // namespace window + +namespace textInput { +static constexpr int height = 50; } -// Button settings. -namespace btn -{ -static const int fontSize = 20; -static const int cornerRadius = 3; +namespace sidebarActions { +static constexpr int height = textInput::height; +static constexpr int iconSize = 28; } +// Button settings. +namespace btn { +static constexpr int fontSize = 20; +static constexpr int cornerRadius = 3; +} // namespace btn + // RoomList specific. -namespace roomlist -{ -namespace fonts -{ -static const int heading = 13; -static const int badge = 10; -static const int bubble = 20; +namespace roomlist { +namespace fonts { +static constexpr int heading = 13; +static constexpr int badge = 10; +static constexpr int bubble = 20; } // namespace fonts } // namespace roomlist -namespace userInfoWidget -{ -namespace fonts -{ -static const int displayName = 16; -static const int userid = 14; +namespace userInfoWidget { +namespace fonts { +static constexpr int displayName = 16; +static constexpr int userid = 14; } // namespace fonts } // namespace userInfoWidget -namespace topRoomBar -{ -namespace fonts -{ -static const int roomName = 15; -static const int roomDescription = 13; +namespace topRoomBar { +namespace fonts { +static constexpr int roomName = 15; +static constexpr int roomDescription = 13; } // namespace fonts } // namespace topRoomBar -namespace timeline -{ -static const int msgMargin = 11; -static const int avatarSize = 36; -static const int headerSpacing = 5; -static const int headerLeftMargin = 15; +namespace timeline { +static constexpr int msgMargin = 11; +static constexpr int avatarSize = 36; +static constexpr int headerSpacing = 5; +static constexpr int headerLeftMargin = 15; -namespace fonts -{ -static const int timestamp = 9; -} -} +namespace fonts { +static constexpr int timestamp = 9; +} // namespace fonts +} // namespace timeline } // namespace conf diff --git a/include/EmojiProvider.h b/include/EmojiProvider.h index 5b6f7c8..3f91f2b 100644 --- a/include/EmojiProvider.h +++ b/include/EmojiProvider.h @@ -21,7 +21,8 @@ #include #include -struct Emoji { +struct Emoji +{ // Unicode code. QString unicode; // Keyboard shortcut e.g :emoji: diff --git a/include/MatrixClient.h b/include/MatrixClient.h index 927fe3a..01e2c31 100644 --- a/include/MatrixClient.h +++ b/include/MatrixClient.h @@ -104,7 +104,8 @@ private slots: void onResponse(QNetworkReply *reply); private: - enum class Endpoint { + enum class Endpoint + { GetOwnAvatar, GetOwnProfile, GetProfile, diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 0302303..d7009a8 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -26,7 +26,8 @@ #include "RoomSettings.h" #include "RoomState.h" -struct DescInfo { +struct DescInfo +{ QString username; QString userid; QString body; diff --git a/include/SideBarActions.h b/include/SideBarActions.h new file mode 100644 index 0000000..60975a0 --- /dev/null +++ b/include/SideBarActions.h @@ -0,0 +1,23 @@ +#include +#include + +#include + +class SideBarActions : public QWidget +{ + Q_OBJECT + +public: + SideBarActions(QWidget *parent = nullptr); + ~SideBarActions(); + +protected: + void resizeEvent(QResizeEvent *event) override; + +private: + QHBoxLayout *layout_; + + FlatButton *settingsBtn_; + FlatButton *createRoomBtn_; + FlatButton *joinRoomBtn_; +}; diff --git a/include/TimelineView.h b/include/TimelineView.h index da73b00..6ca9121 100644 --- a/include/TimelineView.h +++ b/include/TimelineView.h @@ -39,7 +39,8 @@ namespace events = matrix::events; // Contains info about a message shown in the history view // but not yet confirmed by the homeserver through sync. -struct PendingMessage { +struct PendingMessage +{ int txn_id; QString body; QString event_id; @@ -50,12 +51,12 @@ struct PendingMessage { , body(body) , event_id(event_id) , widget(widget) - { - } + {} }; // In which place new TimelineItems should be inserted. -enum class TimelineDirection { +enum class TimelineDirection +{ Top, Bottom, }; diff --git a/include/Versions.h b/include/Versions.h index 62584eb..31d8af8 100644 --- a/include/Versions.h +++ b/include/Versions.h @@ -30,7 +30,8 @@ public: bool isVersionSupported(unsigned int major, unsigned int minor, unsigned int patch); private: - struct Version_ { + struct Version_ + { unsigned int major_; unsigned int minor_; unsigned int patch_; diff --git a/include/events/AliasesEventContent.h b/include/events/AliasesEventContent.h index a60da9e..49e5127 100644 --- a/include/events/AliasesEventContent.h +++ b/include/events/AliasesEventContent.h @@ -22,10 +22,8 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { class AliasesEventContent : public Deserializable , public Serializable diff --git a/include/events/AvatarEventContent.h b/include/events/AvatarEventContent.h index d46f042..98e2f12 100644 --- a/include/events/AvatarEventContent.h +++ b/include/events/AvatarEventContent.h @@ -22,10 +22,8 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { /* * A picture that is associated with the room. */ diff --git a/include/events/CanonicalAliasEventContent.h b/include/events/CanonicalAliasEventContent.h index 210e4a3..9c961d4 100644 --- a/include/events/CanonicalAliasEventContent.h +++ b/include/events/CanonicalAliasEventContent.h @@ -22,10 +22,8 @@ #include "CanonicalAliasEventContent.h" #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { /* * This event is used to inform the room about which alias should be considered * the canonical one. This could be for display purposes or as suggestion to diff --git a/include/events/CreateEventContent.h b/include/events/CreateEventContent.h index 7db2d36..8edc4d2 100644 --- a/include/events/CreateEventContent.h +++ b/include/events/CreateEventContent.h @@ -21,10 +21,8 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { /* * This is the first event in a room and cannot be changed. It acts as the root * of all other events. diff --git a/include/events/Event.h b/include/events/Event.h index c6d2da2..43ab4cc 100644 --- a/include/events/Event.h +++ b/include/events/Event.h @@ -22,11 +22,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class EventType { -namespace events -{ -enum class EventType { /// m.room.aliases RoomAliases, /// m.room.avatar diff --git a/include/events/HistoryVisibilityEventContent.h b/include/events/HistoryVisibilityEventContent.h index 5340508..94563d5 100644 --- a/include/events/HistoryVisibilityEventContent.h +++ b/include/events/HistoryVisibilityEventContent.h @@ -21,11 +21,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class HistoryVisibility { -namespace events -{ -enum class HistoryVisibility { Invited, Joined, Shared, diff --git a/include/events/JoinRulesEventContent.h b/include/events/JoinRulesEventContent.h index 738be9d..b9b6848 100644 --- a/include/events/JoinRulesEventContent.h +++ b/include/events/JoinRulesEventContent.h @@ -21,11 +21,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class JoinRule { -namespace events -{ -enum class JoinRule { // A user who wishes to join the room must first receive // an invite to the room from someone already inside of the room. Invite, diff --git a/include/events/MemberEventContent.h b/include/events/MemberEventContent.h index 5af1921..1dd703a 100644 --- a/include/events/MemberEventContent.h +++ b/include/events/MemberEventContent.h @@ -22,11 +22,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class Membership { -namespace events -{ -enum class Membership { // The user is banned. Ban, diff --git a/include/events/MessageEvent.h b/include/events/MessageEvent.h index 1b105d6..7e7493e 100644 --- a/include/events/MessageEvent.h +++ b/include/events/MessageEvent.h @@ -20,10 +20,8 @@ #include "MessageEventContent.h" #include "RoomEvent.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { template class MessageEvent : public RoomEvent { @@ -52,9 +50,9 @@ MessageEvent::deserialize(const QJsonValue &data) msg_content_.deserialize(data.toObject().value("content").toObject()); } -namespace messages +namespace messages { +struct ThumbnailInfo { -struct ThumbnailInfo { int h; int w; int size; diff --git a/include/events/MessageEventContent.h b/include/events/MessageEventContent.h index 90f6cfa..c096f15 100644 --- a/include/events/MessageEventContent.h +++ b/include/events/MessageEventContent.h @@ -21,11 +21,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class MessageEventType { -namespace events -{ -enum class MessageEventType { // m.audio Audio, diff --git a/include/events/NameEventContent.h b/include/events/NameEventContent.h index d2cf86d..413c28c 100644 --- a/include/events/NameEventContent.h +++ b/include/events/NameEventContent.h @@ -21,10 +21,8 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { /* * A human-friendly room name designed to be displayed to the end-user. */ diff --git a/include/events/PowerLevelsEventContent.h b/include/events/PowerLevelsEventContent.h index 7cfeadf..04afa47 100644 --- a/include/events/PowerLevelsEventContent.h +++ b/include/events/PowerLevelsEventContent.h @@ -22,11 +22,10 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +enum class PowerLevels { -namespace events -{ -enum class PowerLevels { User = 0, Moderator = 50, Admin = 100, diff --git a/include/events/RoomEvent.h b/include/events/RoomEvent.h index 540fafa..a1e8880 100644 --- a/include/events/RoomEvent.h +++ b/include/events/RoomEvent.h @@ -22,10 +22,8 @@ #include "Event.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { template class RoomEvent : public Event { diff --git a/include/events/StateEvent.h b/include/events/StateEvent.h index 75bf1bb..146e96b 100644 --- a/include/events/StateEvent.h +++ b/include/events/StateEvent.h @@ -21,10 +21,8 @@ #include "RoomEvent.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { template class StateEvent : public RoomEvent { diff --git a/include/events/TopicEventContent.h b/include/events/TopicEventContent.h index b6c376e..d059e48 100644 --- a/include/events/TopicEventContent.h +++ b/include/events/TopicEventContent.h @@ -21,10 +21,8 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ +namespace matrix { +namespace events { /* * A topic is a short message detailing what is currently being discussed in the * room. diff --git a/include/events/messages/Audio.h b/include/events/messages/Audio.h index 41bc249..8abdf7f 100644 --- a/include/events/messages/Audio.h +++ b/include/events/messages/Audio.h @@ -21,13 +21,11 @@ #include "Deserializable.h" -namespace matrix +namespace matrix { +namespace events { +namespace messages { +struct AudioInfo { -namespace events -{ -namespace messages -{ -struct AudioInfo { uint64_t duration; int size; diff --git a/include/events/messages/Emote.h b/include/events/messages/Emote.h index 98d049e..a11b7c8 100644 --- a/include/events/messages/Emote.h +++ b/include/events/messages/Emote.h @@ -21,12 +21,9 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ -namespace messages -{ +namespace matrix { +namespace events { +namespace messages { class Emote : public Deserializable { public: diff --git a/include/events/messages/File.h b/include/events/messages/File.h index a4e8b6a..ff5eb0a 100644 --- a/include/events/messages/File.h +++ b/include/events/messages/File.h @@ -22,13 +22,11 @@ #include "Deserializable.h" #include "MessageEvent.h" -namespace matrix +namespace matrix { +namespace events { +namespace messages { +struct FileInfo { -namespace events -{ -namespace messages -{ -struct FileInfo { int size; QString mimetype; diff --git a/include/events/messages/Image.h b/include/events/messages/Image.h index 93a598e..14889ff 100644 --- a/include/events/messages/Image.h +++ b/include/events/messages/Image.h @@ -22,13 +22,11 @@ #include "Deserializable.h" #include "MessageEvent.h" -namespace matrix +namespace matrix { +namespace events { +namespace messages { +struct ImageInfo { -namespace events -{ -namespace messages -{ -struct ImageInfo { int h; int w; int size; diff --git a/include/events/messages/Location.h b/include/events/messages/Location.h index 4b52387..e51c679 100644 --- a/include/events/messages/Location.h +++ b/include/events/messages/Location.h @@ -22,13 +22,11 @@ #include "Deserializable.h" #include "MessageEvent.h" -namespace matrix +namespace matrix { +namespace events { +namespace messages { +struct LocationInfo { -namespace events -{ -namespace messages -{ -struct LocationInfo { QString thumbnail_url; ThumbnailInfo thumbnail_info; }; diff --git a/include/events/messages/Notice.h b/include/events/messages/Notice.h index b303dd7..66f4386 100644 --- a/include/events/messages/Notice.h +++ b/include/events/messages/Notice.h @@ -21,12 +21,9 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ -namespace messages -{ +namespace matrix { +namespace events { +namespace messages { class Notice : public Deserializable { public: diff --git a/include/events/messages/Text.h b/include/events/messages/Text.h index 2c787d0..c3182dc 100644 --- a/include/events/messages/Text.h +++ b/include/events/messages/Text.h @@ -21,12 +21,9 @@ #include "Deserializable.h" -namespace matrix -{ -namespace events -{ -namespace messages -{ +namespace matrix { +namespace events { +namespace messages { class Text : public Deserializable { public: diff --git a/include/events/messages/Video.h b/include/events/messages/Video.h index 37056c2..d167b8c 100644 --- a/include/events/messages/Video.h +++ b/include/events/messages/Video.h @@ -22,13 +22,11 @@ #include "Deserializable.h" #include "MessageEvent.h" -namespace matrix +namespace matrix { +namespace events { +namespace messages { +struct VideoInfo { -namespace events -{ -namespace messages -{ -struct VideoInfo { int h; int w; int size; diff --git a/include/ui/SnackBar.h b/include/ui/SnackBar.h index 076b710..8a35c32 100644 --- a/include/ui/SnackBar.h +++ b/include/ui/SnackBar.h @@ -7,7 +7,8 @@ #include "OverlayWidget.h" -enum class SnackBarPosition { +enum class SnackBarPosition +{ Bottom, Top, }; diff --git a/include/ui/Theme.h b/include/ui/Theme.h index c2e809e..c6c3955 100644 --- a/include/ui/Theme.h +++ b/include/ui/Theme.h @@ -4,12 +4,15 @@ #include #include -namespace ui +namespace ui { +enum class AvatarType { -enum class AvatarType { Icon, Image, Letter }; + Icon, + Image, + Letter +}; -namespace sidebar -{ +namespace sidebar { static const int SmallSize = 60; static const int NormalSize = 300; } @@ -19,19 +22,47 @@ const int FontSize = 16; // Default avatar size. Width and height. const int AvatarSize = 40; -enum class ButtonPreset { FlatPreset, CheckablePreset }; +enum class ButtonPreset +{ + FlatPreset, + CheckablePreset +}; -enum class RippleStyle { CenteredRipple, PositionedRipple, NoRipple }; +enum class RippleStyle +{ + CenteredRipple, + PositionedRipple, + NoRipple +}; -enum class OverlayStyle { NoOverlay, TintedOverlay, GrayOverlay }; +enum class OverlayStyle +{ + NoOverlay, + TintedOverlay, + GrayOverlay +}; -enum class Role { Default, Primary, Secondary }; +enum class Role +{ + Default, + Primary, + Secondary +}; -enum class ButtonIconPlacement { LeftIcon, RightIcon }; +enum class ButtonIconPlacement +{ + LeftIcon, + RightIcon +}; -enum class ProgressType { DeterminateProgress, IndeterminateProgress }; +enum class ProgressType +{ + DeterminateProgress, + IndeterminateProgress +}; -enum class Color { +enum class Color +{ Black, BrightWhite, FadedWhite, diff --git a/resources/icons/add-file.png b/resources/icons/add-file.png deleted file mode 100644 index 806b166..0000000 Binary files a/resources/icons/add-file.png and /dev/null differ diff --git a/resources/icons/clip-dark.png b/resources/icons/clip-dark.png deleted file mode 100644 index c3c34fa..0000000 Binary files a/resources/icons/clip-dark.png and /dev/null differ diff --git a/resources/icons/cog.png b/resources/icons/cog.png deleted file mode 100644 index 8431116..0000000 Binary files a/resources/icons/cog.png and /dev/null differ diff --git a/resources/icons/emoji-categories/activity.png b/resources/icons/emoji-categories/activity.png index 7824765..2d36076 100644 Binary files a/resources/icons/emoji-categories/activity.png and b/resources/icons/emoji-categories/activity.png differ diff --git a/resources/icons/emoji-categories/activity.svg b/resources/icons/emoji-categories/activity.svg deleted file mode 100644 index d3d713e..0000000 --- a/resources/icons/emoji-categories/activity.svg +++ /dev/null @@ -1,25 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/activity@2x.png b/resources/icons/emoji-categories/activity@2x.png new file mode 100644 index 0000000..d8f8871 Binary files /dev/null and b/resources/icons/emoji-categories/activity@2x.png differ diff --git a/resources/icons/emoji-categories/diversity.svg b/resources/icons/emoji-categories/diversity.svg deleted file mode 100755 index 2498950..0000000 --- a/resources/icons/emoji-categories/diversity.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/resources/icons/emoji-categories/flags.png b/resources/icons/emoji-categories/flags.png index 47f6837..9a52000 100644 Binary files a/resources/icons/emoji-categories/flags.png and b/resources/icons/emoji-categories/flags.png differ diff --git a/resources/icons/emoji-categories/flags.svg b/resources/icons/emoji-categories/flags.svg deleted file mode 100644 index bc9ec6f..0000000 --- a/resources/icons/emoji-categories/flags.svg +++ /dev/null @@ -1,29 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/flags@2x.png b/resources/icons/emoji-categories/flags@2x.png new file mode 100644 index 0000000..4535059 Binary files /dev/null and b/resources/icons/emoji-categories/flags@2x.png differ diff --git a/resources/icons/emoji-categories/foods.png b/resources/icons/emoji-categories/foods.png index 2443ece..15c3106 100644 Binary files a/resources/icons/emoji-categories/foods.png and b/resources/icons/emoji-categories/foods.png differ diff --git a/resources/icons/emoji-categories/foods.svg b/resources/icons/emoji-categories/foods.svg deleted file mode 100644 index 40c97c1..0000000 --- a/resources/icons/emoji-categories/foods.svg +++ /dev/null @@ -1,25 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/foods@2x.png b/resources/icons/emoji-categories/foods@2x.png new file mode 100644 index 0000000..bbdd2a3 Binary files /dev/null and b/resources/icons/emoji-categories/foods@2x.png differ diff --git a/resources/icons/emoji-categories/nature.png b/resources/icons/emoji-categories/nature.png index 7a131ba..eb1786c 100644 Binary files a/resources/icons/emoji-categories/nature.png and b/resources/icons/emoji-categories/nature.png differ diff --git a/resources/icons/emoji-categories/nature.svg b/resources/icons/emoji-categories/nature.svg deleted file mode 100644 index 4f29128..0000000 --- a/resources/icons/emoji-categories/nature.svg +++ /dev/null @@ -1,36 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/nature@2x.png b/resources/icons/emoji-categories/nature@2x.png new file mode 100644 index 0000000..81db5c0 Binary files /dev/null and b/resources/icons/emoji-categories/nature@2x.png differ diff --git a/resources/icons/emoji-categories/objects.png b/resources/icons/emoji-categories/objects.png index 7f6a8d1..45c6eb3 100644 Binary files a/resources/icons/emoji-categories/objects.png and b/resources/icons/emoji-categories/objects.png differ diff --git a/resources/icons/emoji-categories/objects.svg b/resources/icons/emoji-categories/objects.svg deleted file mode 100644 index 67c4361..0000000 --- a/resources/icons/emoji-categories/objects.svg +++ /dev/null @@ -1,30 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/objects@2x.png b/resources/icons/emoji-categories/objects@2x.png new file mode 100644 index 0000000..01fd5cb Binary files /dev/null and b/resources/icons/emoji-categories/objects@2x.png differ diff --git a/resources/icons/emoji-categories/people.png b/resources/icons/emoji-categories/people.png index 8c826fa..710e808 100644 Binary files a/resources/icons/emoji-categories/people.png and b/resources/icons/emoji-categories/people.png differ diff --git a/resources/icons/emoji-categories/people.svg b/resources/icons/emoji-categories/people.svg deleted file mode 100644 index 3184902..0000000 --- a/resources/icons/emoji-categories/people.svg +++ /dev/null @@ -1,37 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/people@2x.png b/resources/icons/emoji-categories/people@2x.png new file mode 100644 index 0000000..142ba09 Binary files /dev/null and b/resources/icons/emoji-categories/people@2x.png differ diff --git a/resources/icons/emoji-categories/recent.svg b/resources/icons/emoji-categories/recent.svg deleted file mode 100644 index e79b2eb..0000000 --- a/resources/icons/emoji-categories/recent.svg +++ /dev/null @@ -1,29 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/symbols.png b/resources/icons/emoji-categories/symbols.png index 69a3975..08184de 100644 Binary files a/resources/icons/emoji-categories/symbols.png and b/resources/icons/emoji-categories/symbols.png differ diff --git a/resources/icons/emoji-categories/symbols.svg b/resources/icons/emoji-categories/symbols.svg deleted file mode 100644 index 75f30ee..0000000 --- a/resources/icons/emoji-categories/symbols.svg +++ /dev/null @@ -1,46 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/symbols@2x.png b/resources/icons/emoji-categories/symbols@2x.png new file mode 100644 index 0000000..b5e7cc6 Binary files /dev/null and b/resources/icons/emoji-categories/symbols@2x.png differ diff --git a/resources/icons/emoji-categories/travel.png b/resources/icons/emoji-categories/travel.png index ab50f7c..93da773 100644 Binary files a/resources/icons/emoji-categories/travel.png and b/resources/icons/emoji-categories/travel.png differ diff --git a/resources/icons/emoji-categories/travel.svg b/resources/icons/emoji-categories/travel.svg deleted file mode 100644 index ca6cb32..0000000 --- a/resources/icons/emoji-categories/travel.svg +++ /dev/null @@ -1,34 +0,0 @@ - -image/svg+xml \ No newline at end of file diff --git a/resources/icons/emoji-categories/travel@2x.png b/resources/icons/emoji-categories/travel@2x.png new file mode 100644 index 0000000..2f72a28 Binary files /dev/null and b/resources/icons/emoji-categories/travel@2x.png differ diff --git a/resources/icons/emoji-categories/unicode9.svg b/resources/icons/emoji-categories/unicode9.svg deleted file mode 100755 index 310c422..0000000 --- a/resources/icons/emoji-categories/unicode9.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/resources/icons/error.png b/resources/icons/error.png deleted file mode 100644 index 295dbf0..0000000 Binary files a/resources/icons/error.png and /dev/null differ diff --git a/resources/icons/left-angle.png b/resources/icons/left-angle.png deleted file mode 100644 index 7154328..0000000 Binary files a/resources/icons/left-angle.png and /dev/null differ diff --git a/resources/icons/left-chevron.png b/resources/icons/left-chevron.png deleted file mode 100644 index 386395f..0000000 Binary files a/resources/icons/left-chevron.png and /dev/null differ diff --git a/resources/icons/plus-symbol.png b/resources/icons/plus-symbol.png deleted file mode 100644 index 35aef7d..0000000 Binary files a/resources/icons/plus-symbol.png and /dev/null differ diff --git a/resources/icons/power-button-off.png b/resources/icons/power-button-off.png deleted file mode 100644 index 2409032..0000000 Binary files a/resources/icons/power-button-off.png and /dev/null differ diff --git a/resources/icons/search.png b/resources/icons/search.png deleted file mode 100644 index 94e2f4f..0000000 Binary files a/resources/icons/search.png and /dev/null differ diff --git a/resources/icons/send-button.png b/resources/icons/send-button.png deleted file mode 100644 index d19bf69..0000000 Binary files a/resources/icons/send-button.png and /dev/null differ diff --git a/resources/icons/share-dark.png b/resources/icons/share-dark.png deleted file mode 100644 index 3e4d42a..0000000 Binary files a/resources/icons/share-dark.png and /dev/null differ diff --git a/resources/icons/smile.png b/resources/icons/smile.png deleted file mode 100644 index f226a5f..0000000 Binary files a/resources/icons/smile.png and /dev/null differ diff --git a/resources/icons/ui/add-square-button.png b/resources/icons/ui/add-square-button.png new file mode 100644 index 0000000..a4933c1 Binary files /dev/null and b/resources/icons/ui/add-square-button.png differ diff --git a/resources/icons/ui/add-square-button@2x.png b/resources/icons/ui/add-square-button@2x.png new file mode 100644 index 0000000..b2c4a44 Binary files /dev/null and b/resources/icons/ui/add-square-button@2x.png differ diff --git a/resources/icons/ui/angle-pointing-to-left.png b/resources/icons/ui/angle-pointing-to-left.png new file mode 100644 index 0000000..7c5432a Binary files /dev/null and b/resources/icons/ui/angle-pointing-to-left.png differ diff --git a/resources/icons/ui/angle-pointing-to-left@2x.png b/resources/icons/ui/angle-pointing-to-left@2x.png new file mode 100644 index 0000000..f2fa93c Binary files /dev/null and b/resources/icons/ui/angle-pointing-to-left@2x.png differ diff --git a/resources/icons/ui/cloud-storage-uploading-option.png b/resources/icons/ui/cloud-storage-uploading-option.png new file mode 100644 index 0000000..f679d67 Binary files /dev/null and b/resources/icons/ui/cloud-storage-uploading-option.png differ diff --git a/resources/icons/ui/cloud-storage-uploading-option@2x.png b/resources/icons/ui/cloud-storage-uploading-option@2x.png new file mode 100644 index 0000000..162bc95 Binary files /dev/null and b/resources/icons/ui/cloud-storage-uploading-option@2x.png differ diff --git a/resources/icons/ui/cursor.png b/resources/icons/ui/cursor.png new file mode 100644 index 0000000..cc7a247 Binary files /dev/null and b/resources/icons/ui/cursor.png differ diff --git a/resources/icons/ui/cursor@2x.png b/resources/icons/ui/cursor@2x.png new file mode 100644 index 0000000..d02d29f Binary files /dev/null and b/resources/icons/ui/cursor@2x.png differ diff --git a/resources/icons/ui/paper-clip-outline.png b/resources/icons/ui/paper-clip-outline.png new file mode 100644 index 0000000..a30fd07 Binary files /dev/null and b/resources/icons/ui/paper-clip-outline.png differ diff --git a/resources/icons/ui/paper-clip-outline@2x.png b/resources/icons/ui/paper-clip-outline@2x.png new file mode 100644 index 0000000..6cb3d6a Binary files /dev/null and b/resources/icons/ui/paper-clip-outline@2x.png differ diff --git a/resources/icons/ui/plus-black-symbol.png b/resources/icons/ui/plus-black-symbol.png new file mode 100644 index 0000000..4ddfc93 Binary files /dev/null and b/resources/icons/ui/plus-black-symbol.png differ diff --git a/resources/icons/ui/plus-black-symbol@2x.png b/resources/icons/ui/plus-black-symbol@2x.png new file mode 100644 index 0000000..c217b39 Binary files /dev/null and b/resources/icons/ui/plus-black-symbol@2x.png differ diff --git a/resources/icons/ui/power-button-off.png b/resources/icons/ui/power-button-off.png new file mode 100644 index 0000000..7763de0 Binary files /dev/null and b/resources/icons/ui/power-button-off.png differ diff --git a/resources/icons/ui/power-button-off@2x.png b/resources/icons/ui/power-button-off@2x.png new file mode 100644 index 0000000..a462944 Binary files /dev/null and b/resources/icons/ui/power-button-off@2x.png differ diff --git a/resources/icons/ui/settings.png b/resources/icons/ui/settings.png new file mode 100644 index 0000000..6e013f7 Binary files /dev/null and b/resources/icons/ui/settings.png differ diff --git a/resources/icons/ui/settings@2x.png b/resources/icons/ui/settings@2x.png new file mode 100644 index 0000000..dae0536 Binary files /dev/null and b/resources/icons/ui/settings@2x.png differ diff --git a/resources/icons/ui/smile.png b/resources/icons/ui/smile.png new file mode 100644 index 0000000..161d46d Binary files /dev/null and b/resources/icons/ui/smile.png differ diff --git a/resources/icons/ui/smile@2x.png b/resources/icons/ui/smile@2x.png new file mode 100644 index 0000000..acc439e Binary files /dev/null and b/resources/icons/ui/smile@2x.png differ diff --git a/resources/icons/ui/speech-bubbles-comment-option.png b/resources/icons/ui/speech-bubbles-comment-option.png new file mode 100644 index 0000000..3ec0165 Binary files /dev/null and b/resources/icons/ui/speech-bubbles-comment-option.png differ diff --git a/resources/icons/ui/speech-bubbles-comment-option@2x.png b/resources/icons/ui/speech-bubbles-comment-option@2x.png new file mode 100644 index 0000000..8a07321 Binary files /dev/null and b/resources/icons/ui/speech-bubbles-comment-option@2x.png differ diff --git a/resources/icons/ui/vertical-ellipsis.png b/resources/icons/ui/vertical-ellipsis.png new file mode 100644 index 0000000..5ce9d78 Binary files /dev/null and b/resources/icons/ui/vertical-ellipsis.png differ diff --git a/resources/icons/ui/vertical-ellipsis@2x.png b/resources/icons/ui/vertical-ellipsis@2x.png new file mode 100644 index 0000000..9af0c04 Binary files /dev/null and b/resources/icons/ui/vertical-ellipsis@2x.png differ diff --git a/resources/icons/user-shape.png b/resources/icons/user-shape.png deleted file mode 100644 index 1b4b46c..0000000 Binary files a/resources/icons/user-shape.png and /dev/null differ diff --git a/resources/icons/vertical-ellipsis.png b/resources/icons/vertical-ellipsis.png deleted file mode 100644 index 8271445..0000000 Binary files a/resources/icons/vertical-ellipsis.png and /dev/null differ diff --git a/resources/login.png b/resources/login.png new file mode 100644 index 0000000..e65084e Binary files /dev/null and b/resources/login.png differ diff --git a/resources/login@2x.png b/resources/login@2x.png new file mode 100644 index 0000000..4f89112 Binary files /dev/null and b/resources/login@2x.png differ diff --git a/resources/register.png b/resources/register.png new file mode 100644 index 0000000..e65084e Binary files /dev/null and b/resources/register.png differ diff --git a/resources/register@2x.png b/resources/register@2x.png new file mode 100644 index 0000000..4f89112 Binary files /dev/null and b/resources/register@2x.png differ diff --git a/resources/res.qrc b/resources/res.qrc index 13a7d30..59d6559 100644 --- a/resources/res.qrc +++ b/resources/res.qrc @@ -1,33 +1,58 @@ - icons/left-chevron.png - icons/left-angle.png - icons/add-file.png - icons/send-button.png - icons/cog.png - icons/search.png - icons/plus-symbol.png - icons/clip-dark.png - icons/share-dark.png - icons/user-shape.png - icons/power-button-off.png - icons/smile.png - icons/error.png + icons/ui/cursor.png + icons/ui/cursor@2x.png + icons/ui/settings.png + icons/ui/settings@2x.png + icons/ui/smile.png + icons/ui/smile@2x.png + icons/ui/speech-bubbles-comment-option.png + icons/ui/speech-bubbles-comment-option@2x.png + icons/ui/vertical-ellipsis.png + icons/ui/vertical-ellipsis@2x.png + icons/ui/power-button-off.png + icons/ui/power-button-off@2x.png + icons/ui/plus-black-symbol.png + icons/ui/plus-black-symbol@2x.png + icons/ui/add-square-button.png + icons/ui/add-square-button@2x.png + icons/ui/cloud-storage-uploading-option.png + icons/ui/cloud-storage-uploading-option@2x.png + icons/ui/paper-clip-outline.png + icons/ui/paper-clip-outline@2x.png + icons/ui/angle-pointing-to-left.png + icons/ui/angle-pointing-to-left@2x.png icons/emoji-categories/people.png + icons/emoji-categories/people@2x.png icons/emoji-categories/nature.png + icons/emoji-categories/nature@2x.png icons/emoji-categories/foods.png + icons/emoji-categories/foods@2x.png icons/emoji-categories/activity.png + icons/emoji-categories/activity@2x.png icons/emoji-categories/travel.png + icons/emoji-categories/travel@2x.png icons/emoji-categories/objects.png + icons/emoji-categories/objects@2x.png icons/emoji-categories/symbols.png + icons/emoji-categories/symbols@2x.png icons/emoji-categories/flags.png - - icons/vertical-ellipsis.png + icons/emoji-categories/flags@2x.png nheko.png + + splash.png + splash@2x.png + + register.png + register@2x.png + + login.png + login@2x.png + nheko-512.png nheko-256.png nheko-128.png @@ -37,16 +62,10 @@ - fonts/OpenSans/OpenSans-Light.ttf - fonts/OpenSans/OpenSans-LightItalic.ttf fonts/OpenSans/OpenSans-Regular.ttf fonts/OpenSans/OpenSans-Italic.ttf fonts/OpenSans/OpenSans-Bold.ttf - fonts/OpenSans/OpenSans-BoldItalic.ttf fonts/OpenSans/OpenSans-Semibold.ttf - fonts/OpenSans/OpenSans-SemiboldItalic.ttf - fonts/OpenSans/OpenSans-ExtraBold.ttf - fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf fonts/EmojiOne/emojione-android.ttf diff --git a/resources/splash.png b/resources/splash.png new file mode 100644 index 0000000..4f89112 Binary files /dev/null and b/resources/splash.png differ diff --git a/resources/splash@2x.png b/resources/splash@2x.png new file mode 100644 index 0000000..3c39b0b Binary files /dev/null and b/resources/splash@2x.png differ diff --git a/src/Cache.cc b/src/Cache.cc index c96ec37..3f7b141 100644 --- a/src/Cache.cc +++ b/src/Cache.cc @@ -36,8 +36,7 @@ Cache::Cache(const QString &userId) , roomDb_{ 0 } , isMounted_{ false } , userId_{ userId } -{ -} +{} void Cache::setup() diff --git a/src/ChatPage.cc b/src/ChatPage.cc index 92692fc..2484418 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -60,8 +60,11 @@ ChatPage::ChatPage(QSharedPointer client, QWidget *parent) sideBarMainLayout_->setSpacing(0); sideBarMainLayout_->setMargin(0); + sidebarActions_ = new SideBarActions(this); + sideBarLayout_->addLayout(sideBarTopLayout_); sideBarLayout_->addLayout(sideBarMainLayout_); + sideBarLayout_->addWidget(sidebarActions_); sideBarTopWidget_ = new QWidget(sideBar_); sideBarTopWidget_->setStyleSheet("background-color: #d6dde3; color: #ebebeb;"); diff --git a/src/Deserializable.cc b/src/Deserializable.cc index 9bef7d6..6033f89 100644 --- a/src/Deserializable.cc +++ b/src/Deserializable.cc @@ -23,8 +23,7 @@ DeserializationException::DeserializationException(const std::string &msg) : msg_(msg) -{ -} +{} const char * DeserializationException::what() const noexcept diff --git a/src/EmojiPanel.cc b/src/EmojiPanel.cc index 2730ddb..16299ac 100644 --- a/src/EmojiPanel.cc +++ b/src/EmojiPanel.cc @@ -63,43 +63,53 @@ EmojiPanel::EmojiPanel(QWidget *parent) categoriesLayout->setSpacing(6); categoriesLayout->setMargin(5); + QIcon icon; + auto peopleCategory = new FlatButton(emojiCategories); - peopleCategory->setIcon(QIcon(":/icons/icons/emoji-categories/people.png")); + icon.addFile(":/icons/icons/emoji-categories/people.png"); + peopleCategory->setIcon(icon); peopleCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); peopleCategory->setForegroundColor("gray"); auto natureCategory_ = new FlatButton(emojiCategories); - natureCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/nature.png")); + icon.addFile(":/icons/icons/emoji-categories/nature.png"); + natureCategory_->setIcon(icon); natureCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); natureCategory_->setForegroundColor("gray"); auto foodCategory_ = new FlatButton(emojiCategories); - foodCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/foods.png")); + icon.addFile(":/icons/icons/emoji-categories/foods.png"); + foodCategory_->setIcon(icon); foodCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); foodCategory_->setForegroundColor("gray"); auto activityCategory = new FlatButton(emojiCategories); - activityCategory->setIcon(QIcon(":/icons/icons/emoji-categories/activity.png")); + icon.addFile(":/icons/icons/emoji-categories/activity.png"); + activityCategory->setIcon(icon); activityCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); activityCategory->setForegroundColor("gray"); auto travelCategory = new FlatButton(emojiCategories); - travelCategory->setIcon(QIcon(":/icons/icons/emoji-categories/travel.png")); + icon.addFile(":/icons/icons/emoji-categories/travel.png"); + travelCategory->setIcon(icon); travelCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); travelCategory->setForegroundColor("gray"); auto objectsCategory = new FlatButton(emojiCategories); - objectsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/objects.png")); + icon.addFile(":/icons/icons/emoji-categories/objects.png"); + objectsCategory->setIcon(icon); objectsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); objectsCategory->setForegroundColor("gray"); auto symbolsCategory = new FlatButton(emojiCategories); - symbolsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/symbols.png")); + icon.addFile(":/icons/icons/emoji-categories/symbols.png"); + symbolsCategory->setIcon(icon); symbolsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); symbolsCategory->setForegroundColor("gray"); auto flagsCategory = new FlatButton(emojiCategories); - flagsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/flags.png")); + icon.addFile(":/icons/icons/emoji-categories/flags.png"); + flagsCategory->setIcon(icon); flagsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); flagsCategory->setForegroundColor("gray"); diff --git a/src/EmojiPickButton.cc b/src/EmojiPickButton.cc index 4f7dd59..06d97d4 100644 --- a/src/EmojiPickButton.cc +++ b/src/EmojiPickButton.cc @@ -22,8 +22,7 @@ EmojiPickButton::EmojiPickButton(QWidget *parent) : FlatButton(parent) , panel_{ nullptr } -{ -} +{} void EmojiPickButton::enterEvent(QEvent *e) diff --git a/src/Login.cc b/src/Login.cc index d0dd1ea..16c6f17 100644 --- a/src/Login.cc +++ b/src/Login.cc @@ -27,8 +27,7 @@ LoginRequest::LoginRequest() {} LoginRequest::LoginRequest(QString username, QString password) : user_(username) , password_(password) -{ -} +{} QByteArray LoginRequest::serialize() noexcept diff --git a/src/LoginPage.cc b/src/LoginPage.cc index fd7fede..bbe2a13 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -42,16 +42,16 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) top_bar_layout_->addStretch(1); QIcon icon; - icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); + icon.addFile(":/icons/icons/ui/angle-pointing-to-left.png"); back_button_->setIcon(icon); - back_button_->setIconSize(QSize(24, 24)); + back_button_->setIconSize(QSize(32, 32)); - QIcon advanced_settings_icon; - advanced_settings_icon.addFile(":/icons/icons/cog.png", QSize(), QIcon::Normal, QIcon::Off); + QIcon logo; + logo.addFile(":/logos/login.png"); logo_ = new QLabel(this); - logo_->setPixmap(QPixmap(":/logos/nheko-128.png")); + logo_->setPixmap(logo.pixmap(128)); logo_layout_ = new QHBoxLayout(); logo_layout_->setContentsMargins(0, 0, 0, 20); diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 06f8245..8cb2b56 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -176,8 +176,8 @@ MainWindow::showChatPage(QString userid, QString homeserver, QString token) new LoadingIndicator(this), [=](LoadingIndicator *indicator) { indicator->deleteLater(); }); spinner_->setColor("#acc7dc"); - spinner_->setFixedHeight(120); - spinner_->setFixedWidth(120); + spinner_->setFixedHeight(100); + spinner_->setFixedWidth(100); spinner_->start(); } diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc index 29876f9..5b459ea 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc @@ -24,8 +24,7 @@ RoomSearchInput::RoomSearchInput(QWidget *parent) : TextField(parent) -{ -} +{} bool RoomSearchInput::focusNextPrevChild(bool next) diff --git a/src/Register.cc b/src/Register.cc index 2e2c227..db3ce4f 100644 --- a/src/Register.cc +++ b/src/Register.cc @@ -25,8 +25,7 @@ RegisterRequest::RegisterRequest(const QString &username, const QString &password) : user_(username) , password_(password) -{ -} +{} QByteArray RegisterRequest::serialize() noexcept diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc index e485de7..bcd02be 100644 --- a/src/RegisterPage.cc +++ b/src/RegisterPage.cc @@ -38,17 +38,20 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent) back_button_->setMinimumSize(QSize(30, 30)); QIcon icon; - icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); + icon.addFile(":/icons/icons/ui/angle-pointing-to-left.png"); back_button_->setIcon(icon); - back_button_->setIconSize(QSize(24, 24)); + back_button_->setIconSize(QSize(32, 32)); back_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); back_layout_->addStretch(1); + QIcon logo; + logo.addFile(":/logos/register.png"); + logo_ = new Avatar(this); - logo_->setImage(QImage(":/logos/nheko-128.png")); - logo_->setSize(80); + logo_->setIcon(logo); + logo_->setSize(128); logo_layout_ = new QHBoxLayout(); logo_layout_->setMargin(0); diff --git a/src/SideBarActions.cc b/src/SideBarActions.cc new file mode 100644 index 0000000..d4874c6 --- /dev/null +++ b/src/SideBarActions.cc @@ -0,0 +1,65 @@ +#include +#include + +#include "Config.h" +#include "Theme.h" +#include + +SideBarActions::SideBarActions(QWidget *parent) + : QWidget{ parent } +{ + setFixedHeight(conf::sidebarActions::height); + + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + setSizePolicy(sizePolicy); + + layout_ = new QHBoxLayout(this); + layout_->setMargin(0); + + QIcon settingsIcon; + settingsIcon.addFile(":/icons/icons/ui/settings.png"); + + QIcon createRoomIcon; + createRoomIcon.addFile(":/icons/icons/ui/add-square-button.png"); + + QIcon joinRoomIcon; + joinRoomIcon.addFile(":/icons/icons/ui/speech-bubbles-comment-option.png"); + + settingsBtn_ = new FlatButton(this); + settingsBtn_->setIcon(settingsIcon); + settingsBtn_->setCornerRadius(conf::sidebarActions::iconSize / 2); + settingsBtn_->setIconSize( + QSize(conf::sidebarActions::iconSize, conf::sidebarActions::iconSize)); + + createRoomBtn_ = new FlatButton(this); + createRoomBtn_->setIcon(createRoomIcon); + createRoomBtn_->setCornerRadius(conf::sidebarActions::iconSize / 2); + createRoomBtn_->setIconSize( + QSize(conf::sidebarActions::iconSize, conf::sidebarActions::iconSize)); + + joinRoomBtn_ = new FlatButton(this); + joinRoomBtn_->setIcon(joinRoomIcon); + joinRoomBtn_->setCornerRadius(conf::sidebarActions::iconSize / 2); + joinRoomBtn_->setIconSize( + QSize(conf::sidebarActions::iconSize, conf::sidebarActions::iconSize)); + + layout_->addWidget(createRoomBtn_); + layout_->addWidget(joinRoomBtn_); + layout_->addWidget(settingsBtn_); +} + +SideBarActions::~SideBarActions() {} + +void +SideBarActions::resizeEvent(QResizeEvent *event) +{ + Q_UNUSED(event); + + if (width() <= ui::sidebar::SmallSize) { + joinRoomBtn_->hide(); + createRoomBtn_->hide(); + } else { + joinRoomBtn_->show(); + createRoomBtn_->show(); + } +} diff --git a/src/TextInputWidget.cc b/src/TextInputWidget.cc index b90a7ca..0d5e110 100644 --- a/src/TextInputWidget.cc +++ b/src/TextInputWidget.cc @@ -45,7 +45,7 @@ TextInputWidget::TextInputWidget(QWidget *parent) { setFont(QFont("Emoji One")); - setFixedHeight(50); + setFixedHeight(conf::textInput::height); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setCursor(Qt::ArrowCursor); setStyleSheet("background-color: #fff;"); @@ -55,15 +55,13 @@ TextInputWidget::TextInputWidget(QWidget *parent) topLayout_->setContentsMargins(15, 0, 15, 5); QIcon send_file_icon; - send_file_icon.addFile(":/icons/icons/clip-dark.png", QSize(), QIcon::Normal, QIcon::Off); + send_file_icon.addFile(":/icons/icons/ui/paper-clip-outline.png"); sendFileBtn_ = new FlatButton(this); - sendFileBtn_->setForegroundColor(QColor("#acc7dc")); sendFileBtn_->setIcon(send_file_icon); sendFileBtn_->setIconSize(QSize(24, 24)); spinner_ = new LoadingIndicator(this); - spinner_->setColor("#acc7dc"); spinner_->setFixedHeight(32); spinner_->setFixedWidth(32); spinner_->hide(); @@ -79,19 +77,16 @@ TextInputWidget::TextInputWidget(QWidget *parent) input_->setStyleSheet("color: #333333; border: none; padding-top: 5px; margin: 0 5px"); sendMessageBtn_ = new FlatButton(this); - sendMessageBtn_->setForegroundColor(QColor("#acc7dc")); QIcon send_message_icon; - send_message_icon.addFile( - ":/icons/icons/share-dark.png", QSize(), QIcon::Normal, QIcon::Off); + send_message_icon.addFile(":/icons/icons/ui/cursor.png"); sendMessageBtn_->setIcon(send_message_icon); sendMessageBtn_->setIconSize(QSize(24, 24)); emojiBtn_ = new EmojiPickButton(this); - emojiBtn_->setForegroundColor(QColor("#acc7dc")); QIcon emoji_icon; - emoji_icon.addFile(":/icons/icons/smile.png", QSize(), QIcon::Normal, QIcon::Off); + emoji_icon.addFile(":/icons/icons/ui/smile.png"); emojiBtn_->setIcon(emoji_icon); emojiBtn_->setIconSize(QSize(24, 24)); diff --git a/src/TopRoomBar.cc b/src/TopRoomBar.cc index 3f93cad..5a1f2d2 100644 --- a/src/TopRoomBar.cc +++ b/src/TopRoomBar.cc @@ -62,13 +62,11 @@ TopRoomBar::TopRoomBar(QWidget *parent) textLayout_->addWidget(topicLabel_); settingsBtn_ = new FlatButton(this); - settingsBtn_->setForegroundColor(QColor("#acc7dc")); settingsBtn_->setFixedSize(buttonSize_, buttonSize_); settingsBtn_->setCornerRadius(buttonSize_ / 2); QIcon settings_icon; - settings_icon.addFile( - ":/icons/icons/vertical-ellipsis.png", QSize(), QIcon::Normal, QIcon::Off); + settings_icon.addFile(":/icons/icons/ui/vertical-ellipsis.png"); settingsBtn_->setIcon(settings_icon); settingsBtn_->setIconSize(QSize(buttonSize_ / 2, buttonSize_ / 2)); diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index 09a75a3..04cfec7 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -29,7 +29,7 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) , user_id_("@user:homeserver.org") , logoutModal_{ nullptr } , logoutDialog_{ nullptr } - , logoutButtonSize_{ 32 } + , logoutButtonSize_{ 20 } { QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); setSizePolicy(sizePolicy); @@ -77,15 +77,13 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) buttonLayout_->setMargin(0); logoutButton_ = new FlatButton(this); - logoutButton_->setForegroundColor(QColor("#555459")); - logoutButton_->setFixedSize(logoutButtonSize_, logoutButtonSize_); logoutButton_->setCornerRadius(logoutButtonSize_ / 2); QIcon icon; - icon.addFile(":/icons/icons/power-button-off.png", QSize(), QIcon::Normal, QIcon::Off); + icon.addFile(":/icons/icons/ui/power-button-off.png"); logoutButton_->setIcon(icon); - logoutButton_->setIconSize(QSize(logoutButtonSize_ / 2, logoutButtonSize_ / 2)); + logoutButton_->setIconSize(QSize(logoutButtonSize_, logoutButtonSize_)); buttonLayout_->addWidget(logoutButton_); diff --git a/src/WelcomePage.cc b/src/WelcomePage.cc index 5ea145f..1fc0c19 100644 --- a/src/WelcomePage.cc +++ b/src/WelcomePage.cc @@ -29,11 +29,14 @@ WelcomePage::WelcomePage(QWidget *parent) auto topLayout_ = new QVBoxLayout(this); topLayout_->setSpacing(20); - QFont headingFont("Open Sans", 23); - QFont subTitleFont("Open Sans", 22); + QFont headingFont("Open Sans", 22); + QFont subTitleFont("Open Sans", 21); + + QIcon icon; + icon.addFile(":/logos/splash.png"); auto logo_ = new QLabel(this); - logo_->setPixmap(QPixmap(":/logos/nheko-256.png")); + logo_->setPixmap(icon.pixmap(256)); logo_->setAlignment(Qt::AlignCenter); QString heading(tr("Welcome to nheko! The desktop client for the Matrix protocol."));