aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/html.cc12
-rw-r--r--src/uicmd.cc5
-rw-r--r--src/web.cc7
3 files changed, 16 insertions, 8 deletions
diff --git a/src/html.cc b/src/html.cc
index c3235209..83be4f7a 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -2456,12 +2456,14 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize)
html->InVisitedLink = true;
html->styleEngine->setPseudoVisited ();
if (html->non_css_visited_color != -1)
- html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
+ html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR,
+ CSS_TYPE_COLOR,
html->non_css_visited_color);
} else {
html->styleEngine->setPseudoLink ();
if (html->non_css_link_color != -1)
- html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR, CSS_TYPE_COLOR,
+ html->styleEngine->setNonCssHint(CSS_PROPERTY_COLOR,
+ CSS_TYPE_COLOR,
html->non_css_link_color);
}
@@ -2739,9 +2741,11 @@ static void Html_tag_open_hr(DilloHtml *html, const char *tag, int tagsize)
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_LEFT_WIDTH,
CSS_TYPE_LENGTH_PERCENTAGE, size_top);
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
- CSS_TYPE_LENGTH_PERCENTAGE, size_bottom);
+ CSS_TYPE_LENGTH_PERCENTAGE,
+ size_bottom);
html->styleEngine->setNonCssHint (CSS_PROPERTY_BORDER_RIGHT_WIDTH,
- CSS_TYPE_LENGTH_PERCENTAGE, size_bottom);
+ CSS_TYPE_LENGTH_PERCENTAGE,
+ size_bottom);
}
HT2TB(html)->addParbreak (5, html->styleEngine->wordStyle ());
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 10b90a50..5e30d72b 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -296,8 +296,8 @@ void CustTabs::switch_tab(CustTabButton *cbtn)
// Update window title
if ((bw = a_UIcmd_get_bw_by_widget(cbtn->ui()))) {
- const char *title = a_History_get_title(NAV_TOP_UIDX(bw), 1);
- a_UIcmd_set_page_title(bw, title ? title : "");
+ const char *title = (cbtn->ui())->label();
+ cbtn->window()->copy_label(title ? title : "");
}
}
}
@@ -1157,6 +1157,7 @@ void a_UIcmd_set_page_title(BrowserWindow *bw, const char *label)
uint_t i = MIN(size - 4, 1 + a_Utf8_end_of_char(title, size - 8));
snprintf(title + i, 4, "...");
}
+ BW2UI(bw)->copy_label(title);
BW2UI(bw)->window()->copy_label(title);
}
BW2UI(bw)->tabs()->set_tab_label(BW2UI(bw), label);
diff --git a/src/web.cc b/src/web.cc
index 83700845..9daccdec 100644
--- a/src/web.cc
+++ b/src/web.cc
@@ -78,8 +78,11 @@ int a_Web_dispatch_by_type (const char *Type, DilloWeb *Web,
/* This method frees the old dw if any */
layout->setWidget(dw);
- /* Clear the title bar for pages without a <TITLE> tag */
- a_UIcmd_set_page_title(Web->bw, "");
+ /* Set the page title with the bare filename (e.g. for images),
+ * HTML pages with a <TITLE> tag will overwrite it later */
+ const char *p = strrchr(URL_STR(Web->url), '/');
+ a_UIcmd_set_page_title(Web->bw, p ? p+1 : "");
+
a_UIcmd_set_location_text(Web->bw, URL_STR(Web->url));
/* Reset both progress bars */
a_UIcmd_set_page_prog(Web->bw, 0, 2);