aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-02 01:36:43 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-02 01:36:43 +0200
commit9e68dfad4449d5c0180e252fada6de56b4f405d1 (patch)
tree5b507b70dca104852d1537bc83be61a484d65558
parent48aa56227856b46d6502203f26464c05f16b6913 (diff)
Matrix: improve entry style
-rw-r--r--TODO3
-rw-r--r--src/Entry.cpp16
2 files changed, 10 insertions, 9 deletions
diff --git a/TODO b/TODO
index c24878c..f1f8f0b 100644
--- a/TODO
+++ b/TODO
@@ -68,4 +68,5 @@ Support peertube (works with mpv, but need to implement search and related video
Scroll to bottom when receiving a new message even if the selected message is not the last one. It should instead school if the last message is visible on the screen.
Add ".." directory to file-manager, to go up one directory. Also add a tab for common directories and recently accessed files/directories (the directories would be the directory of used files).
Provide a way to go to the first unread message in matrix and also show a marker in the body (maybe a red line?) where the first unread message is.
-Sort matrix messages by timestamp. This may be needed to make notification messages show properly in the timeline? \ No newline at end of file
+Sort matrix messages by timestamp. This may be needed to make notification messages show properly in the timeline?
+Load already downloaded images/thumbnails in a separate thread, to instantly load them instead of waiting for new downloads... \ No newline at end of file
diff --git a/src/Entry.cpp b/src/Entry.cpp
index a3c576f..f9897ba 100644
--- a/src/Entry.cpp
+++ b/src/Entry.cpp
@@ -4,17 +4,17 @@
#include <SFML/Window/Event.hpp>
#include <cmath>
-const float background_margin_horizontal = 15.0f;
-const float padding_vertical = 5.0f;
-const float background_margin_vertical = 4.0f;
+const float background_margin_horizontal = 5.0f;
+const float padding_vertical = 3.0f;
+const float background_margin_vertical = 0.0f;
namespace QuickMedia {
Entry::Entry(const std::string &placeholder_text, sf::Font *font, sf::Font *cjk_font) :
on_submit_callback(nullptr),
- text("", font, cjk_font, 18, 0.0f),
+ text("", font, cjk_font, 16, 0.0f),
width(0.0f),
background(sf::Vector2f(1.0f, 1.0f), 7.0f, 10),
- placeholder(placeholder_text, *font, 18)
+ placeholder(placeholder_text, *font, 16)
{
text.setEditable(true);
background.setFillColor(sf::Color(55, 60, 68));
@@ -36,7 +36,7 @@ namespace QuickMedia {
// (and also split text into lines to not draw them at all once they are not inside the scissor box)
void Entry::draw(sf::RenderWindow &window) {
background.setSize(sf::Vector2f(width, get_height()));
- window.draw(background);
+ //window.draw(background);
if(text.getString().isEmpty() && !text.isEditable()) {
window.draw(placeholder);
//sf::Vector2f placeholder_pos = placeholder.getPosition();
@@ -65,8 +65,8 @@ namespace QuickMedia {
void Entry::set_position(const sf::Vector2f &pos) {
background.setPosition(pos);
- text.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical));
- placeholder.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical + 7.0f));
+ text.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical - 3.0f));
+ placeholder.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical + 3.0f));
}
void Entry::set_max_width(float width) {