Some changes

This commit is contained in:
lenemter 2024-02-25 21:40:18 +09:00
parent 90b5d6cfd0
commit eef7e5a520

View File

@ -3,15 +3,19 @@
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
/* Clutter.Text with automatic management of system font */
/*
* Clutter.Text that automatically changes font-name to the system one
*/
public class Gala.Text : Clutter.Text {
private GLib.Settings gnome_interface_settings;
private static GLib.Settings gnome_interface_settings;
static construct {
gnome_interface_settings = new GLib.Settings ("org.gnome.desktop.interface");
}
construct {
gnome_interface_settings = new GLib.Settings ("org.gnome.desktop.interface");
set_system_font_name ();
gnome_interface_settings.notify["font-name"].connect (set_system_font_name);
gnome_interface_settings.changed["font-name"].connect (set_system_font_name);
}
private void set_system_font_name () {
@ -25,5 +29,7 @@ public class Gala.Text : Clutter.Text {
}
font_name = string.joinv (" ", name);
warning ("Gala.Text: Changing font to %s", font_name);
}
}