[gedit-plugins/gnome-3-32] Fixes to Colorschemer plugin * Underline was deprecated in GtkSourceView 4 * Foreground and backgrou



commit f643d6734ee42a0791d731da4bbd6c16067e1dd8
Author: Jordi Mas <jmas softcatala org>
Date:   Mon May 6 17:46:56 2019 +0000

    Fixes to Colorschemer plugin
    * Underline was deprecated in GtkSourceView 4
    * Foreground and background color need to be int when printed (prevents exception)

 plugins/colorschemer/schemer/schemer.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plugins/colorschemer/schemer/schemer.py b/plugins/colorschemer/schemer/schemer.py
index 5993a7d..980f8e9 100644
--- a/plugins/colorschemer/schemer/schemer.py
+++ b/plugins/colorschemer/schemer/schemer.py
@@ -24,7 +24,7 @@ import collections
 import tempfile
 from xml.etree import ElementTree as ET
 
-from gi.repository import Gtk, GdkPixbuf, Gdk, GtkSource, Gio, GLib
+from gi.repository import Gtk, GdkPixbuf, Gdk, GtkSource, Gio, GLib, Pango
 
 from .languages import samples
 
@@ -57,7 +57,7 @@ class Props:
     self.foreground = gtkStyle.props.foreground
     self.italic = gtkStyle.props.italic
     self.bold = gtkStyle.props.bold
-    self.underline = gtkStyle.props.underline
+    self.underline = gtkStyle.props.pango_underline == Pango.Underline.NONE
     self.strikethrough = gtkStyle.props.strikethrough
     
     # here we make sure every color starts with a hash
@@ -566,12 +566,12 @@ class GUI:
     if data == self.colorbuttonBackground:
       color = data.get_color()
       self.dictAllStyles[self.selectedStyleId].background = ('#%02x%02x%02x' %
-        (color.red * cScale, color.green * cScale, color.blue * cScale))
+        (int(color.red * cScale), int(color.green * cScale), int(color.blue * cScale)))
     
     elif data == self.colorbuttonForeground:
       color = data.get_color()
       self.dictAllStyles[self.selectedStyleId].foreground = ('#%02x%02x%02x' %
-        (color.red * cScale, color.green * cScale, color.blue * cScale))
+        (int(color.red * cScale), int(color.green * cScale), int(color.blue * cScale)))
     
     elif data == self.togglebuttonBold:
       self.dictAllStyles[self.selectedStyleId].bold = data.get_active()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]