From 70e12f403ca064364ec8ef54d696e4b1b8dcf9be Mon Sep 17 00:00:00 2001 From: Mufeed Ali Date: Thu, 25 Apr 2024 22:36:03 +0530 Subject: [PATCH] textview: Fix setting font size --- dialect/preferences.py | 2 +- dialect/widgets/textview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dialect/preferences.py b/dialect/preferences.py index 85fdebde..be44f69f 100644 --- a/dialect/preferences.py +++ b/dialect/preferences.py @@ -134,7 +134,7 @@ def _on_translator_loading(self, window, _value): def _custom_default_font_size_switch(self, row, _value): """Called on self.custom_default_font_size::notify::enable-expansion signal""" enabled = row.get_enable_expansion() - system_font_size = int(Gtk.Settings.get_default().get_property('gtk-font-name').split()[1]) + system_font_size = int(Gtk.Settings.get_default().get_property('gtk-font-name').split(", ")[1]) if enabled: if Settings.get().default_font_size == 0: diff --git a/dialect/widgets/textview.py b/dialect/widgets/textview.py index c696cf69..eccb5199 100644 --- a/dialect/widgets/textview.py +++ b/dialect/widgets/textview.py @@ -30,7 +30,7 @@ def __init__(self, **kwargs): self.add_controller(scroll_ctrlr) # Custom font - self._font_size = int(Gtk.Settings.get_default().get_property('gtk-font-name').split()[1]) + self._font_size = int(Gtk.Settings.get_default().get_property('gtk-font-name').split(", ")[1]) self._font_css_provider = Gtk.CssProvider() # Add font CSS provider