gedit-plugins r437 - in trunk: . plugins/terminal



Author: icq
Date: Fri Jan 16 23:34:36 2009
New Revision: 437
URL: http://svn.gnome.org/viewvc/gedit-plugins?rev=437&view=rev

Log:
2009-01-17  Ignacio Casal Quinteiro  <nacho resa gmail com>

        * plugins/terminal/terminal.py:
        Built-in terminal should reuse gnome-terminal color scheme.
        (Fixes bug #567629)



Modified:
   trunk/ChangeLog
   trunk/plugins/terminal/terminal.py

Modified: trunk/plugins/terminal/terminal.py
==============================================================================
--- trunk/plugins/terminal/terminal.py	(original)
+++ trunk/plugins/terminal/terminal.py	Fri Jan 16 23:34:36 2009
@@ -115,6 +115,7 @@
         style = self._vte.get_style()
         fg = style.text[gtk.STATE_NORMAL]
         bg = style.base[gtk.STATE_NORMAL]
+        palette = []
 
         if not gconf_get_bool(self.GCONF_PROFILE_DIR + "/use_theme_colors"):
             fg_color = gconf_get_str(self.GCONF_PROFILE_DIR + "/foreground_color", None)
@@ -123,7 +124,17 @@
             bg_color = gconf_get_str(self.GCONF_PROFILE_DIR + "/background_color", None)
             if (bg_color):
                 bg = gtk.gdk.color_parse (bg_color)
-        self._vte.set_colors(fg, bg, [])
+        str_colors = gconf_get_str(self.GCONF_PROFILE_DIR + "/palette", None)
+        if (str_colors):
+            for str_color in str_colors.split(':'):
+                try:
+                    palette.append(gtk.gdk.color_parse(str_color))
+                except:
+                    palette = []
+                    break
+            if (len(palette) not in (0, 8, 16, 24)):
+                palette = []
+        self._vte.set_colors(fg, bg, palette)
 
         # cursor blink
         blink_mode = gconf_get_str(self.GCONF_PROFILE_DIR + "/cursor_blink_mode")
@@ -212,7 +223,7 @@
         menu = self.create_popup_menu()
    
         if event is not None:
-	        menu.popup(None, None, None, event.button, event.time)
+            menu.popup(None, None, None, event.button, event.time)
         else:
             menu.popup(None, None,
                        lambda m: gedit.utils.menu_position_under_widget(m, self),



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