summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-05-16 13:19:27 -0400
committerJorge Arellano Cid <jcid@dillo.org>2009-05-16 13:19:27 -0400
commitf15858539330c89f607d039fc51979c432c5192c (patch)
treed757f0f7f47d7d7cc66a7ff45f20d87bacd63154
parentd935b6193905c8769ea4d869c228f2c1a6e3119f (diff)
parent3bb0ddc6679d4e8682b681845d4297cf73b93344 (diff)
merge
-rw-r--r--src/ui.cc8
-rw-r--r--src/ui.hh2
-rw-r--r--src/uicmd.cc16
3 files changed, 16 insertions, 10 deletions
diff --git a/src/ui.cc b/src/ui.cc
index 38bb7f17..15007280 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -1059,17 +1059,15 @@ void UI::set_render_layout(Widget &nw)
/*
* Set the window title
*/
-void UI::set_page_title(const char *label)
+void UI::set_tab_title(const char *label)
{
char title[128];
dReturn_if_fail(label != NULL);
snprintf(title, 128, "Dillo: %s", label);
- this->window()->copy_label(title);
- this->window()->redraw_label();
-
- if (tabs() && *label) {
+ if (*label) {
+ // Make a label for this tab
size_t tab_chars = 18;
snprintf(title, tab_chars + 1, "%s", label);
if (strlen(label) > tab_chars) {
diff --git a/src/ui.hh b/src/ui.hh
index b874e452..f77c6f6d 100644
--- a/src/ui.hh
+++ b/src/ui.hh
@@ -92,7 +92,7 @@ public:
void set_img_prog(int n_img, int t_img, int cmd);
void set_bug_prog(int n_bug);
void set_render_layout(Widget &nw);
- void set_page_title(const char *label);
+ void set_tab_title(const char *label);
void customize(int flags);
void button_set_sens(UIButton btn, int sens);
void paste_url();
diff --git a/src/uicmd.cc b/src/uicmd.cc
index 489530c4..4aa0da8f 100644
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -264,7 +264,7 @@ public:
// Update the window title
BrowserWindow *bw = a_UIcmd_get_bw_by_widget(selected_child());
const char *title = a_History_get_title(a_Nav_get_top_uidx(bw), 1);
- BW2UI(bw)->set_page_title(title ? title : "");
+ a_UIcmd_set_page_title(bw, title ? title : "");
} else if (e == MOVE) {
CustShrinkTabPager *cstp = (CustShrinkTabPager *) pager();
if (event_inside(r) && children() > 1) {
@@ -1127,12 +1127,20 @@ void a_UIcmd_set_bug_prog(BrowserWindow *bw, int n_bug)
}
/*
- * Set the page title.
- * now it goes to the window titlebar (maybe to TAB label in the future).
+ * Set the page title in the window titlebar and tab label.
+ * (Update window titlebar for the current tab only)
*/
void a_UIcmd_set_page_title(BrowserWindow *bw, const char *label)
{
- BW2UI(bw)->set_page_title(label);
+ char title[128];
+
+ if (a_UIcmd_get_bw_by_widget(BW2UI(bw)->tabs()->selected_child()) == bw) {
+ // This is the focused bw, set window title
+ snprintf(title, 128, "Dillo: %s", label);
+ BW2UI(bw)->window()->copy_label(title);
+ BW2UI(bw)->window()->redraw_label();
+ }
+ BW2UI(bw)->set_tab_title(label);
}
/*