From 5a41103e7d7f67e001926ab4741cfec0bcbe8526 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 17 Jan 2020 00:15:04 +0100 Subject: Draw header title and background over body --- src/QuickMedia.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/QuickMedia.cpp') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index ebb367f..c0dd7cf 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -544,17 +544,17 @@ namespace QuickMedia { sf::RectangleShape tab_background(sf::Vector2f(std::floor(width_per_tab), tab_height)); int i = 0; for(Tab &tab : tabs) { - if(i == selected_tab) + if(i == selected_tab) { + tab.body->draw(window, body_pos, body_size); tab_background.setFillColor(tab_selected_color); - else + } else { tab_background.setFillColor(tab_unselected_color); + } tab_background.setPosition(std::floor(i * width_per_tab), tab_spacer_height + std::floor(search_bar->getBottomWithoutShadow())); window.draw(tab_background); const float center = (i * width_per_tab) + (width_per_tab * 0.5f); tab.text->setPosition(std::floor(center - tab.text->getLocalBounds().width * 0.5f), tab_y); window.draw(*tab.text); - if(i == selected_tab) - tab.body->draw(window, body_pos, body_size); ++i; } } -- cgit v1.2.3