aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-01-17 00:15:04 +0100
committerdec05eba <dec05eba@protonmail.com>2020-01-17 00:15:04 +0100
commit5a41103e7d7f67e001926ab4741cfec0bcbe8526 (patch)
tree9284c1f61f8877358c26705ae688b930907c0898
parent6d4fba24f82ddc8c96f9296bc1319826c29e1e34 (diff)
Draw header title and background over body
-rw-r--r--src/QuickMedia.cpp8
-rw-r--r--src/plugins/Fourchan.cpp9
-rw-r--r--src/plugins/Manganelo.cpp2
3 files changed, 12 insertions, 7 deletions
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;
}
}
diff --git a/src/plugins/Fourchan.cpp b/src/plugins/Fourchan.cpp
index 438dc3b..212e197 100644
--- a/src/plugins/Fourchan.cpp
+++ b/src/plugins/Fourchan.cpp
@@ -137,8 +137,13 @@ namespace QuickMedia {
static void extract_comment_pieces(const char *html_source, size_t size, CommentPieceCallback callback) {
TidyDoc doc = tidyCreate();
- for(int i = 0; i < N_TIDY_OPTIONS; ++i)
- tidyOptSetBool(doc, (TidyOptionId)i, no);
+ TidyIterator it_opt = tidyGetOptionList(doc);
+ while (it_opt) {
+ TidyOption opt = tidyGetNextOption(doc, &it_opt);
+ if (tidyOptGetType(opt) == TidyBoolean)
+ tidyOptSetBool(doc, tidyOptGetId(opt), no);
+ }
+ tidyOptSetInt(doc, TidyWrapLen, 0);
if(tidyParseString(doc, html_source) < 0) {
CommentPiece comment_piece;
comment_piece.type = CommentPiece::Type::TEXT;
diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp
index 2b69e62..425bf4d 100644
--- a/src/plugins/Manganelo.cpp
+++ b/src/plugins/Manganelo.cpp
@@ -119,7 +119,7 @@ namespace QuickMedia {
if(result != 0)
goto cleanup;
- result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='container-chapter-reader']//img",
+ result = quickmedia_html_find_nodes_xpath(&html_search, "//div[class='container-chapter-reader']/img",
[](QuickMediaHtmlNode *node, void *userdata) {
auto *urls = (std::vector<std::string>*)userdata;
const char *src = quickmedia_html_node_get_attribute_value(node, "src");