Skip to content

Commit

Permalink
window-title: Also show title/subtitle in headerbar for password view
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Garcia Campos committed Jul 26, 2014
1 parent 19ca8fc commit acbbaa6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions shell/ev-window-title.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit acbbaa6

Please sign in to comment.