|
|
891583 |
From ee8fd31e73104313a4c564e55fd1a74e7000e0cc Mon Sep 17 00:00:00 2001
|
|
|
aaa06e |
From: Rui Matos <tiagomatos@gmail.com>
|
|
|
aaa06e |
Date: Thu, 5 Dec 2013 23:07:41 +0100
|
|
|
891583 |
Subject: [PATCH 7/8] GSettingsFontButtonTweak: filter out fonts that gtk+ 3
|
|
|
aaa06e |
doesn't honor
|
|
|
aaa06e |
|
|
|
aaa06e |
---
|
|
|
aaa06e |
gtweak/widgets.py | 12 ++++++++++++
|
|
|
aaa06e |
1 file changed, 12 insertions(+)
|
|
|
aaa06e |
|
|
|
aaa06e |
diff --git a/gtweak/widgets.py b/gtweak/widgets.py
|
|
|
891583 |
index 3c8b6a3..0b75279 100644
|
|
|
aaa06e |
--- a/gtweak/widgets.py
|
|
|
aaa06e |
+++ b/gtweak/widgets.py
|
|
|
891583 |
@@ -288,8 +288,20 @@ class GSettingsFontButtonTweak(Gtk.Box, _GSettingsTweak, _DependableMixin):
|
|
|
2b55cd |
Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
|
|
|
2b55cd |
_GSettingsTweak.__init__(self, name, schema_name, key_name, **options)
|
|
|
aaa06e |
|
|
|
aaa06e |
+ def font_filter(family, face, data):
|
|
|
aaa06e |
+ desc = face.describe()
|
|
|
aaa06e |
+ if (desc.get_style() != Pango.Style.NORMAL or
|
|
|
aaa06e |
+ desc.get_variant() != Pango.Variant.NORMAL or
|
|
|
aaa06e |
+ desc.get_weight() != Pango.Weight.NORMAL or
|
|
|
aaa06e |
+ desc.get_stretch() != Pango.Stretch.NORMAL):
|
|
|
aaa06e |
+ return False
|
|
|
aaa06e |
+ else:
|
|
|
aaa06e |
+ return True
|
|
|
aaa06e |
+
|
|
|
aaa06e |
w = Gtk.FontButton()
|
|
|
891583 |
w.set_use_font(True)
|
|
|
aaa06e |
+ if key_name == "font-name":
|
|
|
aaa06e |
+ w.set_filter_func(font_filter, None)
|
|
|
aaa06e |
self.settings.bind(key_name, w, "font-name", Gio.SettingsBindFlags.DEFAULT)
|
|
|
2b55cd |
build_label_beside_widget(name, w, hbox=self)
|
|
|
aaa06e |
self.widget_for_size_group = w
|
|
|
aaa06e |
--
|
|
|
891583 |
2.9.3
|
|
|
aaa06e |
|