diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-04 17:36:39 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-04 17:36:39 +0200 |
commit | e2a510e8c94aae88aab6293659b1a0786c799bc2 (patch) | |
tree | 86d4082f849b98710e28d9917bd2af8755fda909 | |
parent | be20a78ab01b924fc1261ff3c71361feb440e592 (diff) |
Do not draw background for item that is not selected for card view and modern spacious theme
-rw-r--r-- | src/Body.cpp | 24 | ||||
-rw-r--r-- | src/QuickMedia.cpp | 1 |
2 files changed, 3 insertions, 22 deletions
diff --git a/src/Body.cpp b/src/Body.cpp index 1669e52..a8a1966 100644 --- a/src/Body.cpp +++ b/src/Body.cpp @@ -109,7 +109,7 @@ namespace QuickMedia { top_cut_off(false), bottom_cut_off(false), item_background(sf::Vector2f(1.0f, 1.0f), 10.0f, get_theme().selected_color, rounded_rectangle_shader), - reaction_background(sf::Vector2f(1.0f, 1.0f), 10.0f, body_theme == BODY_THEME_MINIMAL ? get_theme().shade_color : get_theme().background_color, rounded_rectangle_shader), + reaction_background(sf::Vector2f(1.0f, 1.0f), 10.0f, get_theme().shade_color, rounded_rectangle_shader), rounded_rectangle_shader(rounded_rectangle_shader), rounded_rectangle_mask_shader(rounded_rectangle_mask_shader) { @@ -1120,19 +1120,6 @@ namespace QuickMedia { render_item.merge_with_previous = merge_with_previous; render_items.push_back(std::move(render_item)); - { - sf::Vector2f item_pos; - item_pos.x = std::floor(pos.x); - item_pos.y = std::floor(pos.y); - - if(body_theme == BODY_THEME_MODERN_SPACIOUS && item->is_selectable()) { - item_background.set_position(item_pos); - item_background.set_size(sf::Vector2f(size.x, item->loaded_height)); - item_background.set_color(get_theme().shade_color); - item_background.draw(window); - } - } - handle_item_render(pos, size.x, item->loaded_height, index); ++num_visible_items; @@ -1305,13 +1292,6 @@ namespace QuickMedia { new_view.setViewport(sf::FloatRect(0.0f, scissor_y / (float)window_size.y, 1.0f, size.y / (float)window_size.y)); window.setView(new_view); - if(item->is_selectable()) { - item_background.set_position(round(pos + pos_offset)); - item_background.set_size(round(sf::Vector2f(card_width, item_height))); - item_background.set_color(get_theme().card_item_background_color); - item_background.draw(window); - } - handle_item_render(pos + pos_offset, card_width, item_height, item_index); ++num_visible_items; @@ -1631,7 +1611,7 @@ namespace QuickMedia { const float gradient_height = 5.0f; if(text_offset_y >= text_height - gradient_height && std::abs(item_height - card_height) < 1) { const sf::Vector2f card_bottom(text_pos.x, text_height); - const sf::Color color = item_index == selected_item ? get_theme().selected_color : get_theme().card_item_background_color; + const sf::Color color = item_index == selected_item ? get_theme().selected_color : get_theme().background_color; sf::Vertex gradient_points[4]; gradient_points[0] = sf::Vertex(card_bottom + sf::Vector2f(0.0f, -gradient_height), sf::Color(color.r, color.g, color.b, 0)); diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index b431532..435ec3b 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -4230,6 +4230,7 @@ namespace QuickMedia { if(event.key.code == sf::Keyboard::Escape || event.key.code == sf::Keyboard::BackSpace) { navigation_stage = NavigationStage::VIEWING_COMMENTS; attached_image_texture.reset(new sf::Texture()); + redraw = true; } else if(event.key.code == sf::Keyboard::I && event.key.control && !attached_image_url.empty()) { std::vector<Tab> saucenao_tabs; saucenao_tabs.push_back(Tab{create_body(), std::make_unique<SaucenaoPage>(this, attached_image_url, false), nullptr}); |