[evince] window-title: Also show title/subtitle in headerbar for password view



commit acbbaa6d8e3f50e70b2b6f095516217d694a7f8b
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Jul 26 16:07:00 2014 +0200

    window-title: Also show title/subtitle in headerbar for password view

 shell/ev-window-title.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c
index ed7838a..fd44c1d 100644
--- a/shell/ev-window-title.c
+++ b/shell/ev-window-title.c
@@ -108,8 +108,8 @@ static void
 ev_window_title_update (EvWindowTitle *window_title)
 {
        GtkWindow *window = GTK_WINDOW (window_title->window);
-       GtkHeaderBar *bar = GTK_HEADER_BAR (ev_window_get_toolbar (EV_WINDOW (window)));
-       char *title = NULL, *password_title, *p;
+       GtkHeaderBar *toolbar = GTK_HEADER_BAR (ev_window_get_toolbar (EV_WINDOW (window)));
+       char *title = NULL, *p;
        char *subtitle = NULL, *title_header = NULL;
 
        if (window_title->document != NULL) {
@@ -152,15 +152,21 @@ ev_window_title_update (EvWindowTitle *window_title)
        switch (window_title->type) {
        case EV_WINDOW_TITLE_DOCUMENT:
                gtk_window_set_title (window, title);
-               if (bar && title_header && subtitle) {
-                       gtk_header_bar_set_title (bar, title_header);
-                       gtk_header_bar_set_subtitle (bar, subtitle);
+               if (title_header && subtitle) {
+                       gtk_header_bar_set_title (toolbar, title_header);
+                       gtk_header_bar_set_subtitle (toolbar, subtitle);
                }
                break;
-       case EV_WINDOW_TITLE_PASSWORD:
-               password_title = g_strdup_printf (_("%s — Password Required"), title);
+       case EV_WINDOW_TITLE_PASSWORD: {
+                gchar *password_title;
+
+               password_title = g_strdup_printf ("%s — %s", title, _("Password Required"));
                gtk_window_set_title (window, password_title);
                g_free (password_title);
+
+                gtk_header_bar_set_title (toolbar, _("Password Required"));
+                gtk_header_bar_set_subtitle (toolbar, title);
+        }
                break;
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]