FormattedConversationData: Fix font settings being ignored under Flatpak
Get the interface font from Gtk.Settings instead of GLib.Settings since the latter can't actually access desktop settings under Flatpak. Partial fix for #989 See also GNOME/glib#2213
This commit is contained in:
parent
13f5602446
commit
836a9ad384
1 changed files with 13 additions and 3 deletions
|
|
@ -100,6 +100,8 @@ public class FormattedConversationData : Geary.BaseObject {
|
|||
public Geary.Email? preview { get; private set; default = null; }
|
||||
|
||||
private Application.Configuration config;
|
||||
|
||||
private Gtk.Settings? gtk;
|
||||
private Pango.FontDescription font;
|
||||
|
||||
private Geary.App.Conversation? conversation = null;
|
||||
|
|
@ -115,13 +117,13 @@ public class FormattedConversationData : Geary.BaseObject {
|
|||
Geary.Email preview,
|
||||
Gee.List<Geary.RFC822.MailboxAddress> account_owner_emails) {
|
||||
this.config = config;
|
||||
this.gtk = Gtk.Settings.get_default();
|
||||
this.conversation = conversation;
|
||||
this.account_owner_emails = account_owner_emails;
|
||||
this.use_to = conversation.base_folder.used_as.is_outgoing();
|
||||
|
||||
this.font = Pango.FontDescription.from_string(
|
||||
this.config.gnome_interface.get_string("font-name")
|
||||
);
|
||||
this.gtk.notify["gtk-font-name"].connect(this.update_font);
|
||||
update_font();
|
||||
|
||||
// Load preview-related data.
|
||||
update_date_string();
|
||||
|
|
@ -472,4 +474,12 @@ public class FormattedConversationData : Geary.BaseObject {
|
|||
return ink_rect;
|
||||
}
|
||||
|
||||
private void update_font() {
|
||||
var name = "Cantarell 11";
|
||||
if (this.gtk != null) {
|
||||
name = this.gtk.gtk_font_name;
|
||||
}
|
||||
this.font = Pango.FontDescription.from_string(name);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue