After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733746 - Use subtitle in Headerbar
Use subtitle in Headerbar
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-25 16:11 UTC by José Aliste
Modified: 2018-05-22 15:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Add ev_window_get_toolbar (1.42 KB, patch)
2014-07-25 16:13 UTC, José Aliste
committed Details | Review
shell: Set title and subtitle in the HeaderBar. (2.27 KB, patch)
2014-07-25 16:13 UTC, José Aliste
committed Details | Review

Description José Aliste 2014-07-25 16:11:54 UTC
This allows us to gain some horizontal space by splitting the former title "TITLE - filename" into a title and subtitle used in GtkHeaderbar.
Comment 1 José Aliste 2014-07-25 16:13:22 UTC
Created attachment 281701 [details] [review]
shell: Add ev_window_get_toolbar

We need this to set the title and subtitle of the Toolbar.
Comment 2 José Aliste 2014-07-25 16:13:25 UTC
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
Comment 3 Carlos Garcia Campos 2014-07-25 16:15:03 UTC
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.
Comment 4 Carlos Garcia Campos 2014-07-25 16:22:29 UTC
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.
Comment 5 Germán Poo-Caamaño 2014-07-25 16:32:35 UTC
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
Comment 6 José Aliste 2014-07-25 21:42:12 UTC
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
Comment 7 Germán Poo-Caamaño 2014-07-26 00:26:06 UTC
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);
Comment 8 GNOME Infrastructure Team 2018-05-22 15:43:35 UTC
-- 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.