Commit a0aae23c authored by Martin's avatar Martin

add upstream patch to fix gtk-css-provider-error-quark exception

parent 3a302b93
Description: fix gtk-css-provider-error-quark exception
Author: Philipp Hörist <forenjunkie@chello.at>
Origin: upstream
Bug: https://dev.gajim.org/gajim/gajim/issues/9106
Applied-Upstream: https://dev.gajim.org/gajim/gajim/commit/f99ec91fc29c7ae822856b318537e565ef225935
Last-Update: 2018-05-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/gajim/gtkgui_helpers.py
+++ b/gajim/gtkgui_helpers.py
@@ -37,6 +37,7 @@
import cairo
import os
import sys
+import math
try:
from PIL import Image
except:
@@ -885,7 +886,7 @@
family=font.get_family(),
size=int(round(font.get_size() / Pango.SCALE)),
unit=unit,
- weight=int(font.get_weight()))
+ weight=pango_to_css_weight(font.get_weight()))
css = css.replace("font-size: 0{unit};".format(unit=unit), "")
css = css.replace("font-weight: 0;", "")
css = "\n".join(filter(lambda x: x.strip(), css.splitlines()))
@@ -910,3 +911,13 @@
icon = get_iconset_name_for(icon_name)
surface = gtk_icon_theme.load_surface(icon, 16, scale, None, 0)
return Gtk.Image.new_from_surface(surface)
+
+def pango_to_css_weight(number):
+ # Pango allows for weight values between 100 and 1000
+ # CSS allows only full hundred numbers like 100, 200 ..
+ number = int(number)
+ if number < 100:
+ return 100
+ if number > 900:
+ return 900
+ return int(math.ceil(number / 100.0)) * 100
fix-gtk-css-provider-error-quark.patch
fix-preferences-backtrace.patch
do-not-use-distutils.patch
no-git-call.patch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment