Grab the focus on the whole bottom panel, not the GtkStack. To do the
same as done by _gedit_cmd_view_toggle_bottom_panel(). This is subject
to change if it appears to be better to grab the focus on the GtkStack
instead.
Use the whole bottom_panel for two purposes:
- the panel visibility.
- the size (height).
The bug (now fixed)
-------------------
The bottom panel size was not correctly restored after quitting and
restarting gedit. The same when opening a new window.
Reformat also the header while at it.
The function is badly implemented, see the FIXME comment about the use
of a sync GIO API.
The code needs to be reworked.
1) Remove the deprecated signal (no longer used).
2) Rename the ::active-tab-changed-simple signal to
::active-tab-changed and adapt the code accordingly.
3) Document the API break.
- Split set_titles() in 3 functions.
- Use g_get_application_name() in every place where "gedit" was used.
- Use tepl_buffer_get_short_title() to directly get the star if the
buffer is modified.
About truncation
----------------
Do not care about truncation (remove the related code). GtkHeaderBar
truncates the strings at the end, which is good enough (the window can
be resized in order to see the whole string if needed). The single-title
is also truncated by GTK at the end if there is no GtkHeaderBar.
gnome-shell truncates also the single-title at the end for the window
tooltip in the Overview.
Truncation in the middle with GtkLabel is possible. It would be feasible
to put two custom GtkLabels in the GtkHeaderBar, but in order to do so
(to just adjust where the strings are truncated, keeping all the rest
the same) the implementation of GtkHeaderBar needs to be read and
copied. Relying on implementation details is never a good thing, so it's
better to avoid it. It's also less work to rely on the default behavior
of GtkHeaderBar, of course.
About the bug (now fixed)
-------------------------
When the filename is too long (so it needed to be truncated), the
directory was not shown as subtitle.
The diff shows more code added, but the new way is hopefully easier to
follow because it is contained in a single (smaller) class. Small
classes are in general easier to understand.
gedit is not fully ready for the 'system' theme variant setting.
The GSettings and the preferences dialog UI for the style/color schemes
(coming from libgedit-gtksourceview) need some work to be able to choose
the one that is set for a light GTK theme, and the one that is set for a
dark GTK theme.
So in the meantime, in order for gedit to be in a releasable state, use
the simplified API from Tepl. Only "force light" and "force dark" are
supported, so gedit doesn't take into account the system setting.
However with some scripting it would be possible to achieve the desired
behavior when the system setting for the GTK theme changes, adapting
automatically the style/color scheme.
See previous commits.
The 48x48 png file doesn't fit well in the <title> (the icon and the
"gedit" text are not well aligned), so take the 24x24 instead.