diff --git a/panels/sound/cc-sound-panel.c b/panels/sound/cc-sound-panel.c index 93abf3cb6712692159ca9925531e170097536845..a5367e8c6d7cd00b2dfc1da9df5d5adfcb7835ef 100644 --- a/panels/sound/cc-sound-panel.c +++ b/panels/sound/cc-sound-panel.c @@ -40,7 +40,7 @@ #include "cc-sound-panel.h" #include "cc-sound-resources.h" #include "cc-subwoofer-slider.h" -#include "cc-volume-levels-window.h" +#include "cc-volume-levels-page.h" #include "cc-volume-slider.h" struct _CcSoundPanel @@ -224,10 +224,11 @@ test_output_configuration_button_clicked_cb (CcSoundPanel *self) static void volume_levels_activated_cb (CcSoundPanel *self) { - CcVolumeLevelsWindow *volume_levels; + CcVolumeLevelsPage *volume_levels; - volume_levels = cc_volume_levels_window_new (self->mixer_control); - adw_dialog_present (ADW_DIALOG (volume_levels), GTK_WIDGET (self)); + volume_levels = cc_volume_levels_page_new (self->mixer_control); + + cc_panel_push_subpage (CC_PANEL (self), ADW_NAVIGATION_PAGE (volume_levels)); } static void diff --git a/panels/sound/cc-sound-panel.ui b/panels/sound/cc-sound-panel.ui index 4980d275389005c9089379d375938204c24f889b..ce6d945a960e10881532b674e30318741fcfb811 100644 --- a/panels/sound/cc-sound-panel.ui +++ b/panels/sound/cc-sound-panel.ui @@ -1,185 +1,216 @@ horizontal diff --git a/panels/sound/cc-volume-levels-window.c b/panels/sound/cc-volume-levels-page.c similarity index 83% rename from panels/sound/cc-volume-levels-window.c rename to panels/sound/cc-volume-levels-page.c index d54813383061929f8f71383111a7b4caacbe22ed..9af77b516a8bec4c0be87d580abd6f3ab492b116 100644 --- a/panels/sound/cc-volume-levels-window.c +++ b/panels/sound/cc-volume-levels-page.c @@ -21,11 +21,11 @@ #include #include "cc-stream-row.h" -#include "cc-volume-levels-window.h" +#include "cc-volume-levels-page.h" -struct _CcVolumeLevelsWindow +struct _CcVolumeLevelsPage { - AdwDialog parent_instance; + AdwNavigationPage parent_instance; GtkListBox *listbox; GtkSizeGroup *label_size_group; @@ -34,14 +34,14 @@ struct _CcVolumeLevelsWindow GListStore *stream_list; }; -G_DEFINE_TYPE (CcVolumeLevelsWindow, cc_volume_levels_window, ADW_TYPE_DIALOG) +G_DEFINE_TYPE (CcVolumeLevelsPage, cc_volume_levels_page, ADW_TYPE_NAVIGATION_PAGE) static gint sort_stream (gconstpointer a, gconstpointer b, gpointer user_data) { - CcVolumeLevelsWindow *self = user_data; + CcVolumeLevelsPage *self = user_data; GvcMixerStream *stream_a, *stream_b, *event_sink; g_autofree gchar *name_a = NULL; g_autofree gchar *name_b = NULL; @@ -92,7 +92,7 @@ static GtkWidget * create_stream_row (gpointer item, gpointer user_data) { - CcVolumeLevelsWindow *self = user_data; + CcVolumeLevelsPage *self = user_data; GvcMixerStream *stream = item; guint id; CcStreamRow *row; @@ -104,7 +104,7 @@ create_stream_row (gpointer item, } static void -stream_added_cb (CcVolumeLevelsWindow *self, +stream_added_cb (CcVolumeLevelsPage *self, guint id) { GvcMixerStream *stream = gvc_mixer_control_lookup_stream_id (self->mixer_control, id); @@ -116,7 +116,7 @@ stream_added_cb (CcVolumeLevelsWindow *self, } static void -stream_removed_cb (CcVolumeLevelsWindow *self, +stream_removed_cb (CcVolumeLevelsPage *self, guint id) { guint n_items = g_list_model_get_n_items (G_LIST_MODEL (self->stream_list)); @@ -141,38 +141,38 @@ static void add_stream (gpointer data, gpointer user_data) { - CcVolumeLevelsWindow *self = user_data; + CcVolumeLevelsPage *self = user_data; GvcMixerStream *stream = data; g_list_store_append (self->stream_list, G_OBJECT (stream)); } static void -cc_volume_levels_window_dispose (GObject *object) +cc_volume_levels_page_dispose (GObject *object) { - CcVolumeLevelsWindow *self = CC_VOLUME_LEVELS_WINDOW (object); + CcVolumeLevelsPage *self = CC_VOLUME_LEVELS_PAGE (object); g_clear_object (&self->mixer_control); - G_OBJECT_CLASS (cc_volume_levels_window_parent_class)->dispose (object); + G_OBJECT_CLASS (cc_volume_levels_page_parent_class)->dispose (object); } void -cc_volume_levels_window_class_init (CcVolumeLevelsWindowClass *klass) +cc_volume_levels_page_class_init (CcVolumeLevelsPageClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - object_class->dispose = cc_volume_levels_window_dispose; + object_class->dispose = cc_volume_levels_page_dispose; - gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/sound/cc-volume-levels-window.ui"); + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/sound/cc-volume-levels-page.ui"); - gtk_widget_class_bind_template_child (widget_class, CcVolumeLevelsWindow, listbox); - gtk_widget_class_bind_template_child (widget_class, CcVolumeLevelsWindow, label_size_group); + gtk_widget_class_bind_template_child (widget_class, CcVolumeLevelsPage, listbox); + gtk_widget_class_bind_template_child (widget_class, CcVolumeLevelsPage, label_size_group); } void -cc_volume_levels_window_init (CcVolumeLevelsWindow *self) +cc_volume_levels_page_init (CcVolumeLevelsPage *self) { GtkFilter *filter; GtkFilterListModel *filter_model; @@ -195,13 +195,13 @@ cc_volume_levels_window_init (CcVolumeLevelsWindow *self) self, NULL); } -CcVolumeLevelsWindow * -cc_volume_levels_window_new (GvcMixerControl *mixer_control) +CcVolumeLevelsPage * +cc_volume_levels_page_new (GvcMixerControl *mixer_control) { - CcVolumeLevelsWindow *self; + CcVolumeLevelsPage *self; g_autoptr(GSList) streams = NULL; - self = g_object_new (CC_TYPE_VOLUME_LEVELS_WINDOW, NULL); + self = g_object_new (CC_TYPE_VOLUME_LEVELS_PAGE, NULL); self->mixer_control = g_object_ref (mixer_control); diff --git a/panels/sound/cc-volume-levels-window.h b/panels/sound/cc-volume-levels-page.h similarity index 74% rename from panels/sound/cc-volume-levels-window.h rename to panels/sound/cc-volume-levels-page.h index 4092b835291d7ee7a23b89ace963c9cee3a5154e..af549ee84d36df98332e1a7c92770f8c5db69303 100644 --- a/panels/sound/cc-volume-levels-window.h +++ b/panels/sound/cc-volume-levels-page.h @@ -22,9 +22,9 @@ G_BEGIN_DECLS -#define CC_TYPE_VOLUME_LEVELS_WINDOW (cc_volume_levels_window_get_type ()) -G_DECLARE_FINAL_TYPE (CcVolumeLevelsWindow, cc_volume_levels_window, CC, VOLUME_LEVELS_WINDOW, AdwDialog) +#define CC_TYPE_VOLUME_LEVELS_PAGE (cc_volume_levels_page_get_type ()) +G_DECLARE_FINAL_TYPE (CcVolumeLevelsPage, cc_volume_levels_page, CC, VOLUME_LEVELS_PAGE, AdwNavigationPage) -CcVolumeLevelsWindow *cc_volume_levels_window_new (GvcMixerControl *mixer_control); +CcVolumeLevelsPage *cc_volume_levels_page_new (GvcMixerControl *mixer_control); G_END_DECLS diff --git a/panels/sound/cc-volume-levels-window.ui b/panels/sound/cc-volume-levels-page.ui similarity index 85% rename from panels/sound/cc-volume-levels-window.ui rename to panels/sound/cc-volume-levels-page.ui index f05d6d0b48372577d8bc80945950288fe92b09ad..14da9c8499fee85809b0003d5f04cfc0a7bf6476 100644 --- a/panels/sound/cc-volume-levels-window.ui +++ b/panels/sound/cc-volume-levels-page.ui @@ -1,9 +1,7 @@ -