From 07d748569c022390be4a67acb6ad9b211987e027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Tue, 14 May 2024 10:01:31 -0700 Subject: [PATCH] MainWindow: use Adw.ToolbarView (#771) --- meson.build | 2 ++ src/MainWindow.vala | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 23d47c897..af8bd5118 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,7 @@ config_file = configure_file( configuration: config_data ) +adw_dep = dependency('libadwaita-1', version: '>=1.4.0') granite_dep = dependency('granite-7') gstreamer_dep = dependency('gstreamer-1.0') gstreamer_pbutils_dep = dependency('gstreamer-pbutils-1.0') @@ -26,6 +27,7 @@ gstreamer_tag_dep = dependency('gstreamer-tag-1.0') gtk_dep = dependency('gtk4') dependencies = [ + adw_dep, granite_dep, gstreamer_dep, gstreamer_pbutils_dep, diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 01a51903e..08f8e0c9e 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -24,7 +24,6 @@ public class Music.MainWindow : Gtk.ApplicationWindow { show_title_buttons = false, title_widget = new Gtk.Label ("") }; - queue_header.add_css_class (Granite.STYLE_CLASS_FLAT); queue_header.add_css_class (Granite.STYLE_CLASS_DEFAULT_DECORATION); queue_header.pack_start (start_window_controls); queue_header.pack_end (shuffle_button); @@ -48,11 +47,12 @@ public class Music.MainWindow : Gtk.ApplicationWindow { var drop_target = new Gtk.DropTarget (typeof (Gdk.FileList), Gdk.DragAction.COPY); - var queue = new Gtk.Grid (); - queue.add_css_class (Granite.STYLE_CLASS_VIEW); - queue.attach (queue_header, 0, 0); - queue.attach (scrolled, 0, 1); + var queue = new Adw.ToolbarView () { + content = scrolled + }; queue.add_controller (drop_target); + queue.add_css_class (Granite.STYLE_CLASS_VIEW); + queue.add_top_bar (queue_header); var error_toast = new Granite.Toast ("");