Skip to content

shell: Use composite template for EvToolbar and derive from GtkBin

This MR has two goals:

  • Help with the porting of EvToolbar to GTK4 by:
    • Using composite templates as the most recent MRs (I hope that is actually a goal and not just something I have wrongly inferred 😄).
    • Deriving EvToolbar from GtkBin instead of HdyHeaderBar. I saw in !373 that this was a problem, and the commit that removed the toolbar is skipped in wip/gpoo/gtk4-rebase-port. With this, the port should by simple possible using AdwBin and AdwHeaderBar.
  • Simplify the code that does the toolbar setup. I have some other code locally which aims to make it possible for evince to work in very narrow displays (e.g: mobile phones) by relocating some widgets from the toolbar at the bottom and using the composite templates really help.

Unfortunately, I had problems adding the EvZoomAction to the composite template, because its properties currently need to be set at construct time. This does not seem possible with the template, which first create the widgets and then sets properties.

The option I could think of is to remove G_PARAM_CONSTRUCT_ONLY and move the initialization of properties to the first time they are set. But I wasn't sure this should be the desired approach, hence, I have marked the MR as draft.

Edited by Pablo Correa Gomez

Merge request reports