From 2d8401a542909612f7527320dd2f80f3de96eebc Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 30 Sep 2016 13:00:31 -0700 Subject: [PATCH] window: use SpMultiPaned This allows us to have the SpVisualizerView grow and shrink along with the visualizer content up until the user has manually moved the paned handle. At which point it clamps to that position as allowed by the size request phases. --- src/resources/ui/sp-window.ui | 10 +--------- src/sp-window.c | 31 +------------------------------ 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/resources/ui/sp-window.ui b/src/resources/ui/sp-window.ui index 4b41474b..040917f4 100644 --- a/src/resources/ui/sp-window.ui +++ b/src/resources/ui/sp-window.ui @@ -161,7 +161,7 @@ - + vertical true true @@ -180,20 +180,12 @@ - - false - false - true true - - false - true - diff --git a/src/sp-window.c b/src/sp-window.c index 4a3f357d..ac05147d 100644 --- a/src/sp-window.c +++ b/src/sp-window.c @@ -23,6 +23,7 @@ #include #include "sp-application.h" +#include "sp-multi-paned.h" #include "sp-visualizer-view.h" #include "sp-window.h" #include "sp-window-settings.h" @@ -705,18 +706,6 @@ sp_window_delete_event (GtkWidget *widget, return GDK_EVENT_PROPAGATE; } -static void -sp_window_reset_paned (SpWindow *self) -{ - gint min_height; - gint nat_height; - - g_assert (SP_IS_WINDOW (self)); - - gtk_widget_get_preferred_height (GTK_WIDGET (self->visualizers), &min_height, &nat_height); - gtk_paned_set_position (self->paned, MAX (min_height, MIN (nat_height, 300))); -} - static gboolean zoom_level_to_string (GBinding *binding, const GValue *from_value, @@ -837,18 +826,6 @@ sp_window_init (SpWindow *self) self, G_CONNECT_SWAPPED); - g_signal_connect_object (self->visualizers, - "visualizer-added", - G_CALLBACK (sp_window_reset_paned), - self, - G_CONNECT_SWAPPED); - - g_signal_connect_object (self->visualizers, - "visualizer-removed", - G_CALLBACK (sp_window_reset_paned), - self, - G_CONNECT_SWAPPED); - g_object_bind_property_full (self->zoom_manager, "zoom", self->zoom_one_label, "label", G_BINDING_SYNC_CREATE, zoom_level_to_string, NULL, NULL, NULL); @@ -872,12 +849,6 @@ sp_window_init (SpWindow *self) * launch, enter, escape, view. */ gtk_window_set_focus (GTK_WINDOW (self), GTK_WIDGET (self->record_button)); - - /* - * And finally ensure we have proper placement of our paned taking - * into account the size of the visualizers. - */ - sp_window_reset_paned (self); } static void