[ocrfeeder] Use the color values directly when creating color buttons for preferences



commit 5f030bdc0e13c3299dfc8efbd1e7d503828aaaf6
Author: Joaquim Rocha <jrocha igalia com>
Date:   Mon Jul 12 16:46:59 2010 +0200

    Use the color values directly when creating color buttons for preferences
    
    widgetPresenter.PreferencesDialog: Adapt the color button generator
    function so it uses the configured color values directly instead of
    converting them from string to tuples.

 studio/widgetPresenter.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/studio/widgetPresenter.py b/studio/widgetPresenter.py
index 0d59dc9..6456438 100644
--- a/studio/widgetPresenter.py
+++ b/studio/widgetPresenter.py
@@ -1281,13 +1281,12 @@ class PreferencesDialog(gtk.Dialog):
         else:
             self.custom_window_size_entry.set_sensitive(False)
 
-    def __getColorButton(self, color_string):
-        values = [int(value.strip()) for value in color_string.split(',')]
-        color_button = gtk.ColorButton(gtk.gdk.Color(values[0] << 8,
-                                                     values[1] << 8,
-                                                     values[2] << 8))
+    def __getColorButton(self, color):
+        color_button = gtk.ColorButton(gtk.gdk.Color(color[0] << 8,
+                                                     color[1] << 8,
+                                                     color[2] << 8))
         color_button.set_use_alpha(True)
-        color_button.set_alpha(values[3] << 8)
+        color_button.set_alpha(color[3] << 8)
         return color_button
 
 class SystemEnginesDialog(gtk.Dialog):



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