Skip to content

sidebar clean-ups

These are a few clean-up commits that I wrote while looking into the UI overhaul around a top-level split view.

Note on thumbnail sidebar unmapping: The criticals (from GNOME/gtk@172cdf8e) in the thumbnail sidebar are due to expecting the page and the document of the document model to be available at the same time. The is not guarantee for that. My patches due address only the issues that are currently present, or will be when moving the widget around and changing when it is going to be instanciated, but not everything:

Patch to create criticals in the thumbnail sidebar
diff --git a/shell/pps-window.c b/shell/pps-window.c
index 5a811d42..6f23e094 100644
--- a/shell/pps-window.c
+++ b/shell/pps-window.c
@@ -1593,6 +1593,7 @@ pps_window_load_job_cb (PpsJob *job,
                pps_window_emit_doc_loaded (pps_window);
                setup_document_from_metadata (pps_window);
+               setup_model_from_metadata (pps_window);
                setup_view_from_metadata (pps_window);
                gtk_recent_manager_add_item (gtk_recent_manager_get_default (), priv->uri);
@@ -2072,7 +2073,6 @@ pps_window_open_uri (PpsWindow       *pps_window,
        set_filenames (pps_window, source_file);
        setup_size_from_metadata (pps_window);
-       setup_model_from_metadata (pps_window);
        priv->load_job = pps_job_load_new ();
        pps_job_load_set_uri (PPS_JOB_LOAD (priv->load_job), priv->uri);
@@ -2120,11 +2120,11 @@ pps_window_open_document (PpsWindow       *pps_window,
                g_free (priv->uri);
        priv->uri = g_strdup (pps_document_get_uri (document));
+       pps_document_model_set_document (priv->model, document);
        setup_size_from_metadata (pps_window);
        setup_model_from_metadata (pps_window);
-       pps_document_model_set_document (priv->model, document);
        setup_document_from_metadata (pps_window);
        setup_view_from_metadata (pps_window);

Note on thumbnail sidebar padding: This will re-introduce #32 (closed). The current solution is not correct. It would be solved by GNOME/libadwaita!1117 or a similar styling in-tree, if libadwaita does not except it. Removed from this MR, will propose later on as part of a general sidebar update.

Edited by Markus Göllnitz

Merge request reports