From 462e07a578c3a9e4a5e325d58d2c490db1c0d6eb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 26 Nov 2018 23:25:13 +0100 Subject: [PATCH] Use integer division to set font weight QFont::setFontWeight takes an int only - it looks like PyQt accepts a float and just truncates it. That's the behaviour we actually want here, but let's be explicit about it. --- qutebrowser/config/configtypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 0314805c0..38d952639 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1119,7 +1119,7 @@ class QtFont(Font): font.setWeight(weight_map[namedweight]) if weight: # based on qcssparser.cpp:setFontWeightFromValue - font.setWeight(min(int(weight) / 8, 99)) + font.setWeight(min(int(weight) // 8, 99)) if size: if size.lower().endswith('pt'): font.setPointSizeF(float(size[:-2]))