[ocrfeeder] Moved advanced options into a gtk.Expander for cleaning up the UI



commit fff57591899430851467a66f43af9628f25f9dee
Author: Juanje Ojeda <jojeda emergya es>
Date:   Tue Mar 15 00:32:08 2011 +0100

    Moved advanced options into a gtk.Expander for cleaning up the UI

 src/ocrfeeder/studio/customWidgets.py   |   15 +++++++++++++++
 src/ocrfeeder/studio/widgetPresenter.py |    4 ++--
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/ocrfeeder/studio/customWidgets.py b/src/ocrfeeder/studio/customWidgets.py
index ff8e637..6d0e6d3 100644
--- a/src/ocrfeeder/studio/customWidgets.py
+++ b/src/ocrfeeder/studio/customWidgets.py
@@ -408,3 +408,18 @@ class PlainFrame(gtk.Frame):
 
     def add(self, widget):
         self.container.add(widget)
+
+class PlainExpander(gtk.Expander):
+
+    def __init__(self, label):
+        super(PlainExpander, self).__init__()
+        label_widget = gtk.Label()
+        label_widget.set_markup('<b>' + label + '</b>')
+        self.set_label_widget(label_widget)
+        self.container = gtk.Alignment(0, 0, 1, 1)
+        self.container.set_padding(12, 0, 12, 12)
+        super(PlainExpander, self).add(self.container)
+        self.set_expanded(False)
+
+    def add(self, widget):
+        self.container.add(widget)
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index 42cbde2..b94351e 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -18,7 +18,7 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ###########################################################################
 
-from customWidgets import PlainFrame
+from customWidgets import PlainFrame, PlainExpander
 from dataHolder import DataBox, TEXT_TYPE, IMAGE_TYPE
 from configuration import ConfigurationManager
 from ocrfeeder.util import lib, PAPER_SIZES
@@ -413,7 +413,7 @@ class BoxEditor(gtk.ScrolledWindow, gobject.GObject):
                 height == self.height_spin_button.get_value()
 
     def __makeBoundsProperties(self):
-        dimensions_frame = PlainFrame(_('Bounds'))
+        dimensions_frame = PlainExpander(_('Bounds'))
         box = gtk.VBox(True, 0)
         row = gtk.HBox(False, 12)
         size_group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)



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