diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-15 22:08:51 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2017-10-15 22:08:51 +0300 |
commit | 8390ff253d3688c3f76e3149d43d3120f9549359 (patch) | |
tree | cc93ae33329fb0b5a78d20022f638b45d98c68ae | |
parent | 33fb3ea0917c6410e9f77aafe52802712378a0a8 (diff) |
Fix icons for retina displays
122 files changed, 358 insertions, 602 deletions
diff --git a/.clang-format b/.clang-format index d5606cdf..42d7b6f7 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 6415b912..22673e66 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 @@ -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 04464bc5..be8fc12c 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 2412a4d0..b5e876c0 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 5b6f7c88..3f91f2b3 100644 --- a/include/EmojiProvider.h +++ b/include/EmojiProvider.h @@ -21,7 +21,8 @@ #include <QList> #include <QMap> -struct Emoji { +struct Emoji +{ // Unicode code. QString unicode; // Keyboard shortcut e.g :emoji: diff --git a/include/MatrixClient.h b/include/MatrixClient.h index 927fe3a6..01e2c319 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 03023038..d7009a85 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 00000000..60975a03 --- /dev/null +++ b/include/SideBarActions.h @@ -0,0 +1,23 @@ +#include <QHBoxLayout> +#include <QResizeEvent> + +#include <FlatButton.h> + +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 da73b00a..6ca91211 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 62584eb7..31d8af82 100644 --- a/include/Versions.h +++ b/ |