GNOME Bugzilla – Bug 733746
Use subtitle in Headerbar
Last modified: 2018-05-22 15:43:35 UTC
This allows us to gain some horizontal space by splitting the former title "TITLE - filename" into a title and subtitle used in GtkHeaderbar.
Created attachment 281701 [details] [review] shell: Add ev_window_get_toolbar We need this to set the title and subtitle of the Toolbar.
Created attachment 281702 [details] [review] shell: Set title and subtitle in the HeaderBar. If the document has a defined title, this is used as a title while the filename is used as subtitle. If there is no title, we just set the title to the filename
Review of attachment 281701 [details] [review]: Ok, please see my comments before pushing. ::: shell/ev-window.c @@ +7256,3 @@ } +EvToolbar * This should be GtkWidget like in the header.
Review of attachment 281702 [details] [review]: Ok, let's fix my comments before landing this ::: shell/ev-window-title.c @@ +136,3 @@ ev_window_title_sanitize_title (window_title, &title); + title_combined = g_strdup_printf ("%s — %s", filename, title); + subtitle = filename; Why don't you simply reuse the subtitle var? It's a bit confusing having this local variable here, but freed in a different scope. @@ +140,2 @@ } else if (window_title->uri) { title = get_filename_from_uri (window_title->uri); This should be also title_combined now @@ +140,3 @@ } else if (window_title->uri) { title = get_filename_from_uri (window_title->uri); } else if (!title) { And the next one. @@ +156,3 @@ break; case EV_WINDOW_TITLE_PASSWORD: password_title = g_strdup_printf (_("%s — Password Required"), title); Maybe we can split this one too.
Review of attachment 281702 [details] [review]: ::: shell/ev-window-title.c @@ +136,2 @@ ev_window_title_sanitize_title (window_title, &title); + title_combined = g_strdup_printf ("%s — %s", filename, title); I wonder how this should work for RTL
Ok, i push slightly different patches. It is pending to see how to deal with password mode and rtl, but we had this issue before
It looks nice. BTW, the RTL should be something like: gboolean rtl; rtl = gtk_widget_get_direction (GTK_WIDGET (window)) == GTK_TEXT_DIR_RTL; if (rtl) title = g_strdup_printf ("%s — %s", subtitle, title); else title = g_strdup_printf ("%s — %s", title, subtitle);
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/486.