aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-17 13:42:31 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-17 14:56:41 +0200
commit4a7b86829025664f6eeef6fcb5fc0894733f2ad6 (patch)
treeefd29796ec64b31609640dfea633e3ada982ee1d /include
parent9bf163d51a252fb5a611e88c2e0b4123a98169e1 (diff)
Matrix: make displayname more bright, add circle mask shader for avatar and room thumbnails
Diffstat (limited to 'include')
-rw-r--r--include/Body.hpp8
-rw-r--r--include/QuickMedia.hpp2
-rw-r--r--include/Text.hpp2
3 files changed, 11 insertions, 1 deletions
diff --git a/include/Body.hpp b/include/Body.hpp
index cdb0ad0..7032ad8 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -13,6 +13,7 @@
namespace sf {
class RenderWindow;
+ class Shader;
}
namespace QuickMedia {
@@ -25,6 +26,11 @@ namespace QuickMedia {
FAILED_TO_LOAD
};
+ enum class ThumbnailMaskType {
+ NONE,
+ CIRCLE
+ };
+
class BodyItem {
public:
BodyItem(std::string _title);
@@ -97,6 +103,7 @@ namespace QuickMedia {
sf::Int32 last_drawn_time;
EmbeddedItemStatus embedded_item_status = EmbeddedItemStatus::NONE;
std::shared_ptr<BodyItem> embedded_item; // Used by matrix for example to display reply message body. Note: only the first level of embedded items is rendered (not recursive, this is done on purpose)
+ ThumbnailMaskType thumbnail_mask_type = ThumbnailMaskType::NONE;
private:
// TODO: Clean up these strings when set in text, and get_title for example should return |title_text.getString()|
std::string title;
@@ -188,6 +195,7 @@ namespace QuickMedia {
sf::Vector2f thumbnail_fallback_size;
sf::Color line_seperator_color;
BodyItemRenderCallback body_item_render_callback;
+ sf::Shader *thumbnail_mask_shader;
private:
void draw_item(sf::RenderWindow &window, BodyItem *item, const sf::Vector2f &pos, const sf::Vector2f &size, const float item_height, const int item_index, const Json::Value &content_progress, bool include_embedded_item = true);
void update_dirty_state(BodyItem *body_item, sf::Vector2f size);
diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp
index 0a0b509..b7e6814 100644
--- a/include/QuickMedia.hpp
+++ b/include/QuickMedia.hpp
@@ -9,6 +9,7 @@
#include <memory>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
+#include <SFML/Graphics/Shader.hpp>
#include <json/value.h>
#include <unordered_set>
#include <future>
@@ -116,6 +117,7 @@ namespace QuickMedia {
bool image_download_cancel = false;
int exit_code = 0;
std::string resources_root;
+ sf::Shader circle_mask_shader;
bool use_tor = false;
bool no_video = false;
bool use_system_mpv_config = false;
diff --git a/include/Text.hpp b/include/Text.hpp
index a71bc8e..f24e79d 100644
--- a/include/Text.hpp
+++ b/include/Text.hpp
@@ -126,7 +126,7 @@ namespace QuickMedia
// Takes into consideration if index is the last vertex and the last vertex is a newline, then it should be on its own line
int get_vertex_line(int index) const;
private:
- sf::String str; // TODO: Remove this for non-editable text???
+ sf::String str; // TODO: Remove this for non-editable text??? also replace with std::string? then we get more efficient editing of text
const sf::Font *font;
const sf::Font *cjk_font;
unsigned int characterSize;