From 9e68dfad4449d5c0180e252fada6de56b4f405d1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 2 Oct 2020 01:36:43 +0200 Subject: Matrix: improve entry style --- src/Entry.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') 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 #include -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) { -- cgit v1.2.3