learningequality / kolibri-installer-gnome

MIT License
2 stars 7 forks source link

Change window title based on displayed content #1

Open wjt opened 4 years ago

wjt commented 4 years ago

Regardless of what page is being displayed, the app's titlebar always reads “Kolibri”. I would expect it to be a function of the current page. For example, take the following:

Capture d’écran de 2020-05-07 22-20-19

I would expect the title to be “Khan Academy (English)”, "Reading music", or some combination thereof.

In the web browser, the title is "Reading music - Khan Academy (English) - Kolibri". This would presumably be easiest to implement :-) and would still be an improvement IMO.

wjt commented 4 years ago

I'm using a build of https://github.com/learningequality/org.learningequality.Kolibri/pull/4 from a few days ago.

dylanmccall commented 4 years ago

Note that this isn't solvable here because pyeverywhere doesn't provide an interface for changing a window's title or for responding to the webview's document title changing. But I momentarily played with this in the pyeverywhere GTK front-end when I was working on it, over here: https://github.com/kollivier/pyeverywhere/blob/dev/src/pew/pygobject_gtk/webview.py. There's even a signal handler, __gtk_webview_on_notify_title. Only trouble is I was trying to keep the original title visible, using gtk_header_bar_set_subtitle with the webview's title, and that ended up looking pretty goofy. But just changing the title (overriding the original) seems reasonable to me, really :) Should be easy to do if someone would like to give it a shot!