diff options
author | Christopher Davis <christopherdavis@gnome.org> | 2022-02-11 17:15:47 -0800 |
---|---|---|
committer | Christopher Davis <brainblasted@disroot.org> | 2022-02-12 01:17:33 +0000 |
commit | 2abc40c1993d4c1bf353bca886b7ba1dc94e70cb (patch) | |
tree | 85eeb7ed70bbfa43d85ab2f4efa244e5f160dbdb | |
parent | 1bc2078b0aecf35fd8caaa2a20d00e9223f20ca6 (diff) | |
download | gnome-font-viewer-wip/ewlsh/gtk4.tar.gz |
font-view: Use AdwApplicationwip/ewlsh/gtk4
Also renames the CSS file so libadwaita can automatically
load it.
-rw-r--r-- | src/font-view.c | 22 | ||||
-rw-r--r-- | src/gnome-font-viewer.gresource.xml | 2 | ||||
-rw-r--r-- | src/style.css (renamed from src/application.css) | 0 |
3 files changed, 8 insertions, 16 deletions
diff --git a/src/font-view.c b/src/font-view.c index 8337192..05b0235 100644 --- a/src/font-view.c +++ b/src/font-view.c @@ -52,11 +52,11 @@ G_DECLARE_FINAL_TYPE (FontViewApplication, font_view_application, FONT_VIEW, APPLICATION, - GtkApplication) + AdwApplication) struct _FontViewApplication { - GtkApplication parent; + AdwApplication parent; GtkApplicationWindow *main_window; GtkWidget *main_grid; @@ -89,7 +89,7 @@ struct _FontViewApplication G_DEFINE_TYPE (FontViewApplication, font_view_application, - GTK_TYPE_APPLICATION); + ADW_TYPE_APPLICATION); G_DECLARE_FINAL_TYPE ( FontViewItem, font_view_item, FONT_VIEW, ITEM, GtkFlowBoxChild); @@ -1293,8 +1293,6 @@ font_view_application_startup (GApplication *application) G_APPLICATION_CLASS (font_view_application_parent_class) ->startup (application); - adw_init (); - if (!FcInit ()) g_critical ("Can't initialize fontconfig library"); @@ -1304,14 +1302,6 @@ font_view_application_startup (GApplication *application) const gchar *back_accels[] = {"<Alt>Left", NULL}; gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.back", back_accels); - - GtkCssProvider *provider = gtk_css_provider_new (); - gtk_css_provider_load_from_resource ( - GTK_CSS_PROVIDER (provider), "/org/gnome/font-viewer/application.css"); - - gtk_style_context_add_provider_for_display ( - gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); } static void @@ -1359,8 +1349,10 @@ font_view_application_class_init (FontViewApplicationClass *klass) static GApplication * font_view_application_new (void) { - return g_object_new (FONT_VIEW_TYPE_APPLICATION, "application-id", - APPLICATION_ID, "flags", G_APPLICATION_HANDLES_OPEN, + return g_object_new (FONT_VIEW_TYPE_APPLICATION, + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_HANDLES_OPEN, + "resource-base-path", "/org/gnome/font-viewer/", NULL); } diff --git a/src/gnome-font-viewer.gresource.xml b/src/gnome-font-viewer.gresource.xml index e4d5333..2a4ea62 100644 --- a/src/gnome-font-viewer.gresource.xml +++ b/src/gnome-font-viewer.gresource.xml @@ -2,6 +2,6 @@ <gresources> <gresource prefix="/org/gnome/font-viewer"> <file preprocess="xml-stripblanks">font-view-app-menu.ui</file> - <file>application.css</file> + <file>style.css</file> </gresource> </gresources> diff --git a/src/application.css b/src/style.css index d08057d..d08057d 100644 --- a/src/application.css +++ b/src/style.css |