calls-application: subclass AdwApplication
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct _CallsApplication {
|
struct _CallsApplication {
|
||||||
GtkApplication parent_instance;
|
AdwApplication parent_instance;
|
||||||
|
|
||||||
gboolean daemon;
|
gboolean daemon;
|
||||||
CallsRinger *ringer;
|
CallsRinger *ringer;
|
||||||
@@ -78,7 +78,7 @@ struct _CallsApplication {
|
|||||||
gboolean db_done;
|
gboolean db_done;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (CallsApplication, calls_application, GTK_TYPE_APPLICATION);
|
G_DEFINE_TYPE (CallsApplication, calls_application, ADW_TYPE_APPLICATION);
|
||||||
|
|
||||||
|
|
||||||
static void start_proper (CallsApplication *self);
|
static void start_proper (CallsApplication *self);
|
||||||
@@ -474,16 +474,9 @@ startup (GApplication *application)
|
|||||||
{
|
{
|
||||||
g_autoptr (GtkCssProvider) provider = NULL;
|
g_autoptr (GtkCssProvider) provider = NULL;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
AdwStyleManager *style_manager;
|
|
||||||
|
|
||||||
G_APPLICATION_CLASS (calls_application_parent_class)->startup (application);
|
G_APPLICATION_CLASS (calls_application_parent_class)->startup (application);
|
||||||
|
|
||||||
adw_init ();
|
|
||||||
|
|
||||||
style_manager = adw_style_manager_get_default ();
|
|
||||||
|
|
||||||
adw_style_manager_set_color_scheme (style_manager, ADW_COLOR_SCHEME_PREFER_LIGHT);
|
|
||||||
|
|
||||||
if (!call_audio_init (&error))
|
if (!call_audio_init (&error))
|
||||||
g_warning ("Failed to init libcallaudio: %s", error->message);
|
g_warning ("Failed to init libcallaudio: %s", error->message);
|
||||||
|
|
||||||
@@ -507,12 +500,6 @@ startup (GApplication *application)
|
|||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
manager_state_changed_cb (application);
|
manager_state_changed_cb (application);
|
||||||
|
|
||||||
provider = gtk_css_provider_new ();
|
|
||||||
gtk_css_provider_load_from_resource (provider, "/org/gnome/Calls/style.css");
|
|
||||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
|
||||||
GTK_STYLE_PROVIDER (provider),
|
|
||||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,13 +25,14 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <adwaita.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define CALLS_TYPE_APPLICATION (calls_application_get_type ())
|
#define CALLS_TYPE_APPLICATION (calls_application_get_type ())
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (CallsApplication, calls_application, CALLS, APPLICATION, GtkApplication)
|
G_DECLARE_FINAL_TYPE (CallsApplication, calls_application, CALLS, APPLICATION, AdwApplication)
|
||||||
|
|
||||||
CallsApplication *calls_application_new (void);
|
CallsApplication *calls_application_new (void);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user