aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-10-29 20:56:03 +0100
committerdec05eba <dec05eba@protonmail.com>2019-10-29 20:56:06 +0100
commitfe211a2f2c69e2d11fc421b94918e97a2935b75e (patch)
treee1cb2aadc394aab3a91d3b6a0f1b2a4a077a8384
parent479ed7ab493c4423a4cc48adbf5ad420224fabb4 (diff)
Add drop shadow for tabs
-rw-r--r--src/QuickMedia.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index db7e214..67e0324 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -437,7 +437,10 @@ namespace QuickMedia {
const sf::Color tab_unselected_color(43, 45, 47);
sf::RectangleShape tab_spacing_rect(sf::Vector2f(0.0f, 0.0f));
tab_spacing_rect.setFillColor(tab_unselected_color);
- const float tab_spacer_height = 1.0f;
+ const float tab_spacer_height = 0.0f;
+
+ sf::RectangleShape tab_drop_shadow;
+ tab_drop_shadow.setFillColor(sf::Color(23, 25, 27));
while (current_page == Page::SEARCH_SUGGESTION) {
while (window.pollEvent(event)) {
@@ -503,6 +506,11 @@ namespace QuickMedia {
tab_spacing_rect.setPosition(0.0f, search_bar->getBottomWithoutShadow());
tab_spacing_rect.setSize(sf::Vector2f(window_size.x, tab_spacer_height));
window.draw(tab_spacing_rect);
+
+ tab_drop_shadow.setSize(sf::Vector2f(window_size.x, 5.0f));
+ tab_drop_shadow.setPosition(0.0f, std::floor(search_bar->getBottomWithoutShadow() + tab_height));
+ window.draw(tab_drop_shadow);
+
const float width_per_tab = window_size.x / tabs.size();
const float tab_y = tab_spacer_height + std::floor(search_bar->getBottomWithoutShadow() + tab_height * 0.5f - (tab_text_size + 5.0f) * 0.5f);
sf::RectangleShape tab_background(sf::Vector2f(std::floor(width_per_tab), tab_height));