From a4a8ee543aacb3347674428222ab1edb563a72f9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 24 Sep 2020 04:51:50 +0200 Subject: Add tab background --- src/QuickMedia.cpp | 22 +++++++++++++++++++++- src/SearchBar.cpp | 4 ++-- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index a11ce2a..8e7c8af 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -1080,6 +1080,9 @@ namespace QuickMedia { const float tab_spacer_height = 0.0f; + sf::RectangleShape tab_shade; + tab_shade.setFillColor(sf::Color(33, 38, 44)); + sf::RoundedRectangleShape tab_background(sf::Vector2f(1.0f, 1.0f), 10.0f, 10); tab_background.setFillColor(tab_selected_color); @@ -1203,6 +1206,10 @@ namespace QuickMedia { } const float tab_y = tab_spacer_height + std::floor(tab_vertical_offset + tab_height * 0.5f - (tab_text_size + 5.0f) * 0.5f); + tab_shade.setPosition(0.0f, tab_spacer_height + std::floor(tab_vertical_offset)); + tab_shade.setSize(sf::Vector2f(window_size.x, tab_height + 10.0f)); + window.draw(tab_shade); + int i = 0; for(Tab &tab : tabs) { if(i == selected_tab) { @@ -1846,6 +1853,9 @@ namespace QuickMedia { bool redraw = true; sf::Event event; + sf::RectangleShape tab_shade; + tab_shade.setFillColor(sf::Color(33, 38, 44)); + sf::RoundedRectangleShape tab_background(sf::Vector2f(1.0f, 1.0f), 10.0f, 10); tab_background.setFillColor(tab_selected_color); @@ -1910,6 +1920,10 @@ namespace QuickMedia { tabs[selected_tab].body->draw(window, body_pos, body_size); const float tab_y = tab_spacer_height + std::floor(tab_vertical_offset + tab_height * 0.5f - (tab_text_size + 5.0f) * 0.5f); + tab_shade.setPosition(0.0f, tab_spacer_height + std::floor(tab_vertical_offset)); + tab_shade.setSize(sf::Vector2f(window_size.x, tab_height + 10.0f)); + window.draw(tab_shade); + int i = 0; for(EpisodeListTab &tab : tabs) { if(tab.type == EpisodeListTabType::CREATOR @@ -3194,7 +3208,6 @@ namespace QuickMedia { const int MESSAGES_TAB_INDEX = 0; const int ROOMS_TAB_INDEX = 1; - tabs[MESSAGES_TAB_INDEX].body->clear_items(); /* if(matrix->get_cached_sync(tabs[MESSAGES_TAB_INDEX].body->items) != PluginResult::OK) { fprintf(stderr, "Failed to get matrix cached sync\n"); @@ -3323,6 +3336,9 @@ namespace QuickMedia { bool redraw = true; sf::Event event; + sf::RectangleShape tab_shade; + tab_shade.setFillColor(sf::Color(33, 38, 44)); + sf::RoundedRectangleShape tab_background(sf::Vector2f(1.0f, 1.0f), 10.0f, 10); tab_background.setFillColor(tab_selected_color); @@ -3444,6 +3460,10 @@ namespace QuickMedia { tabs[selected_tab].body->draw(window, body_pos, body_size); const float tab_y = tab_spacer_height + std::floor(tab_vertical_offset + tab_height * 0.5f - (tab_text_size + 5.0f) * 0.5f); + tab_shade.setPosition(0.0f, tab_spacer_height + std::floor(tab_vertical_offset)); + tab_shade.setSize(sf::Vector2f(window_size.x, tab_height + 10.0f)); + window.draw(tab_shade); + int i = 0; for(ChatTab &tab : tabs) { if(i == selected_tab) { diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp index ad5c298..ad6f709 100644 --- a/src/SearchBar.cpp +++ b/src/SearchBar.cpp @@ -39,7 +39,7 @@ namespace QuickMedia { //background.setCornersRadius(5); background_shadow.setFillColor(sf::Color(23, 25, 27)); //background_shadow.setPosition(background.getPosition() + sf::Vector2f(5.0f, 5.0f)); - shade.setFillColor(sf::Color(55, 60, 68)); + shade.setFillColor(sf::Color(33, 38, 44)); //background.setOutlineThickness(1.0f); //background.setOutlineColor(sf::Color(13, 15, 17)); if(plugin_logo && plugin_logo->getNativeHandle() != 0) @@ -55,7 +55,7 @@ namespace QuickMedia { (void)draw_shadow; //if(draw_shadow) // window.draw(background_shadow); - //window.draw(shade); + window.draw(shade); window.draw(background); // TODO: Render starting from the character after text length window.draw(autocomplete_text); -- cgit v1.2.3