gnome-specimen r12 - in trunk-from-bzr: . glade



Author: wbolster
Date: Tue Jun 17 18:41:25 2008
New Revision: 12
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=12&view=rev

Log:
* glade/gnome-specimen.glade:
  - Remove preview string from glade file

* specimenwindow.py:
  - Set preview string from code
  - Minor clean up to the font size handling


Modified:
   trunk-from-bzr/   (props changed)
   trunk-from-bzr/glade/gnome-specimen.glade
   trunk-from-bzr/specimenwindow.py

Modified: trunk-from-bzr/glade/gnome-specimen.glade
==============================================================================
--- trunk-from-bzr/glade/gnome-specimen.glade	(original)
+++ trunk-from-bzr/glade/gnome-specimen.glade	Tue Jun 17 18:41:25 2008
@@ -318,7 +318,7 @@
 		      <property name="editable">True</property>
 		      <property name="visibility">True</property>
 		      <property name="max_length">0</property>
-		      <property name="text" translatable="yes">The quick brown fox jumps over the lazy dog.</property>
+		      <property name="text"> </property>
 		      <property name="has_frame">True</property>
 		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
@@ -343,7 +343,7 @@
 		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
 		      <property name="snap_to_ticks">False</property>
 		      <property name="wrap">False</property>
-		      <property name="adjustment">16 0 100 1 10 10</property>
+		      <property name="adjustment">16 1 144 1 10 10</property>
 		      <signal name="changed" handler="on_preview_size_changed" last_modification_time="Sat, 29 Apr 2006 20:02:21 GMT"/>
 		    </widget>
 		    <packing>
@@ -399,7 +399,7 @@
 		  <child>
 		    <widget class="GtkLabel" id="preview-label">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">This is some sample text.</property>
+		      <property name="label"></property>
 		      <property name="use_underline">False</property>
 		      <property name="use_markup">False</property>
 		      <property name="justify">GTK_JUSTIFY_CENTER</property>

Modified: trunk-from-bzr/specimenwindow.py
==============================================================================
--- trunk-from-bzr/specimenwindow.py	(original)
+++ trunk-from-bzr/specimenwindow.py	Tue Jun 17 18:41:25 2008
@@ -10,8 +10,8 @@
     update_timeout = 0
     families = []
 
-    preview_size = 16
-    preview_text = 'This is preview text'
+    preview_size = None # on_preview_size_changed sets this
+    preview_text = 'Pack my box with five dozen liquor jugs.'
 
     def __init__(self):
         'Initializes the application'
@@ -120,6 +120,9 @@
         self.preview_text_entry = glade_tree.get_widget('preview-text-entry')
         self.preview_label = glade_tree.get_widget('preview-label')
 
+        self.preview_size_spinbutton.set_value(self.preview_size)
+        self.preview_text_entry.set_text(self.preview_text)
+
     def schedule_update_previews(self):
         'Schedules an update of the previews'
 
@@ -160,7 +163,7 @@
         except (TypeError):
             pass
 
-        attrlist.insert(pango.AttrSize(self.preview_size, 0, -1))
+        attrlist.insert(pango.AttrSize(1024 * self.preview_size, 0, -1))
 
         black = pango.Color('black')
         attrlist.insert(pango.AttrForeground(black.red, black.green, black.blue, 0, -1))
@@ -192,10 +195,7 @@
 
     def on_preview_size_changed(self, widget, user_data=None):
         'Callback for changed preview point size'
-        try:
-            self.preview_size = 1000 * int(widget.get_text()) # TODO get_int?
-        except ValueError:
-            self.preview_size = 160000
+        self.preview_size = int(widget.get_value_as_int())
         self.schedule_update_previews()
 
     def on_preview_text_changed(self, widget, user_data=None):



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