diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Body.cpp | 15 | ||||
-rw-r--r-- | src/SearchBar.cpp | 8 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 6051e02..1165399 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -126,8 +126,10 @@ namespace QuickMedia { sf::RectangleShape item_background; item_background.setFillColor(front_color); - item_background.setOutlineThickness(1.0f); - item_background.setOutlineColor(sf::Color(63, 65, 67)); + //item_background.setOutlineThickness(1.0f); + //item_background.setOutlineColor(sf::Color(13, 15, 17)); + sf::RectangleShape item_background_shadow; + item_background_shadow.setFillColor(sf::Color(13, 15, 17)); sf::RectangleShape selected_border; selected_border.setFillColor(sf::Color::Red); @@ -143,7 +145,7 @@ namespace QuickMedia { float row_height = font_height; if(draw_thumbnails) row_height = image_height; - const float total_row_height = row_height + 10.0f; + const float total_row_height = row_height + 15.0f; const int max_visible_rows = size.y / total_row_height - 1; // Find the starting row that can be drawn to make selected row visible as well @@ -187,13 +189,16 @@ namespace QuickMedia { selected_border.setSize(sf::Vector2f(selected_border_width, row_height)); window.draw(selected_border); item_pos.x += selected_border_width; - item_background.setFillColor(front_color); + item_background.setFillColor(sf::Color(63, 65, 67)); } else { - item_background.setFillColor(sf::Color(38, 40, 42)); + item_background.setFillColor(front_color); } item_pos.x = std::floor(item_pos.x); item_pos.y = std::floor(item_pos.y); + item_background_shadow.setPosition(item_pos + sf::Vector2f(5.0f, 5.0f)); + item_background_shadow.setSize(sf::Vector2f(size.x, row_height)); + window.draw(item_background_shadow); item_background.setPosition(item_pos); item_background.setSize(sf::Vector2f(size.x, row_height)); window.draw(item_background); diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp index 5554a37..ae229b5 100644 --- a/src/SearchBar.cpp +++ b/src/SearchBar.cpp @@ -20,11 +20,14 @@ namespace QuickMedia { text.setFillColor(text_placeholder_color); background.setFillColor(front_color); background.setPosition(padding_horizontal, padding_vertical); - //background.setOutlineThickness(1.0f); - //background.setOutlineColor(sf::Color(0, 85, 119)); + background_shadow.setFillColor(sf::Color(13, 15, 17)); + background_shadow.setPosition(background.getPosition() + sf::Vector2f(5.0f, 5.0f)); + //background.setOutlineThickness(2.0f); + //background.setOutlineColor(sf::Color(13, 15, 17)); } void SearchBar::draw(sf::RenderWindow &window) { + window.draw(background_shadow); window.draw(background); window.draw(text); } @@ -45,6 +48,7 @@ namespace QuickMedia { float font_height = text.getCharacterSize() + 8.0f; float rect_height = std::floor(font_height + background_margin_vertical * 2.0f); background.setSize(sf::Vector2f(std::floor(window_size.x - padding_horizontal * 2.0f), rect_height)); + background_shadow.setSize(background.getSize()); text.setPosition(std::floor(padding_horizontal + background_margin_horizontal), std::floor(padding_vertical + background_margin_vertical)); } |