changeset 2043:47c0550792b2

sync window title with current tab
author Jorge Arellano Cid <jcid@dillo.org>
date Sun, 22 May 2011 10:16:01 -0400
parents 8f021c978252
children 8f7dfd5247f2
files src/uicmd.cc
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/uicmd.cc	Sat May 21 00:02:26 2011 +0200
+++ b/src/uicmd.cc	Sun May 22 10:16:01 2011 -0400
@@ -254,6 +254,7 @@
 {
    int idx;
    CustTabButton *btn;
+   BrowserWindow *bw;
    UI *old_ui = (UI*)Wizard->value();
 
    if (cbtn->ui() != old_ui) {
@@ -266,6 +267,12 @@
       Wizard->value(cbtn->ui());
       cbtn->color(tabcolor_active);
       cbtn->redraw();
+
+      // 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 : "");
+      }
    }
 }